cvs: php4 /ext/sablot php_sablot.h sablot.c
| From: | Sterling Hughes | Date: | Sun, 03 Sep 2000 19:58:12 +0000 |
| Subject: | cvs: php4 /ext/sablot php_sablot.h sablot.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-1532@lists.php.net to get a copy of this message | ||
sterling Sun Sep 3 12:58:12 2000 EDT
Modified files:
/php4/ext/sablot php_sablot.h sablot.c
Log:
If the user wants to use more than one handle reuse the old handle.
Index: php4/ext/sablot/php_sablot.h
diff -u php4/ext/sablot/php_sablot.h:1.1 php4/ext/sablot/php_sablot.h:1.2
--- php4/ext/sablot/php_sablot.h:1.1 Sun Sep 3 06:00:08 2000
+++ php4/ext/sablot/php_sablot.h Sun Sep 3 12:58:12 2000
@@ -80,6 +80,7 @@
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.2 php4/ext/sablot/sablot.c:1.3
--- php4/ext/sablot/sablot.c:1.2 Sun Sep 3 07:03:51 2000
+++ php4/ext/sablot/sablot.c Sun Sep 3 12:58:12 2000
@@ -370,6 +370,12 @@
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);
if (ret) {
@@ -403,6 +409,7 @@
ZEND_REGISTER_RESOURCE(return_value, handle, SABLOTG(le_sablot));
handle->index = Z_LVAL_P(return_value);
+ SABLOTG(current_processor) = Z_LVAL_P(return_value);
}
/* }}} */
@@ -1079,6 +1086,8 @@
SablotUnregHandler(handle->p, HLR_SAX, NULL, NULL);
SablotDestroyProcessor(handle->p);
}
+ SABLOTG(current_processor) = 0;
+
FUNCH_FREE(handle->startDocHandler);
FUNCH_FREE(handle->startElementHandler);
FUNCH_FREE(handle->endElementHandler);