| 2730 |
*/ |
*/ |
| 2731 |
ZEND_FUNCTION(xnp_get_config_value) |
ZEND_FUNCTION(xnp_get_config_value) |
| 2732 |
{ |
{ |
| 2733 |
zval *zname; |
char* name; |
| 2734 |
zval *zvalue; |
int nameLen; |
| 2735 |
char* value; |
zval* zvalue; |
| 2736 |
|
char* value = 0; |
| 2737 |
|
|
| 2738 |
result_t result = RES_ERROR; |
result_t result = RES_ERROR; |
| 2739 |
|
|
| 2740 |
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", |
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sz/", |
| 2741 |
&zname, &zvalue) == FAILURE) { |
&name, &nameLen, &zvalue ) == FAILURE) { |
| 2742 |
return; |
return; |
| 2743 |
} |
} |
| 2744 |
result = getConfigValue( getZvalString( &zname ), &value ); |
|
| 2745 |
|
result = getConfigValue( name, &value ); |
| 2746 |
if( result == RES_OK ){ |
if( result == RES_OK ){ |
| 2747 |
zvalue -> type = IS_STRING; |
ZVAL_STRING( zvalue, value, true/*duplicate*/ ); |
|
zvalue -> value.str.len = strlen(value); |
|
|
zvalue -> value.str.val = estrdup(value); |
|
|
freeString( value ); |
|
| 2748 |
} |
} |
| 2749 |
|
if ( value != 0 ) |
| 2750 |
|
freeString( value ); |
| 2751 |
RETURN_LONG( result ); |
RETURN_LONG( result ); |
| 2752 |
} |
} |
| 2753 |
|
|
| 2765 |
*/ |
*/ |
| 2766 |
ZEND_FUNCTION(xnp_set_config_value) |
ZEND_FUNCTION(xnp_set_config_value) |
| 2767 |
{ |
{ |
| 2768 |
zval *zname; |
char *name; |
| 2769 |
zval *zvalue; |
int nameLen; |
| 2770 |
|
char *value; |
| 2771 |
|
int valueLen; |
| 2772 |
result_t result = RES_ERROR; |
result_t result = RES_ERROR; |
| 2773 |
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", |
| 2774 |
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", |
&name, &nameLen, &value, &valueLen ) == FAILURE) { |
|
&zname, &zvalue) == FAILURE) { |
|
| 2775 |
return; |
return; |
| 2776 |
} |
} |
| 2777 |
result = setConfigValue( getZvalString( &zname ), getZvalString( &zvalue ) ); |
result = setConfigValue( name, value ); |
| 2778 |
RETURN_LONG( result ); |
RETURN_LONG( result ); |
| 2779 |
} |
} |
| 2780 |
|
|