com php-src: attempt to port oci: ext/oci8/php_oci8_int .h
| From: | Xinchen Hui | Date: | Tue, 03 Feb 2015 14:17:25 +0000 |
| Subject: | com php-src: attempt to port oci: ext/oci8/php_oci8_int .h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-84602@lists.php.net to get a copy of this message | ||
Commit: 5a5c8551540c6a09bc2a7256b7703b91d7f118c2
Author: Xinchen Hui <laruence@gmail.com> Tue, 3 Feb 2015 22:17:25 +0800
Parents: 64caa97e023bc017f85a7063ec4ea950587740d2
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=5a5c8551540c6a09bc2a7256b7703b91d7f118c2
Log:
attempt to port oci
Changed paths:
M ext/oci8/php_oci8_int.h
Diff:
diff --git a/ext/oci8/php_oci8_int.h b/ext/oci8/php_oci8_int.h
index 7103e5a..c4b1f1b 100644
--- a/ext/oci8/php_oci8_int.h
+++ b/ext/oci8/php_oci8_int.h
@@ -357,24 +357,32 @@ typedef struct {
#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \
do { \
- resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
+ resource->id = zend_register_resource(resource, le_resource); \
} while (0)
#define PHP_OCI_ZVAL_TO_CONNECTION(zval, connection) \
- ZEND_FETCH_RESOURCE2(connection, php_oci_connection *, zval, -1, "oci8 connection",
le_connection, le_pconnection)
+ if ((connection = (php_oci_connection *)zend_fetch_resource2(Z_RES_P(zval), "oci8
connection", le_connection, le_pconnection)) == NULL) { \
+ RETURN_FALSE; \
+ }
#define PHP_OCI_ZVAL_TO_STATEMENT(zval, statement) \
- ZEND_FETCH_RESOURCE(statement, php_oci_statement *, zval, -1, "oci8 statement",
le_statement)
+ if ((statement = (php_oci_statement *)zend_fetch_resource(Z_RES_P(zval), "oci8
statement", le_statement)) == NULL) { \
+ RETURN_FALSE; \
+ }
#define PHP_OCI_ZVAL_TO_DESCRIPTOR(zval, descriptor) \
- ZEND_FETCH_RESOURCE(descriptor, php_oci_descriptor *, zval, -1, "oci8 descriptor",
le_descriptor)
+ if ((descriptor = (php_oci_descriptor *)zend_fetch_resource(Z_RES_P(zval), "oci8
descriptor", le_descriptor)) == NULL) { \
+ RETURN_FALSE; \
+ }
#define PHP_OCI_ZVAL_TO_COLLECTION(zval, collection) \
- ZEND_FETCH_RESOURCE(collection, php_oci_collection *, zval, -1, "oci8 collection",
le_collection)
+ if ((collection = (php_oci_collection *)zend_fetch_resource(Z_RES_P(zval), "oci8
collection", le_collection)) == NULL) { \
+ RETURN_FALSE; \
+ }
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \
do { \
- var = (type) zend_fetch_resource(zval, -1, name, NULL, 1, resource_type); \
+ var = (type) zend_fetch_resource(Z_RES_P(zval), name, resource_type); \
if (!var) { \
return 1; \
} \