cvs: php4 /ext/sablot php_sablot.h sablot.c

From: Date: Mon, 04 Sep 2000 03:49:58 +0000
Subject: cvs: php4 /ext/sablot php_sablot.h sablot.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-1537@lists.php.net to get a copy of this message
sterling Sun Sep 3 20:49:58 2000 EDT Modified files: /php4/ext/sablot php_sablot.h sablot.c Log: Convert 2 internal functions to follow naming conventions. Revert small patch made earlier Index: php4/ext/sablot/php_sablot.h diff -u php4/ext/sablot/php_sablot.h:1.2 php4/ext/sablot/php_sablot.h:1.3 --- php4/ext/sablot/php_sablot.h:1.2 Sun Sep 3 12:58:12 2000 +++ php4/ext/sablot/php_sablot.h Sun Sep 3 20:49:58 2000 @@ -80,7 +80,6 @@ char *output_transform_file; int le_sablot; int last_errno; - int current_processor; } php_sablot_globals; Index: php4/ext/sablot/sablot.c diff -u php4/ext/sablot/sablot.c:1.3 php4/ext/sablot/sablot.c:1.4 --- php4/ext/sablot/sablot.c:1.3 Sun Sep 3 12:58:12 2000 +++ php4/ext/sablot/sablot.c Sun Sep 3 20:49:58 2000 @@ -50,8 +50,8 @@ /* PHP Utility Functions */ static void m_convert_to_string_ex(int argc, ...); -static zval *_php_xslt_string_zval(const char *str); -static zval *_php_xslt_resource_zval(long value); +static zval *_php_sablot_string_zval(const char *str); +static zval *_php_sablot_resource_zval(long value); /* Free macros */ #define S_FREE(var) if (var) efree(var); @@ -369,12 +369,6 @@ SablotHandle p; int ret; SABLOTLS_FETCH(); - - if (SABLOTG(current_processor)) { - Z_TYPE_P(return_value) = IS_RESOURCE; - Z_LVAL_P(return_value) = SABLOTG(current_processor); - return; - } ret = SablotCreateProcessor(&p); @@ -409,7 +403,6 @@ ZEND_REGISTER_RESOURCE(return_value, handle, SABLOTG(le_sablot)); handle->index = Z_LVAL_P(return_value); - SABLOTG(current_processor) = Z_LVAL_P(return_value); } /* }}} */ @@ -843,7 +836,7 @@ if (handle->startDocHandler) { zval *args[1]; - args[0] = _php_xslt_resource_zval(handle->index); + args[0] = _php_sablot_resource_zval(handle->index); _php_sablot_call_handler_function(handle->startDocHandler, 1, args, "start document"); } @@ -858,8 +851,8 @@ if (handle->startElementHandler) { zval *args[3]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(name); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(name); MAKE_STD_ZVAL(args[2]); if (array_init(args[2]) == FAILURE) { @@ -869,7 +862,7 @@ while (attributes && *attributes) { char *key = (char *)attributes[0]; - zval *value = _php_xslt_string_zval(attributes[1]); + zval *value = _php_sablot_string_zval(attributes[1]); add_assoc_string(args[2], key, Z_STRVAL_P(value), 0); attributes += 2; @@ -888,8 +881,8 @@ if (handle->endElementHandler) { zval *args[2]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(name); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(name); _php_sablot_call_handler_function(handle->endElementHandler, 2, args, "end element"); } @@ -904,9 +897,9 @@ if (handle->startNamespaceHandler) { zval *args[3]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(prefix); - args[2] = _php_xslt_string_zval(uri); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(prefix); + args[2] = _php_sablot_string_zval(uri); _php_sablot_call_handler_function(handle->startNamespaceHandler, 3, args, "start namespace"); } @@ -921,8 +914,8 @@ if (handle->endNamespaceHandler) { zval *args[2]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(prefix); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(prefix); _php_sablot_call_handler_function(handle->endNamespaceHandler, 2, args, "end namespace"); } @@ -937,8 +930,8 @@ if (handle->commentHandler) { zval *args[2]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(contents); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(contents); _php_sablot_call_handler_function(handle->commentHandler, 2, args, "comment"); } @@ -953,9 +946,9 @@ if (handle->PIHandler) { zval *args[3]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(target); - args[2] = _php_xslt_string_zval(contents); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(target); + args[2] = _php_sablot_string_zval(contents); _php_sablot_call_handler_function(handle->PIHandler, 3, args, "PI Handler"); } @@ -970,8 +963,8 @@ if (handle->charactersHandler) { zval *args[2]; - args[0] = _php_xslt_resource_zval(handle->index); - args[1] = _php_xslt_string_zval(contents); + args[0] = _php_sablot_resource_zval(handle->index); + args[1] = _php_sablot_string_zval(contents); _php_sablot_call_handler_function(handle->charactersHandler, 2, args, "characters"); } @@ -986,7 +979,7 @@ if (handle->endDocHandler) { zval *args[1]; - args[0] = _php_xslt_resource_zval(handle->index); + args[0] = _php_sablot_resource_zval(handle->index); _php_sablot_call_handler_function(handle->endDocHandler, 1, args, "end document"); } @@ -1086,7 +1079,6 @@ SablotUnregHandler(handle->p, HLR_SAX, NULL, NULL); SablotDestroyProcessor(handle->p); } - SABLOTG(current_processor) = 0; FUNCH_FREE(handle->startDocHandler); FUNCH_FREE(handle->startElementHandler); @@ -1108,8 +1100,8 @@ } S_FREE(handle->errors); } - S_FREE(handle); #endif + S_FREE(handle); } /* }}} */ @@ -1136,9 +1128,9 @@ } /* }}} */ -/* {{{ _php_xslt_string_zval() +/* {{{ _php_sablot_string_zval() Converts a Sablotron string to a zval */ -static zval *_php_xslt_string_zval(const char *str) +static zval *_php_sablot_string_zval(const char *str) { zval *ret; int len = strlen(str); @@ -1151,9 +1143,9 @@ } /* }}} */ -/* {{{ _php_xslt_resource_zval() +/* {{{ _php_sablot_resource_zval() Converts a long identifier to a resource id */ -static zval *_php_xslt_resource_zval(long value) +static zval *_php_sablot_resource_zval(long value) { zval *ret; MAKE_STD_ZVAL(ret);

« previous php.cvs (#1537) next »