typofixes and other improvements by Chris Jones

This commit is contained in:
Antony Dovgal 2007-02-12 09:36:11 +00:00
parent 7d720944b0
commit 5ea43ad90c
3 changed files with 41 additions and 33 deletions

View file

@ -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])

View file

@ -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;
}

View file

@ -231,41 +231,47 @@ typedef struct { /* php_oci_out_column {{{ */
/* {{{ macros */
#define PHP_OCI_CALL(func, params) \
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__); \
}
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) \
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__); \
}
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) \
{ \
switch (errcode) { \
case 1013: \
zend_bailout(); \
do { \
switch (errcode) { \
case 1013: \
zend_bailout(); \
break; \
case 22: \
case 1012: \
case 3113: \
case 604: \
case 1041: \
case 3114: \
connection->is_open = 0; \
case 22: \
case 1012: \
case 3113: \
case 604: \
case 1041: \
case 3114: \
connection->is_open = 0; \
break; \
} \
} \
} \
} while (0)
#define PHP_OCI_REGISTER_RESOURCE(resource, le_resource) \
resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
zend_list_addref(resource->connection->rsrc_id);
do { \
resource->id = ZEND_REGISTER_RESOURCE(NULL, resource, le_resource); \
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) \
var = (type) zend_fetch_resource(&zval TSRMLS_CC, -1, name, NULL, 1, resource_type); \
if (!var) { \
return 1; \
}
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)