Browse Source

Sablot extension cleanup - it compiles again now

migration/unlabaled-1.67.2
Rasmus Lerdorf 25 years ago
parent
commit
05db76df86
  1. 2
      ext/sablot/php_sablot.h
  2. 21
      ext/sablot/sablot.c
  3. 24
      main/php.h

2
ext/sablot/php_sablot.h

@ -108,7 +108,7 @@ typedef struct {
/* Sablotron Globals */
typedef struct {
typedef struct _php_sablot_globals {
zval *errorHandler;
php_sablot_error *errors;
php_sablot_error errors_start;

21
ext/sablot/sablot.c

@ -166,12 +166,7 @@ static SchemeHandler sh = {
_php_sablot_sh_close
};
#ifdef ZTS
int sablot_globals_id;
#else
php_sablot_globals sablot_globals;
#endif
PHP_DECLARE_MODULE_GLOBALS(sablot)
static unsigned char sixth_arg_force_ref[] = { 6, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_NONE, BYREF_FORCE };
static unsigned char third_arg_force_ref[] = { 4, BYREF_NONE, BYREF_NONE, BYREF_FORCE, BYREF_NONE };
@ -214,12 +209,12 @@ zend_module_entry sablot_module_entry = {
ZEND_GET_MODULE(sablot)
#endif
static void php_sablot_init_globals(php_sablot_init_globals *sablot_init_globals_p TSRMLS_DC)
static void php_sablot_init_globals(php_sablot_globals *sablot_globals)
{
SABLOTG(processor) = NULL;
SABLOTG(errors) = NULL;
SABLOTG(errorHandler) = NULL;
SABLOTG(output_transform_file) = NULL;
sablot_globals->processor = NULL;
sablot_globals->errors = NULL;
sablot_globals->errorHandler = NULL;
sablot_globals->output_transform_file = NULL;
}
@ -248,7 +243,9 @@ PHP_MSHUTDOWN_FUNCTION(sablot)
PHP_RSHUTDOWN_FUNCTION(sablot)
{
/*
SABLOT_FREE_ERROR_HANDLE(SABLOTG_HANDLE);
*/
return SUCCESS;
}
@ -1349,7 +1346,9 @@ static MH_ERROR _php_sablot_error(void *userData, SablotHandle p, MH_ERROR code,
TSRMLS_FETCH();
if (userData == NULL) {
/* **FIXME** SABLOTG_HANDLE is not defined anywhere -RL
SABLOT_FREE_ERROR_HANDLE(SABLOTG_HANDLE);
*/
SABLOTG(errors_start).next = NULL;
SABLOTG(errors) = &SABLOTG(errors_start);

24
main/php.h

@ -228,6 +228,30 @@ char *strerror(int);
#define PHP_RSHUTDOWN_FUNCTION(module) int PHP_RSHUTDOWN(module)(SHUTDOWN_FUNC_ARGS)
#define PHP_MINFO_FUNCTION(module) void PHP_MINFO(module)(ZEND_MODULE_INFO_FUNC_ARGS)
#define PHP_BEGIN_MODULE_GLOBALS(module_name) \
typedef struct _php_##module_name##_globals {
#define PHP_END_MODULE_GLOBALS(module_name) \
} php_##module_name##_globals;
#ifdef ZTS
#define PHP_DECLARE_MODULE_GLOBALS(module_name) \
ts_rsrc_id module_name##_globals_id;
#define PHP_EXTERN_MODULE_GLOBALS(module_name) \
extern ts_rsrc_id module_name##_globals_id;
#define PHP_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
ts_allocate_id(&module_name##_globals_id, sizeof(php_##module_name##_globals), (ts_allocate_ctor) globals_ctor, (ts_allocate_dtor) globals_dtor);
#else
#define PHP_DECLARE_MODULE_GLOBALS(module_name) \
php_##module_name##_globals module_name##_globals;
#define PHP_EXTERN_MODULE_GLOBALS(module_name) \
extern php_##module_name##_globals module_name##_globals;
#define PHP_INIT_MODULE_GLOBALS(module_name, globals_ctor, globals_dtor) \
globals_ctor(&module_name##_globals);
#endif
/* global variables */
extern pval *data;

Loading…
Cancel
Save