mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
typofixes and other improvements by Chris Jones
This commit is contained in:
parent
7d720944b0
commit
5ea43ad90c
3 changed files with 41 additions and 33 deletions
|
@ -99,7 +99,7 @@ PHP_ARG_WITH(oci8, for Oracle (OCI8) support,
|
|||
[ --with-oci8[=DIR] Include Oracle (OCI8) support.
|
||||
The default DIR is ORACLE_HOME.
|
||||
Use --with-oci8=instantclient,/path/to/oic/lib
|
||||
to use Oracle Instant Client installation])
|
||||
to use an Oracle Instant Client installation])
|
||||
|
||||
AC_MSG_CHECKING([checking PHP version])
|
||||
|
||||
|
|
|
@ -1088,7 +1088,7 @@ php_oci_connection *php_oci_do_connect_ex(zstr username, int username_len, zstr
|
|||
size_t rsize = 0;
|
||||
sword result;
|
||||
|
||||
PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize))
|
||||
PHP_OCI_CALL_RETURN(result, OCINlsEnvironmentVariableGet, (&charsetid_nls_lang, 0, OCI_NLS_CHARSET_ID, 0, &rsize));
|
||||
if (result != OCI_SUCCESS) {
|
||||
charsetid_nls_lang = 0;
|
||||
}
|
||||
|
|
|
@ -231,23 +231,27 @@ typedef struct { /* php_oci_out_column {{{ */
|
|||
/* {{{ macros */
|
||||
|
||||
#define PHP_OCI_CALL(func, params) \
|
||||
do { \
|
||||
OCI_G(in_call) = 1; \
|
||||
func params; \
|
||||
OCI_G(in_call) = 0; \
|
||||
if (OCI_G(debug_mode)) { \
|
||||
php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
|
||||
}
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PHP_OCI_CALL_RETURN(__retval, func, params) \
|
||||
do { \
|
||||
OCI_G(in_call) = 1; \
|
||||
__retval = func params; \
|
||||
OCI_G(in_call) = 0; \
|
||||
if (OCI_G(debug_mode)) { \
|
||||
php_printf ("OCI8 DEBUG: " #func " at (%s:%d) \n", __FILE__, __LINE__); \
|
||||
}
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PHP_OCI_HANDLE_ERROR(connection, errcode) \
|
||||
{ \
|
||||
do { \
|
||||
switch (errcode) { \
|
||||
case 1013: \
|
||||
zend_bailout(); \
|
||||
|
@ -261,11 +265,13 @@ typedef struct { /* php_oci_out_column {{{ */
|
|||
connection->is_open = 0; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \
|
||||
do { \
|
||||
resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
|
||||
zend_list_addref(resource->connection->rsrc_id);
|
||||
zend_list_addref(resource->connection->rsrc_id); \
|
||||
} 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);
|
||||
|
@ -280,10 +286,12 @@ typedef struct { /* php_oci_out_column {{{ */
|
|||
ZEND_FETCH_RESOURCE(collection, php_oci_collection *, &zval, -1, "oci8 collection", le_collection)
|
||||
|
||||
#define PHP_OCI_FETCH_RESOURCE_EX(zval, var, type, name, resource_type) \
|
||||
do { \
|
||||
var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
|
||||
if (!var) { \
|
||||
return 1; \
|
||||
}
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PHP_OCI_ZVAL_TO_CONNECTION_EX(zval, connection) \
|
||||
PHP_OCI_FETCH_RESOURCE_EX(zval, connection, php_oci_connection *, "oci8 connection", le_connection)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue