/* Note sure if we need to free the object. Have an
oracle TAR out on this one.
- OCIDescriptorFree(descr->ocidescr, Z_TYPE_P(descr)); */
+ OCIDescriptorFree(descr->ocidescr, descr->type); */
oci_debug("END _oci_coll_list_dtor: %d",coll->id);
CALL_OCI(
OCIDescriptorFree(
descr->ocidescr,
- Z_TYPE_P(descr)
+ descr->type
)
);
/* {{{ oci_new_desc()
*/
-static oci_descriptor *oci_new_desc(int type,oci_connection *connection)
+static oci_descriptor *oci_new_desc(int type, oci_connection *connection)
{
oci_descriptor *descr;
TSRMLS_FETCH();
descr = emalloc(sizeof(oci_descriptor));
- Z_TYPE_P(descr) = type;
+ descr->type = type;
- switch (Z_TYPE_P(descr)) {
+ switch (descr->type) {
case OCI_DTYPE_FILE:
case OCI_DTYPE_LOB:
case OCI_DTYPE_ROWID:
break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %d.",Z_TYPE_P(descr));
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %d.", descr->type);
efree(descr);
return 0;
}
OCIDescriptorAlloc(
connection->session->pEnv,
(dvoid*)&(descr->ocidescr),
- Z_TYPE_P(descr),
+ descr->type,
(size_t) 0,
(dvoid **) 0
)
if (mydescr->lob_size >= 0) {
*loblen = mydescr->lob_size;
} else {
- if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+ if (mydescr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileOpen(
connection->pServiceContext,
}
mydescr->lob_size = *loblen;
- if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+ if (mydescr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileClose(
connection->pServiceContext,
/* {{{ oci_loadlob()
*/
#define LOBREADSIZE 1048576l /* 1MB */
-static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer,ub4 *loblen)
+static int oci_loadlob(oci_connection *connection, oci_descriptor *mydescr, char **buffer, ub4 *loblen)
{
ub4 siz = 0;
ub4 readlen = 0;
*loblen = 0;
- if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+ if (mydescr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileOpen(
connection->pServiceContext,
return -1;
}
- if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+ if (mydescr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileClose(
connection->pServiceContext,
return -1;
}
- if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+ if (mydescr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileOpen(
connection->pServiceContext,
return -1;
}
- if (Z_TYPE_P(mydescr) == OCI_DTYPE_FILE) {
+ if (mydescr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileClose(
connection->pServiceContext,
*/
static int _oci_session_cleanup(void *data TSRMLS_DC)
{
- list_entry *le = (list_entry *) data;
- if (Z_TYPE_P(le) == le_session) {
+ zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) data;
+
+ if (le->type == le_session) {
oci_server *server = ((oci_session*) le->ptr)->server;
if (server->is_open == 2)
return 1;
define->name = (text*) estrndup(Z_STRVAL_PP(name),Z_STRLEN_PP(name));
define->name_len = Z_STRLEN_PP(name);
- Z_TYPE_P(define) = ocitype;
+ define->type = ocitype;
define->zval = *var;
zval_add_ref(var);
goto bail;
}
- if (Z_TYPE_P(descr) == OCI_DTYPE_FILE) {
+ if (descr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileOpen(
connection->pServiceContext,
fp = 0;
}
- if (Z_TYPE_P(descr) == OCI_DTYPE_FILE) {
+ if (descr->type == OCI_DTYPE_FILE) {
CALL_OCI_RETURN(connection->error,
OCILobFileClose(
connection->pServiceContext,