/* Module functions */
PHP_MINIT_FUNCTION(sablot);
PHP_MINFO_FUNCTION(sablot);
-
-/* Request functions */
-PHP_RSHUTDOWN_FUNCTION(sablot);
+PHP_MSHUTDOWN_FUNCTION(sablot);
/* Output transformation functions */
PHP_FUNCTION(xslt_output_begintransform);
/* Sablotron Globals */
typedef struct {
zval *errorHandler;
- SablotHandle processor;
php_sablot_error *errors;
php_sablot_error errors_start;
char *output_transform_file; /* For output transformations */
#include "php_sablot.h"
static int le_sablot;
+static SablotHandle processor;
/* Functions related to PHP's list handling */
static void _php_sablot_free_processor(zend_rsrc_list_entry *rsrc);
/* Sablotron Basic Api macro's */
#define SABLOT_BASIC_CREATE_PROCESSOR() \
- if (SABLOTG(processor) == NULL) { \
+ if (processor == NULL) { \
int ret = 0; \
\
- ret = SablotCreateProcessor(&SABLOTG(processor)); \
+ ret = SablotCreateProcessor(&processor); \
if (ret) { \
SABLOTG(last_errno) = ret; \
return; \
} \
\
- ret = SablotRegHandler(SABLOTG(processor), HLR_MESSAGE, (void *)&mh, (void *)NULL); \
+ ret = SablotRegHandler(processor, HLR_MESSAGE, (void *)&mh, (void *)NULL); \
if (ret) { \
SABLOTG(last_errno) = ret; \
return; \
} \
}
-#define SABLOT_BASIC_HANDLE SABLOTG(processor)
+#define SABLOT_BASIC_HANDLE processor
/**
* SAX Handler structure, this defines the different functions to be
"sablot",
sablot_functions,
PHP_MINIT(sablot),
- NULL,
+ PHP_MSHUTDOWN(sablot),
+ NULL,
NULL,
- PHP_RSHUTDOWN(sablot),
PHP_MINFO(sablot),
STANDARD_MODULE_PROPERTIES
};
PHP_MINIT_FUNCTION(sablot)
{
le_sablot = zend_register_list_destructors_ex(_php_sablot_free_processor, NULL, "Sablotron XSLT", module_number);
+ processor = NULL;
return SUCCESS;
}
-PHP_RSHUTDOWN_FUNCTION(sablot)
+PHP_MSHUTDOWN_FUNCTION(sablot)
{
- SABLOTLS_FETCH();
-
- if (SABLOTG(processor)) {
- SablotUnregHandler(SABLOTG(processor), HLR_MESSAGE, NULL, NULL);
- SablotDestroyProcessor(SABLOTG(processor));
- }
+ if (processor) {
+ SablotUnregHandler(processor, HLR_MESSAGE, NULL, NULL);
+ SablotDestroyProcessor(processor);
+ }
return SUCCESS;
}