Ignore:
Timestamp:
Oct 24, 2008, 3:49:02 PM (12 years ago)
Author:
nico
Message:

Add php binding for pipi_command
Add a php rewrite of pipi.c in examples/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi-php/php_pipi.c

    r3080 r3086  
    203203
    204204PHP_FUNCTION(pipi_command) {
     205        zval *res;
     206        char *arg1, *arg2 = NULL;
     207        int arg1_len, arg2_len;
     208        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|s", &res, &arg1, &arg1_len, &arg2, &arg2_len) == FAILURE) {
     209                RETURN_FALSE;
     210        }
     211
     212        pipi_context_t *ctxt;
     213        ZEND_FETCH_RESOURCE(ctxt, pipi_context_t*, &res, -1, PHP_PIPI_CONTEXT_RES_NAME, le_pipi_context);
     214
     215        if (arg2_len != 0) {
     216                RETURN_LONG(pipi_command(ctxt, arg1, arg2));
     217        }
     218        RETURN_LONG(pipi_command(ctxt, arg1)); 
    205219}
    206220
Note: See TracChangeset for help on using the changeset viewer.