summaryrefslogtreecommitdiff
path: root/ext/interbase/php_ibase_includes.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/interbase/php_ibase_includes.h')
-rw-r--r--ext/interbase/php_ibase_includes.h41
1 files changed, 18 insertions, 23 deletions
diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h
index 03fa6e3cf0..e2000c1c5f 100644
--- a/ext/interbase/php_ibase_includes.h
+++ b/ext/interbase/php_ibase_includes.h
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 7 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2015 The PHP Group |
+ | Copyright (c) 1997-2016 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -60,10 +60,10 @@ extern int le_link, le_plink, le_trans;
ZEND_BEGIN_MODULE_GLOBALS(ibase)
ISC_STATUS status[20];
- long default_link;
- long num_links, num_persistent;
+ zend_resource *default_link;
+ zend_long num_links, num_persistent;
char errmsg[MAX_ERRMSG];
- long sql_code;
+ zend_long sql_code;
ZEND_END_MODULE_GLOBALS(ibase)
ZEND_EXTERN_MODULE_GLOBALS(ibase)
@@ -95,7 +95,7 @@ typedef struct {
typedef struct event {
ibase_db_link *link;
- long link_res_id;
+ zend_resource* link_res;
ISC_LONG event_id;
unsigned short event_count;
char **events;
@@ -127,17 +127,10 @@ enum php_interbase_option {
PHP_IBASE_NOWAIT = 256
};
-#ifdef ZTS
-#else
-#endif
+#define IBG(v) ZEND_MODULE_GLOBALS_ACCESSOR(ibase, v)
-#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)
+#if defined(ZTS) && defined(COMPILE_DL_INTERBASE)
+ZEND_TSRMLS_CACHE_EXTERN()
#endif
#define BLOB_ID_LEN 18
@@ -162,13 +155,15 @@ void _php_ibase_module_error(char *, ...)
/* determine if a resource is a link or transaction handle */
#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, zv, &lh, &th); \
- if (SUCCESS != _php_ibase_def_trans(lh, &th)) { RETURN_FALSE; } \
- } while (0)
+ 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, 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);
void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, zval *link_id,
@@ -181,7 +176,7 @@ 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);
zend_string *_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);
+int _php_ibase_blob_get(zval *return_value, ibase_blob *ib_blob, zend_ulong max_len);
int _php_ibase_blob_add(zval *string_arg, ibase_blob *ib_blob);
/* provided by ibase_events.c */