define = ecalloc(1,sizeof(php_oci_define));
- if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) {
+ //if (zend_hash_add(statement->defines, name, name_len, define, sizeof(php_oci_define), (void **)&tmp_define) == SUCCESS) {
+ if ((tmp_define = zend_hash_add_new_ptr(statement->defines, zend_string_init(name, name_len, 0), define)) != NULL) {
efree(define);
define = tmp_define;
} else {
define->name_len = name_len;
define->type = type;
memmove(&define->zval, var, sizeof(zval));
- zval_add_ref(&var);
+ Z_ADDREF_P(var);
RETURN_TRUE;
}
Deletes large object description */
PHP_FUNCTION(oci_free_descriptor)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
zend_list_delete(descriptor->id);
RETURN_TRUE;
Saves a large object */
PHP_FUNCTION(oci_lob_save)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *data;
size_t data_len;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (offset < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset parameter must be greater than or equal to 0");
Loads file into a LOB */
PHP_FUNCTION(oci_lob_import)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *filename;
size_t filename_len;
}
#endif
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_import(descriptor, filename TSRMLS_CC)) {
RETURN_FALSE;
Loads a large object */
PHP_FUNCTION(oci_lob_load)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *buffer = NULL;
ub4 buffer_len;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_read(descriptor, -1, 0, &buffer, &buffer_len TSRMLS_CC)) {
RETURN_FALSE;
}
if (buffer_len > 0) {
- RETURN_STRINGL(buffer, buffer_len, 0);
+ RETURN_STRINGL(buffer, buffer_len);
}
else {
RETURN_EMPTY_STRING();
Reads particular part of a large object */
PHP_FUNCTION(oci_lob_read)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
zend_long length;
char *buffer;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (length <= 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
RETURN_FALSE;
}
if (buffer_len > 0) {
- RETURN_STRINGL(buffer, buffer_len, 0);
+ RETURN_STRINGL(buffer, buffer_len);
}
else {
RETURN_EMPTY_STRING();
Checks if EOF is reached */
PHP_FUNCTION(oci_lob_eof)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
ub4 lob_length;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (!php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC) && lob_length >= 0) {
if (lob_length == descriptor->lob_current_position) {
Tells LOB pointer position */
PHP_FUNCTION(oci_lob_tell)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
RETURN_LONG(descriptor->lob_current_position);
}
Rewind pointer of a LOB */
PHP_FUNCTION(oci_lob_rewind)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
descriptor->lob_current_position = 0;
Moves the pointer of a LOB */
PHP_FUNCTION(oci_lob_seek)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
zend_long offset, whence = PHP_OCI_SEEK_SET;
ub4 lob_length;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
RETURN_FALSE;
Returns size of a large object */
PHP_FUNCTION(oci_lob_size)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
ub4 lob_length;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
RETURN_FALSE;
Writes data to current position of a LOB */
PHP_FUNCTION(oci_lob_write)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
size_t data_len;
zend_long write_len = 0;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (data_len <= 0) {
RETURN_LONG(0);
Appends data from a LOB to another LOB */
PHP_FUNCTION(oci_lob_append)
{
- zval **tmp_dest, **tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from;
+ zval *tmp_dest, *tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from;
php_oci_descriptor *descriptor_dest, *descriptor_from;
if (getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) {
+ if ((tmp_dest = zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) {
+ if ((tmp_from = zend_hash_find(Z_OBJPROP_P(z_descriptor_from), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest);
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
if (php_oci_lob_append(descriptor_dest, descriptor_from TSRMLS_CC)) {
RETURN_FALSE;
Truncates a LOB */
PHP_FUNCTION(oci_lob_truncate)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
zend_long trim_length = 0;
ub4 ub_trim_length;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
}
ub_trim_length = (ub4) trim_length;
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_truncate(descriptor, ub_trim_length TSRMLS_CC)) {
RETURN_FALSE;
Erases a specified portion of the internal LOB, starting at a specified offset */
PHP_FUNCTION(oci_lob_erase)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
ub4 bytes_erased;
zend_long offset = -1, length = -1;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_erase(descriptor, offset, length, &bytes_erased TSRMLS_CC)) {
RETURN_FALSE;
Flushes the LOB buffer */
PHP_FUNCTION(oci_lob_flush)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
zend_long flush_flag = 0;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (descriptor->buffering == PHP_OCI_LOB_BUFFER_DISABLED) {
/* buffering wasn't enabled, there is nothing to flush */
Enables/disables buffering for a LOB */
PHP_FUNCTION(ocisetbufferinglob)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
zend_bool flag;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_set_buffering(descriptor, flag TSRMLS_CC)) {
RETURN_FALSE;
Returns current state of buffering for a LOB */
PHP_FUNCTION(ocigetbufferinglob)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (descriptor->buffering != PHP_OCI_LOB_BUFFER_DISABLED) {
RETURN_TRUE;
Copies data from a LOB to another LOB */
PHP_FUNCTION(oci_lob_copy)
{
- zval **tmp_dest, **tmp_from, *z_descriptor_dest, *z_descriptor_from;
+ zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from;
php_oci_descriptor *descriptor_dest, *descriptor_from;
zend_long length = 0;
return;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor"), (void **)&tmp_dest) == FAILURE) {
+ if ((tmp_dest = zend_hash_find(Z_OBJPROP_P(z_descriptor_dest), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_from), "descriptor", sizeof("descriptor"), (void **)&tmp_from) == FAILURE) {
+ if ((tmp_from = zend_hash_find(Z_OBJPROP_P(z_descriptor_from), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_dest, descriptor_dest);
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_from, descriptor_from);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_dest, descriptor_dest);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_from, descriptor_from);
if (ZEND_NUM_ARGS() == 3 && length < 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Length parameter must be greater than 0");
Tests to see if two LOB/FILE locators are equal */
PHP_FUNCTION(oci_lob_is_equal)
{
- zval **tmp_first, **tmp_second, *z_descriptor_first, *z_descriptor_second;
+ zval *tmp_first, *tmp_second, *z_descriptor_first, *z_descriptor_second;
php_oci_descriptor *descriptor_first, *descriptor_second;
boolean is_equal;
return;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_first), "descriptor", sizeof("descriptor"), (void **)&tmp_first) == FAILURE) {
+ if ((tmp_first = zend_hash_find(Z_OBJPROP_P(z_descriptor_first), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The first argument should be valid descriptor object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor_second), "descriptor", sizeof("descriptor"), (void **)&tmp_second) == FAILURE) {
+ if ((tmp_second = zend_hash_find(Z_OBJPROP_P(z_descriptor_second), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property. The second argument should be valid descriptor object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_first, descriptor_first);
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp_second, descriptor_second);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_first, descriptor_first);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp_second, descriptor_second);
if (php_oci_lob_is_equal(descriptor_first, descriptor_second, &is_equal TSRMLS_CC)) {
RETURN_FALSE;
Writes a large object into a file */
PHP_FUNCTION(oci_lob_export)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *filename;
char *buffer;
}
#endif
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_get_length(descriptor, &lob_length TSRMLS_CC)) {
RETURN_FALSE;
Writes temporary blob */
PHP_FUNCTION(oci_lob_write_temporary)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
char *data;
size_t data_len;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_write_tmp(descriptor, type, data, data_len TSRMLS_CC)) {
RETURN_FALSE;
Closes lob descriptor */
PHP_FUNCTION(oci_lob_close)
{
- zval **tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor = getThis();
php_oci_descriptor *descriptor;
if (!getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_descriptor), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR(*tmp, descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR(tmp, descriptor);
if (php_oci_lob_close(descriptor TSRMLS_CC)) {
RETURN_FALSE;
php_oci_out_column *column;
if ( ( column = php_oci_statement_get_column_helper(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0) ) ) {
- RETURN_STRINGL(column->name, column->name_len, 1);
+ RETURN_STRINGL(column->name, column->name_len);
}
RETURN_FALSE;
}
switch (column->data_type) {
#ifdef SQLT_TIMESTAMP
case SQLT_TIMESTAMP:
- RETVAL_STRING("TIMESTAMP",1);
+ RETVAL_STRING("TIMESTAMP");
break;
#endif
#ifdef SQLT_TIMESTAMP_TZ
case SQLT_TIMESTAMP_TZ:
- RETVAL_STRING("TIMESTAMP WITH TIMEZONE",1);
+ RETVAL_STRING("TIMESTAMP WITH TIMEZONE");
break;
#endif
#ifdef SQLT_TIMESTAMP_LTZ
case SQLT_TIMESTAMP_LTZ:
- RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE",1);
+ RETVAL_STRING("TIMESTAMP WITH LOCAL TIMEZONE");
break;
#endif
#ifdef SQLT_INTERVAL_YM
case SQLT_INTERVAL_YM:
- RETVAL_STRING("INTERVAL YEAR TO MONTH",1);
+ RETVAL_STRING("INTERVAL YEAR TO MONTH");
break;
#endif
#ifdef SQLT_INTERVAL_DS
case SQLT_INTERVAL_DS:
- RETVAL_STRING("INTERVAL DAY TO SECOND",1);
+ RETVAL_STRING("INTERVAL DAY TO SECOND");
break;
#endif
case SQLT_DAT:
- RETVAL_STRING("DATE",1);
+ RETVAL_STRING("DATE");
break;
case SQLT_NUM:
- RETVAL_STRING("NUMBER",1);
+ RETVAL_STRING("NUMBER");
break;
case SQLT_LNG:
- RETVAL_STRING("LONG",1);
+ RETVAL_STRING("LONG");
break;
case SQLT_BIN:
- RETVAL_STRING("RAW",1);
+ RETVAL_STRING("RAW");
break;
case SQLT_LBI:
- RETVAL_STRING("LONG RAW",1);
+ RETVAL_STRING("LONG RAW");
break;
case SQLT_CHR:
- RETVAL_STRING("VARCHAR2",1);
+ RETVAL_STRING("VARCHAR2");
break;
case SQLT_RSET:
- RETVAL_STRING("REFCURSOR",1);
+ RETVAL_STRING("REFCURSOR");
break;
case SQLT_AFC:
- RETVAL_STRING("CHAR",1);
+ RETVAL_STRING("CHAR");
break;
case SQLT_BLOB:
- RETVAL_STRING("BLOB",1);
+ RETVAL_STRING("BLOB");
break;
case SQLT_CLOB:
- RETVAL_STRING("CLOB",1);
+ RETVAL_STRING("CLOB");
break;
case SQLT_BFILE:
- RETVAL_STRING("BFILE",1);
+ RETVAL_STRING("BFILE");
break;
case SQLT_RDD:
- RETVAL_STRING("ROWID",1);
+ RETVAL_STRING("ROWID");
break;
default:
RETVAL_LONG(column->data_type);
zval element, tmp;
php_oci_statement *statement;
php_oci_out_column **columns;
- zval ***outarrs;
+ zval **outarrs;
ub4 nrows = 1;
int i;
zend_long rows = 0, flags = 0, skip = 0, maxrows = -1;
php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
if (flags & PHP_OCI_NUM) {
- zend_hash_next_index_insert(Z_ARRVAL(row), &element, sizeof(zval*), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL(row), &element);
} else { /* default to ASSOC */
- zend_symtable_update(Z_ARRVAL(row), columns[ i ]->name, columns[ i ]->name_len+1, &element, sizeof(zval*), NULL);
+ zend_symtable_update(Z_ARRVAL(row), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &element);
}
}
- zend_hash_next_index_insert(Z_ARRVAL_P(array), &row, sizeof(zval*), NULL);
+ zend_hash_next_index_insert(Z_ARRVAL_P(array), &row);
rows++;
if (maxrows != -1 && rows == maxrows) {
columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
array_init(&tmp);
- zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
+ outarrs[ i ] = zend_hash_next_index_insert(Z_ARRVAL_P(array), &tmp);
}
} else { /* default to ASSOC */
for (i = 0; i < statement->ncolumns; i++) {
columns[ i ] = php_oci_statement_get_column(statement, i + 1, NULL, 0 TSRMLS_CC);
array_init(&tmp);
- zend_symtable_update(Z_ARRVAL_P(array), columns[ i ]->name, columns[ i ]->name_len+1, (void *) &tmp, sizeof(zval*), (void **) &(outarrs[ i ]));
+ outarrs[ i ] = zend_symtable_update(Z_ARRVAL_P(array), zend_string_init(columns[ i ]->name, columns[ i ]->name_len+1, 0), &tmp);
}
}
while (!php_oci_statement_fetch(statement, nrows TSRMLS_CC)) {
for (i = 0; i < statement->ncolumns; i++) {
php_oci_column_to_zval(columns[ i ], &element, PHP_OCI_RETURN_LOBS TSRMLS_CC);
- zend_hash_index_update(&(*(outarrs[ i ]))->value.arr->ht, &rows, (void *)&element, sizeof(zval*), NULL);
+ zend_hash_index_update(&(outarrs[ i ])->value.arr->ht, rows, &element);
}
rows++;
}
if (ZEND_NUM_ARGS() > 0) {
- statement = (php_oci_statement *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_statement);
if (statement) {
errh = statement->err;
errcode = statement->errcode;
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_connection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
goto go_out;
}
- connection = (php_oci_connection *) zend_fetch_resource(&arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
+ connection = (php_oci_connection *) zend_fetch_resource(arg TSRMLS_CC, -1, NULL, NULL, 1, le_pconnection);
if (connection) {
errh = connection->err;
errcode = connection->errcode;
char *version = NULL;
php_oci_client_get_version(&version TSRMLS_CC);
- RETURN_STRING(version, 0);
+ RETURN_STRING(version);
}
/* }}} */
RETURN_FALSE;
}
- RETURN_STRING(version, 0);
+ RETURN_STRING(version);
}
/* }}} */
switch (type) {
case OCI_STMT_SELECT:
- RETVAL_STRING("SELECT",1);
+ RETVAL_STRING("SELECT");
break;
case OCI_STMT_UPDATE:
- RETVAL_STRING("UPDATE",1);
+ RETVAL_STRING("UPDATE");
break;
case OCI_STMT_DELETE:
- RETVAL_STRING("DELETE",1);
+ RETVAL_STRING("DELETE");
break;
case OCI_STMT_INSERT:
- RETVAL_STRING("INSERT",1);
+ RETVAL_STRING("INSERT");
break;
case OCI_STMT_CREATE:
- RETVAL_STRING("CREATE",1);
+ RETVAL_STRING("CREATE");
break;
case OCI_STMT_DROP:
- RETVAL_STRING("DROP",1);
+ RETVAL_STRING("DROP");
break;
case OCI_STMT_ALTER:
- RETVAL_STRING("ALTER",1);
+ RETVAL_STRING("ALTER");
break;
case OCI_STMT_BEGIN:
- RETVAL_STRING("BEGIN",1);
+ RETVAL_STRING("BEGIN");
break;
case OCI_STMT_DECLARE:
- RETVAL_STRING("DECLARE",1);
+ RETVAL_STRING("DECLARE");
break;
case OCI_STMT_CALL:
- RETVAL_STRING("CALL",1);
+ RETVAL_STRING("CALL");
break;
default:
- RETVAL_STRING("UNKNOWN",1);
+ RETVAL_STRING("UNKNOWN");
}
}
/* }}} */
Deletes collection object*/
PHP_FUNCTION(oci_free_collection)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
if (!getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
zend_list_delete(collection->id);
RETURN_TRUE;
Append an object to the collection */
PHP_FUNCTION(oci_collection_append)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
char *value;
size_t value_len;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_append(collection, value, value_len TSRMLS_CC)) {
RETURN_FALSE;
Retrieve the value at collection index ndx */
PHP_FUNCTION(oci_collection_element_get)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
zend_long element_index;
zval value;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_element_get(collection, element_index, &value TSRMLS_CC)) {
RETURN_FALSE;
Assign a collection from another existing collection */
PHP_FUNCTION(oci_collection_assign)
{
- zval **tmp_dest, **tmp_from, *z_collection_dest = getThis(), *z_collection_from;
+ zval *tmp_dest, *tmp_from, *z_collection_dest = getThis(), *z_collection_from;
php_oci_collection *collection_dest, *collection_from;
if (getThis()) {
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection"), (void **)&tmp_dest) == FAILURE) {
+ if ((tmp_dest = zend_hash_find(Z_OBJPROP_P(z_collection_dest), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The first argument should be valid collection object");
RETURN_FALSE;
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection_from), "collection", sizeof("collection"), (void **)&tmp_from) == FAILURE) {
+ if ((tmp_from = zend_hash_find(Z_OBJPROP_P(z_collection_from), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property. The second argument should be valid collection object");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp_dest, collection_dest);
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp_from, collection_from);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp_dest, collection_dest);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp_from, collection_from);
if (php_oci_collection_assign(collection_dest, collection_from TSRMLS_CC)) {
RETURN_FALSE;
Assign element val to collection at index ndx */
PHP_FUNCTION(oci_collection_element_assign)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
size_t value_len;
zend_long element_index;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_element_set(collection, element_index, value, value_len TSRMLS_CC)) {
RETURN_FALSE;
Return the size of a collection */
PHP_FUNCTION(oci_collection_size)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
sb4 size = 0;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_size(collection, &size TSRMLS_CC)) {
RETURN_FALSE;
Return the max value of a collection. For a varray this is the maximum length of the array */
PHP_FUNCTION(oci_collection_max)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
zend_long max;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_max(collection, &max TSRMLS_CC)) {
RETURN_FALSE;
Trim num elements from the end of a collection */
PHP_FUNCTION(oci_collection_trim)
{
- zval **tmp, *z_collection = getThis();
+ zval *tmp, *z_collection = getThis();
php_oci_collection *collection;
zend_long trim_size;
}
}
- if (zend_hash_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(z_collection), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
RETURN_FALSE;
}
- PHP_OCI_ZVAL_TO_COLLECTION(*tmp, collection);
+ PHP_OCI_ZVAL_TO_COLLECTION(tmp, collection);
if (php_oci_collection_trim(collection, trim_size TSRMLS_CC)) {
RETURN_FALSE;
statement->impres_child_stmt = NULL;
statement->impres_count = 0;
statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */
- Z_ADDREF_P(statement->connection->id);
+ ++GC_REFCOUNT(statement->connection->id);
if (OCI_G(default_prefetch) >= 0) {
php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch) TSRMLS_CC);
}
}
} else if (column_index != -1) {
- if (zend_hash_index_find(statement->columns, column_index, (void **)&column) == FAILURE) {
+ if ((column = zend_hash_index_find_ptr(statement->columns, column_index)) == NULL) {
return NULL;
}
return column;
return OCI_ERROR;
}
nested_stmt->parent_stmtid = outcol->statement->id;
- Z_ADDREF_P(outcol->statement->id);
+ ++GC_REFCOUNT(outcol->statement->id);
outcol->nested_statement = nested_stmt;
outcol->stmtid = nested_stmt->id;
for (counter = 1; counter <= colcount; counter++) {
memset(&column,0,sizeof(php_oci_out_column));
- if (zend_hash_index_update(statement->columns, counter, &column, sizeof(php_oci_out_column), (void**) &outcol) == FAILURE) {
+ if ((outcol = zend_hash_index_update_ptr(statement->columns, counter, &column)) == NULL) {
efree(statement->columns);
/* out of memory */
return 1;
/* find a user-set define */
if (statement->defines) {
- if (zend_hash_find(statement->defines,outcol->name,outcol->name_len,(void **) &outcol->define) == SUCCESS) {
+ if ((outcol->define = zend_hash_find_ptr(statement->defines, zend_string_init(outcol->name, outcol->name_len, 0))) != NULL) {
if (outcol->define->type) {
outcol->data_type = outcol->define->type;
}
Z_STRVAL(bind->zval)[ Z_STRLEN(bind->zval) ] = '\0';
} else if (Z_TYPE(bind->zval) == IS_ARRAY) {
int i;
- zval **entry;
+ zval *entry = NULL;
HashTable *hash = HASH_OF(&bind->zval);
zend_hash_internal_pointer_reset(hash);
case SQLT_INT:
case SQLT_LNG:
for (i = 0; i < bind->array.current_length; i++) {
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- zval_dtor(*entry);
- ZVAL_LONG(*entry, ((ub4 *)(bind->array.elements))[i]);
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
+ zval_dtor(entry);
+ ZVAL_LONG(entry, ((ub4 *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_long(&bind->zval, ((ub4 *)(bind->array.elements))[i]);
break;
case SQLT_FLT:
for (i = 0; i < bind->array.current_length; i++) {
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- zval_dtor(*entry);
- ZVAL_DOUBLE(*entry, ((double *)(bind->array.elements))[i]);
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
+ zval_dtor(entry);
+ ZVAL_DOUBLE(entry, ((double *)(bind->array.elements))[i]);
zend_hash_move_forward(hash);
} else {
add_next_index_double(&bind->zval, ((double *)(bind->array.elements))[i]);
memset((void*)buff,0,sizeof(buff));
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
PHP_OCI_CALL_RETURN(errstatus, OCIDateToText, (connection->err, &(((OCIDate *)(bind->array.elements))[i]), 0, 0, 0, 0, &buff_len, buff));
- zval_dtor(*entry);
+ zval_dtor(entry);
if (errstatus != OCI_SUCCESS) {
connection->errcode = php_oci_error(connection->err, errstatus TSRMLS_CC);
PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
- ZVAL_NULL(*entry);
+ ZVAL_NULL(entry);
} else {
connection->errcode = 0; /* retain backwards compat with OCI8 1.4 */
- ZVAL_STRINGL(*entry, (char *)buff, buff_len, 1);
+ ZVAL_STRINGL(entry, (char *)buff, buff_len);
}
zend_hash_move_forward(hash);
} else {
for (i = 0; i < bind->array.current_length; i++) {
/* int curr_element_length = strlen(((text *)bind->array.elements)+i*bind->array.max_length); */
int curr_element_length = bind->array.element_lengths[i];
- if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
- zval_dtor(*entry);
- ZVAL_STRINGL(*entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
+ if ((i < bind->array.old_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
+ zval_dtor(entry);
+ ZVAL_STRINGL(entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
zend_hash_move_forward(hash);
} else {
add_next_index_stringl(&bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_element_length);
switch (type) {
case SQLT_NTY:
{
- zval **tmp;
+ zval *tmp;
- if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "collection", sizeof("collection"), (void **)&tmp) == FAILURE) {
+ if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_find(Z_OBJPROP_P(var), zend_string_init("collection", sizeof("collection"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find collection property");
return 1;
}
- PHP_OCI_ZVAL_TO_COLLECTION_EX(*tmp, bind_collection);
+ PHP_OCI_ZVAL_TO_COLLECTION_EX(tmp, bind_collection);
value_sz = sizeof(void*);
mode = OCI_DEFAULT;
case SQLT_BLOB:
case SQLT_RDD:
{
- zval **tmp;
+ zval *tmp;
- if (Z_TYPE_P(var) != IS_OBJECT || zend_hash_find(Z_OBJPROP_P(var), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if (Z_TYPE_P(var) != IS_OBJECT || (tmp = zend_hash_find(Z_OBJPROP_P(var), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find descriptor property");
return 1;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, bind_descriptor);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, bind_descriptor);
value_sz = sizeof(void*);
}
memset((void*)&bind,0,sizeof(php_oci_bind));
- if (zend_hash_find(statement->binds, name, name_len + 1, (void **)&old_bind) == SUCCESS) {
+ if ((old_bind = zend_hash_find_ptr(statement->binds, zend_string_init(name, name_len + 1, 0))) != NULL) {
bindp = old_bind;
zval_ptr_dtor(&bindp->zval);
} else {
- zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bindp);
+ bindp = zend_hash_update_ptr(statement->binds, zend_string_init(name, name_len + 1, 0), &bind);
}
bindp->descriptor = oci_desc;
bindp->parent_statement = statement;
ZVAL_COPY(&bindp->zval, var);
bindp->type = type;
- zval_add_ref(&var);
+ Z_ADDREF_P(var);
PHP_OCI_CALL_RETURN(errstatus,
OCIBindByName,
}
retval = OCI_CONTINUE;
} else if (Z_TYPE_P(val) == IS_OBJECT) {
- zval **tmp;
+ zval *tmp;
php_oci_descriptor *desc;
if (!phpbind->descriptor) {
* out-bind as the contents would have been changed for in/out
* binds (Bug #46994).
*/
- if (zend_hash_find(Z_OBJPROP_P(val), "descriptor", sizeof("descriptor"), (void **)&tmp) == FAILURE) {
+ if ((tmp = zend_hash_find(Z_OBJPROP_P(val), zend_string_init("descriptor", sizeof("descriptor"), 0))) == NULL) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to find object outbind descriptor property");
return OCI_ERROR;
}
- PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(*tmp, desc);
+ PHP_OCI_ZVAL_TO_DESCRIPTOR_EX(tmp, desc);
desc->lob_size = -1; /* force OCI8 to update cached size */
*alenpp = &phpbind->dummy_len;
return NULL;
}
- statement = (php_oci_statement *) zend_fetch_resource(&z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement);
+ statement = (php_oci_statement *) zend_fetch_resource(z_statement TSRMLS_CC, -1, "oci8 statement", NULL, 1, le_statement);
if (!statement) {
return NULL;
zend_hash_init(statement->binds, 13, NULL, php_oci_bind_hash_dtor, 0);
}
- zend_hash_update(statement->binds, name, name_len + 1, bind, sizeof(php_oci_bind), (void **)&bindp);
+ bindp = zend_hash_update_ptr(statement->binds, zend_string_init(name, name_len + 1, 0), bind);
bindp->descriptor = NULL;
bindp->statement = NULL;
bindp->indicator = 0; /* not used for array binds */
bindp->type = 0; /* not used for array binds */
- zval_add_ref(&var);
+ Z_ADDREF_P(var);
PHP_OCI_CALL_RETURN(errstatus,
OCIBindByName,
if (maxlength == -1) {
zend_hash_internal_pointer_reset(hash);
- while (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
+ while ((entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_string_ex(entry);
if (Z_STRLEN_P(entry) > maxlength) {
maxlength = Z_STRLEN_P(entry) + 1;
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < bind->array.current_length; i++) {
- if (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE) {
+ if ((entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_string_ex(entry);
bind->array.element_lengths[i] = Z_STRLEN_P(entry);
if (Z_STRLEN_P(entry) == 0) {
zend_hash_internal_pointer_reset(hash);
for (i = 0; i < max_table_length; i++) {
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
int element_length;
convert_to_string_ex(entry);
if (i < bind->array.current_length) {
bind->array.element_lengths[i] = sizeof(ub4);
}
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_long_ex(entry);
((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_P(entry);
zend_hash_move_forward(hash);
if (i < bind->array.current_length) {
bind->array.element_lengths[i] = sizeof(double);
}
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_double_ex(entry);
((double *)bind->array.elements)[i] = (double) Z_DVAL_P(entry);
zend_hash_move_forward(hash);
if (i < bind->array.current_length) {
bind->array.element_lengths[i] = sizeof(OCIDate);
}
- if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE)) {
+ if ((i < bind->array.current_length) && (entry = zend_hash_get_current_data(hash)) != NULL) {
convert_to_string_ex(entry);
PHP_OCI_CALL_RETURN(errstatus, OCIDateFromText, (connection->err, (CONST text *)Z_STRVAL_P(entry), Z_STRLEN_P(entry), NULL, 0, NULL, 0, &oci_date));