cvs: php4 /ext/xslt sablot.c

From: Date: Tue, 13 Nov 2001 09:54:05 +0000
Subject: cvs: php4 /ext/xslt sablot.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-8171@lists.php.net to get a copy of this message
derick Tue Nov 13 04:54:05 2001 EDT Modified files: /php4/ext/xslt sablot.c Log: - Fix scheme/sax handlers (patch by Lenar Lõhmus <lenar@vision.ee>) Index: php4/ext/xslt/sablot.c diff -u php4/ext/xslt/sablot.c:1.25 php4/ext/xslt/sablot.c:1.26 --- php4/ext/xslt/sablot.c:1.25 Thu Oct 11 19:33:54 2001 +++ php4/ext/xslt/sablot.c Tue Nov 13 04:54:05 2001 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: sablot.c,v 1.25 2001/10/11 23:33:54 ssb Exp $ */ +/* $Id: sablot.c,v 1.26 2001/11/13 09:54:05 derick Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -38,7 +38,7 @@ #include <fcntl.h> /* functions relating to handlers */ -static void register_sax_handler_pair(zval *, zval *, zval **); +static void register_sax_handler_pair(zval **, zval **, zval **); /* Free processor */ static void free_processor(zend_rsrc_list_entry *rsrc TSRMLS_DC); @@ -245,20 +245,20 @@ /* Document handlers (document start, document end) */ if (strcasecmp(string_key, "document") == 0) { - register_sax_handler_pair(XSLT_SAX(handle).doc_start, - XSLT_SAX(handle).doc_end, + register_sax_handler_pair(&XSLT_SAX(handle).doc_start, + &XSLT_SAX(handle).doc_end, handler); } /* Element handlers, start of an element, and end of an element */ else if (strcasecmp(string_key, "element") == 0) { - register_sax_handler_pair(XSLT_SAX(handle).element_start, - XSLT_SAX(handle).element_end, + register_sax_handler_pair(&XSLT_SAX(handle).element_start, + &XSLT_SAX(handle).element_end, handler); } /* Namespace handlers, start of a namespace, end of a namespace */ else if (strcasecmp(string_key, "namespace") == 0) { - register_sax_handler_pair(XSLT_SAX(handle).namespace_start, - XSLT_SAX(handle).namespace_end, + register_sax_handler_pair(&XSLT_SAX(handle).namespace_start, + &XSLT_SAX(handle).namespace_end, handler); } /* Comment handlers, called when a comment is reached */ @@ -292,7 +292,7 @@ zval **processor_p, /* Resource pointer to the php->sablotron handle */ **scheme_handlers_p, /* Pointer to the scheme handler array */ **handler; /* Individual scheme handler */ - zval *assign_handle; /* The handler to assign to */ + zval **assign_handle; /* The handler to assign to */ HashTable *scheme_handlers; /* Scheme handler array */ php_xslt *handle; /* php->sablotron handle */ char *string_key; /* Hash key (string) */ @@ -328,31 +328,31 @@ /* Open the URI and return the whole string */ if (strcasecmp(string_key, "get_all") == 0) { - assign_handle = XSLT_SCHEME(handle).get_all; + assign_handle = &XSLT_SCHEME(handle).get_all; } /* Open the URI and return a handle */ else if (strcasecmp(string_key, "open") == 0) { - assign_handle = XSLT_SCHEME(handle).open; + assign_handle = &XSLT_SCHEME(handle).open; } /* Retrieve data from the URI */ else if (strcasecmp(string_key, "get") == 0) { - assign_handle = XSLT_SCHEME(handle).get; + assign_handle = &XSLT_SCHEME(handle).get; } /* Save data to the URI */ else if (strcasecmp(string_key, "put") == 0) { - assign_handle = XSLT_SCHEME(handle).put; + assign_handle = &XSLT_SCHEME(handle).put; } /* Close the URI */ else if (strcasecmp(string_key, "close") == 0) { - assign_handle = XSLT_SCHEME(handle).close; + assign_handle = &XSLT_SCHEME(handle).close; } /* Invalid handler name */ else { php_error(E_WARNING, "Invalid option to xslt_set_scheme_handlers(): %s", string_key); } - assign_handle = *handler; - zval_add_ref(&assign_handle); + *assign_handle = *handler; + zval_add_ref(assign_handle); } } /* }}} */ @@ -659,14 +659,14 @@ /* {{{ register_sax_handler_pair() Register a pair of sax handlers */ -static void register_sax_handler_pair(zval *handler1, zval *handler2, zval **handler) +static void register_sax_handler_pair(zval **handler1, zval **handler2, zval **handler) { zval **current; /* The current handler we're grabbing */ /* Grab and assign handler 1 */ if (zend_hash_index_find(Z_ARRVAL_PP(handler), 0, (void **) &current) == SUCCESS) { - handler1 = *current; - zval_add_ref(&handler1); + *handler1 = *current; + zval_add_ref(handler1); } else { php_error(E_WARNING, "Wrong format of arguments to xslt_set_sax_handlers()"); @@ -675,8 +675,8 @@ /* Grab and assign handler 2 */ if (zend_hash_index_find(Z_ARRVAL_PP(handler), 1, (void **) &current) == SUCCESS) { - handler2 = *current; - zval_add_ref(&handler2); + *handler2 = *current; + zval_add_ref(handler2); } else { php_error(E_WARNING, "Wrong format of arguments to xslt_set_sax_handlers()");

« previous php.cvs (#8171) next »