diff options
Diffstat (limited to 'ext/interbase/php_ibase_includes.h')
-rw-r--r-- | ext/interbase/php_ibase_includes.h | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h index 03d3080d1c..99f3366f50 100644 --- a/ext/interbase/php_ibase_includes.h +++ b/ext/interbase/php_ibase_includes.h @@ -1,6 +1,6 @@ /* +----------------------------------------------------------------------+ - | PHP Version 5 | + | PHP Version 7 | +----------------------------------------------------------------------+ | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ @@ -35,8 +35,7 @@ #define IB_STATUS (IBG(status)) -/* XXX ZEND_DEBUG_ is misleading, it should be something like IBASE_DEBUG. */ -#ifdef ZEND_DEBUG_ +#ifdef IBASE_DEBUG #define IBDEBUG(a) php_printf("::: %s (%d)\n", a, __LINE__); #endif @@ -101,8 +100,8 @@ typedef struct event { unsigned short event_count; char **events; char *event_buffer, *result_buffer; - zval *callback; - void **thread_ctx; + zval callback; + void *thread_ctx; struct event *event_next; enum event_state { NEW, ACTIVE, DEAD } state; } ibase_event; @@ -129,7 +128,14 @@ enum php_interbase_option { }; #ifdef ZTS -#define IBG(v) TSRMG(ibase_globals_id, zend_ibase_globals *, v) +#else +#endif + +#ifdef ZTS +# define IBG(v) ZEND_TSRMG(ibase_globals_id, zend_ibase_globals *, v) +# ifdef COMPILE_DL_INTERBASE +ZEND_TSRMLS_CACHE_EXTERN; +# endif #else #define IBG(v) (ibase_globals.v) #endif @@ -150,22 +156,22 @@ typedef void (__stdcall *info_func_t)(char*); typedef void (*info_func_t)(char*); #endif -void _php_ibase_error(TSRMLS_D); -void _php_ibase_module_error(char * TSRMLS_DC, ...) +void _php_ibase_error(void); +void _php_ibase_module_error(char *, ...) PHP_ATTRIBUTE_FORMAT(printf,1,PHP_ATTR_FMT_OFFSET +2); /* determine if a resource is a link or transaction handle */ -#define PHP_IBASE_LINK_TRANS(pzval, lh, th) \ - do { if (!pzval) { \ - ZEND_FETCH_RESOURCE2(lh, ibase_db_link *, NULL, IBG(default_link), \ - "InterBase link", le_link, le_plink) } \ +#define PHP_IBASE_LINK_TRANS(zv, lh, th) \ + do { if (!zv) { \ + lh = (ibase_db_link *)zend_fetch_resource2(IBG(default_link), \ + "InterBase link", le_link, le_plink); } \ else \ - _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, &pzval, &lh, &th); \ - if (SUCCESS != _php_ibase_def_trans(lh, &th TSRMLS_CC)) { RETURN_FALSE; } \ + _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, zv, &lh, &th); \ + if (SUCCESS != _php_ibase_def_trans(lh, &th)) { RETURN_FALSE; } \ } while (0) -int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans TSRMLS_DC); -void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval **link_id, +int _php_ibase_def_trans(ibase_db_link *ib_link, ibase_trans **trans); +void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval *link_id, ibase_db_link **ib_link, ibase_trans **trans); /* provided by ibase_query.c */ @@ -175,12 +181,12 @@ void php_ibase_query_minit(INIT_FUNC_ARGS); void php_ibase_blobs_minit(INIT_FUNC_ARGS); int _php_ibase_string_to_quad(char const *id, ISC_QUAD *qd); char *_php_ibase_quad_to_string(ISC_QUAD const qd); -int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len TSRMLS_DC); -int _php_ibase_blob_add(zval **string_arg, ibase_blob *ib_blob TSRMLS_DC); +int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, unsigned long max_len); +int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob); /* provided by ibase_events.c */ void php_ibase_events_minit(INIT_FUNC_ARGS); -void _php_ibase_free_event(ibase_event *event TSRMLS_DC); +void _php_ibase_free_event(ibase_event *event); /* provided by ibase_service.c */ void php_ibase_service_minit(INIT_FUNC_ARGS); |