Develop and Download Open Source Software

Browse CVS Repository

Diff of /xoonips/AL/xnpal.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.45 by orrisroot, Wed Jul 6 10:53:08 2005 UTC revision 1.46 by aga4096, Tue Jul 12 06:41:34 2005 UTC
# Line 2730  ZEND_FUNCTION(xnp_get_change_logs) Line 2730  ZEND_FUNCTION(xnp_get_change_logs)
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    
# Line 2763  ZEND_FUNCTION(xnp_get_config_value) Line 2765  ZEND_FUNCTION(xnp_get_config_value)
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    

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26