diff options
Diffstat (limited to 'ext/interbase/interbase.c')
-rw-r--r-- | ext/interbase/interbase.c | 216 |
1 files changed, 108 insertions, 108 deletions
diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 4275f8a054..cf6bba89b4 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -199,15 +199,15 @@ typedef struct { */ #define GET_BLOB_ID_ARG(blob_arg, ib_blob)\ {\ - if (blob_arg->type == IS_STRING && blob_arg->value.str.len == 0) {\ + if (Z_TYPE_P(blob_arg) == IS_STRING && Z_STRLEN_P(blob_arg) == 0) {\ ib_blob = NULL;\ - } else if (blob_arg->type != IS_STRING\ - || blob_arg->value.str.len != sizeof(ibase_blob_handle)\ - || ((ibase_blob_handle *)(blob_arg->value.str.val))->bl_handle != 0){\ + } else if (Z_TYPE_P(blob_arg) != IS_STRING\ + || Z_STRLEN_P(blob_arg) != sizeof(ibase_blob_handle)\ + || ((ibase_blob_handle *)(Z_STRVAL_P(blob_arg)))->bl_handle != 0){\ _php_ibase_module_error("invalid blob id");\ RETURN_FALSE;\ } else {\ - ib_blob = (ibase_blob_handle *)blob_arg->value.str.val;\ + ib_blob = (ibase_blob_handle *)Z_STRVAL_P(blob_arg);\ }\ } @@ -219,9 +219,9 @@ typedef struct { { \ int type; \ convert_to_long(blob_arg); \ - blob_ptr = (ibase_blob_handle *) zend_list_find(blob_arg->value.lval, &type); \ + blob_ptr = (ibase_blob_handle *) zend_list_find(Z_LVAL_P(blob_arg), &type); \ if (type!=le_blob) { \ - _php_ibase_module_error("%d is not blob handle", blob_arg->value.lval); \ + _php_ibase_module_error("%d is not blob handle", Z_LVAL_P(blob_arg)); \ RETURN_FALSE; \ } \ } @@ -756,7 +756,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) char tmp_1[] = {isc_info_base_level, isc_info_end}; char tmp_2[8]; /* Enough? Hope so... */ - if (le->type != le_plink) { + if (Z_TYPE_P(le) != le_plink) { RETURN_FALSE; } /* Check if connection has timed out */ @@ -797,7 +797,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) ib_link->trans[i] = NULL; /* hash it up */ - new_le.type = le_plink; + Z_TYPE(new_le) = le_plink; new_le.ptr = ib_link; if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { efree(hashed_details); @@ -821,16 +821,16 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (zend_hash_find(&EG(regular_list), hashed_details, hashed_details_length+1, (void **) &index_ptr)==SUCCESS) { int type, xlink; void *ptr; - if (index_ptr->type != le_index_ptr) { + if (Z_TYPE_P(index_ptr) != le_index_ptr) { RETURN_FALSE; } xlink = (int) index_ptr->ptr; ptr = zend_list_find(xlink, &type); /* check if the xlink is still there */ if (ptr && (type==le_link || type==le_plink)) { zend_list_addref(xlink); - return_value->value.lval = xlink; - return_value->type = IS_RESOURCE; - IBG(default_link) = return_value->value.lval; + Z_LVAL_P(return_value) = xlink; + Z_TYPE_P(return_value) = IS_RESOURCE; + IBG(default_link) = Z_LVAL_P(return_value); efree(hashed_details); return; } else { @@ -860,8 +860,8 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) ZEND_REGISTER_RESOURCE(return_value, ib_link, le_link); /* add it to the hash */ - new_index_ptr.ptr = (void *) return_value->value.lval; - new_index_ptr.type = le_index_ptr; + new_index_ptr.ptr = (void *) Z_LVAL_P(return_value); + Z_TYPE(new_index_ptr) = le_index_ptr; if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length+1, (void *) &new_index_ptr, sizeof(list_entry), NULL)==FAILURE) { efree(hashed_details); RETURN_FALSE; @@ -869,8 +869,8 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) IBG(num_links)++; } efree(hashed_details); - zend_list_addref(return_value->value.lval); - IBG(default_link) = return_value->value.lval; + zend_list_addref(Z_LVAL_P(return_value)); + IBG(default_link) = Z_LVAL_P(return_value); } /* }}} */ @@ -909,7 +909,7 @@ PHP_FUNCTION(ibase_close) RETURN_FALSE; } convert_to_long_ex(link_arg); - link_id = (*link_arg)->value.lval; + link_id = Z_LVAL_PP(link_arg); break; default: WRONG_PARAM_COUNT; @@ -1137,7 +1137,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu var->sqlind = &buf[i].sqlind; b_var = b_vars[i]; - if (b_var->type == IS_NULL) { + if (Z_TYPE_P(b_var) == IS_NULL) { static char nothing[64]; static short null_flag = -1; var->sqldata = nothing; @@ -1150,17 +1150,17 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu case SQL_TEXT: /* direct to variable */ case SQL_VARYING: convert_to_string(b_var); - var->sqldata = (void ISC_FAR *)b_var->value.str.val; - var->sqllen = b_var->value.str.len; + var->sqldata = (void ISC_FAR *)Z_STRVAL_P(b_var); + var->sqllen = Z_STRLEN_P(b_var); var->sqltype = SQL_TEXT + (var->sqltype & 1); break; case SQL_SHORT: convert_to_long(b_var); - if (b_var->value.lval > SHRT_MAX || b_var->value.lval < SHRT_MIN) { + if (Z_LVAL_P(b_var) > SHRT_MAX || Z_LVAL_P(b_var) < SHRT_MIN) { _php_ibase_module_error("field %*s overflow", var->aliasname_length, var->aliasname); return FAILURE; } - buf[i].val.sval = (short)b_var->value.lval; + buf[i].val.sval = (short)Z_LVAL_P(b_var); var->sqldata = (void ISC_FAR *)(&buf[i].val.sval); break; case SQL_LONG: @@ -1171,22 +1171,22 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu handle it. */ convert_to_string(b_var); - var->sqldata = (void ISC_FAR *)b_var->value.str.val; - var->sqllen = b_var->value.str.len; + var->sqldata = (void ISC_FAR *)Z_STRVAL_P(b_var); + var->sqllen = Z_STRLEN_P(b_var); var->sqltype = SQL_TEXT; } else { convert_to_long(b_var); - var->sqldata = (void ISC_FAR *)(&b_var->value.lval); + var->sqldata = (void ISC_FAR *)(&Z_LVAL_P(b_var)); } break; case SQL_FLOAT: convert_to_double(b_var); - buf[i].val.fval = (float)b_var->value.dval; + buf[i].val.fval = (float)Z_DVAL_P(b_var); var->sqldata = (void ISC_FAR *)(&buf[i].val.fval); break; case SQL_DOUBLE: /* direct to variable */ convert_to_double(b_var); - var->sqldata = (void ISC_FAR *)(&b_var->value.dval); + var->sqldata = (void ISC_FAR *)(&Z_DVAL_P(b_var)); break; #ifdef SQL_INT64 case SQL_INT64: @@ -1196,8 +1196,8 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu to avoid rounding errors... */ convert_to_string(b_var); - var->sqldata = (void ISC_FAR *)b_var->value.str.val; - var->sqllen = b_var->value.str.len; + var->sqldata = (void ISC_FAR *)Z_STRVAL_P(b_var); + var->sqllen = Z_STRLEN_P(b_var); var->sqltype = SQL_TEXT; break; #endif @@ -1220,10 +1220,10 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu convert_to_string(b_var); - n = sscanf(b_var->value.str.val, "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d", + n = sscanf(Z_STRVAL_P(b_var), "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d", &t.tm_mon, &t.tm_mday, &t.tm_year, &t.tm_hour, &t.tm_min, &t.tm_sec); if(n != 3 && n != 6){ - _php_ibase_module_error("invalid date/time format: Expected 3 or 6 fields, got %d. Use format m/d/Y H:i:s. You gave '%s'", n, b_var->value.str.val); + _php_ibase_module_error("invalid date/time format: Expected 3 or 6 fields, got %d. Use format m/d/Y H:i:s. You gave '%s'", n, Z_STRVAL_P(b_var)); return FAILURE; } t.tm_year -= 1900; @@ -1240,8 +1240,8 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu ask Sascha? */ convert_to_string(b_var); - var->sqldata = (void ISC_FAR *)b_var->value.str.val; - var->sqllen = b_var->value.str.len; + var->sqldata = (void ISC_FAR *)Z_STRVAL_P(b_var); + var->sqllen = Z_STRLEN_P(b_var); var->sqltype = SQL_TEXT; #endif #else @@ -1250,23 +1250,23 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu convert_to_string(b_var); #ifndef SQL_TIMESTAMP - strptime(b_var->value.str.val, IBG(timestampformat), &t); + strptime(Z_STRVAL_P(b_var), IBG(timestampformat), &t); isc_encode_date(&t, &buf[i].val.qval); var->sqldata = (void ISC_FAR *)(&buf[i].val.qval); #else switch (var->sqltype & ~1) { case SQL_TIMESTAMP: - strptime(b_var->value.str.val, IBG(timestampformat), &t); + strptime(Z_STRVAL_P(b_var), IBG(timestampformat), &t); isc_encode_timestamp(&t, &buf[i].val.tsval); var->sqldata = (void ISC_FAR *)(&buf[i].val.tsval); break; case SQL_TYPE_DATE: - strptime(b_var->value.str.val, IBG(dateformat), &t); + strptime(Z_STRVAL_P(b_var), IBG(dateformat), &t); isc_encode_sql_date(&t, &buf[i].val.dtval); var->sqldata = (void ISC_FAR *)(&buf[i].val.dtval); break; case SQL_TYPE_TIME: - strptime(b_var->value.str.val, IBG(timeformat), &t); + strptime(Z_STRVAL_P(b_var), IBG(timeformat), &t); isc_encode_sql_time(&t, &buf[i].val.tmval); var->sqldata = (void ISC_FAR *)(&buf[i].val.tmval); break; @@ -1278,9 +1278,9 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu case SQL_BLOB: { ibase_blob_handle *ib_blob_id; - if (b_var->type != IS_STRING - || b_var->value.str.len != sizeof(ibase_blob_handle) - || ((ibase_blob_handle *)(b_var->value.str.val))->bl_handle != 0) { + if (Z_TYPE_P(b_var) != IS_STRING + || Z_STRLEN_P(b_var) != sizeof(ibase_blob_handle) + || ((ibase_blob_handle *)(Z_STRVAL_P(b_var)))->bl_handle != 0) { ibase_blob_handle *ib_blob; TSRMLS_FETCH(); @@ -1294,7 +1294,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu return FAILURE; } convert_to_string(b_var); - if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) b_var->value.str.len, b_var->value.str.val)) { + if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(b_var), Z_STRVAL_P(b_var))) { _php_ibase_error(); return FAILURE; } @@ -1309,7 +1309,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, pval **b_vars, BIND_BUF *buf, ibase_qu return FAILURE; */ } else { - ib_blob_id = (ibase_blob_handle *)b_var->value.str.val; + ib_blob_id = (ibase_blob_handle *)Z_STRVAL_P(b_var); var->sqldata = (void ISC_FAR *)&ib_blob_id->bl_qd; } @@ -1660,7 +1660,7 @@ PHP_FUNCTION(ibase_query) } i = 0; - if ((*args[i])->type == IS_RESOURCE) { /* link or transaction argument */ + if (Z_TYPE_PP(args[i]) == IS_RESOURCE) { /* link or transaction argument */ get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, args[i], &ib_link, &trans_n, &trans_id); i++; /* next arg */ } else { @@ -1668,9 +1668,9 @@ PHP_FUNCTION(ibase_query) ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, dummy, link_id, "InterBase link", le_link, le_plink); } - if ((*args[i])->type == IS_STRING) { /* query argument */ + if (Z_TYPE_PP(args[i]) == IS_STRING) { /* query argument */ convert_to_string_ex(args[i]); - query = (*args[i])->value.str.val; + query = Z_STRVAL_PP(args[i]); i++; /* next arg */ } else { _php_ibase_module_error("query argument missed"); @@ -1728,14 +1728,14 @@ static int _php_ibase_var_pval(pval *val, void *data, int type, int len, int sca data = ((IBASE_VCHAR *) data)->var_str; /* fallout */ case SQL_TEXT: - val->value.str.val = (char *)emalloc(sizeof(char)*(len+1)); - memcpy(val->value.str.val, data, len); - val->value.str.val[len] = '\0'; + Z_STRVAL_P(val) = (char *)emalloc(sizeof(char)*(len+1)); + memcpy(Z_STRVAL_P(val), data, len); + Z_STRVAL_P(val)[len] = '\0'; if (PG(magic_quotes_runtime)) { - val->value.str.val = php_addslashes(val->value.str.val, len, &len, 1 TSRMLS_CC); + Z_STRVAL_P(val) = php_addslashes(Z_STRVAL_P(val), len, &len, 1 TSRMLS_CC); } - val->type = IS_STRING; - val->value.str.len = len; + Z_TYPE_P(val) = IS_STRING; + Z_STRLEN_P(val) = len; break; case SQL_LONG: if (scale) { @@ -1745,42 +1745,42 @@ static int _php_ibase_var_pval(pval *val, void *data, int type, int len, int sca for (j = 0; j < -scale; j++) { f *= 10; } - val->type = IS_STRING; - val->value.str.len = sprintf(string_data, "%.*f", -scale, n / f); - val->value.str.val = estrdup(string_data); + Z_TYPE_P(val) = IS_STRING; + Z_STRLEN_P(val) = sprintf(string_data, "%.*f", -scale, n / f); + Z_STRVAL_P(val) = estrdup(string_data); } else { - val->type = IS_LONG; - val->value.lval = *(long *)(data); + Z_TYPE_P(val) = IS_LONG; + Z_LVAL_P(val) = *(long *)(data); } break; case SQL_SHORT: - val->type = IS_LONG; - val->value.lval = *(short *)(data); + Z_TYPE_P(val) = IS_LONG; + Z_LVAL_P(val) = *(short *)(data); break; case SQL_FLOAT: - val->type = IS_DOUBLE; - val->value.dval = *(float *)(data); + Z_TYPE_P(val) = IS_DOUBLE; + Z_DVAL_P(val) = *(float *)(data); break; case SQL_DOUBLE: if (scale) { - val->type = IS_STRING; - val->value.str.len = sprintf(string_data, "%.*f", -scale, *(double *)data); - val->value.str.val = estrdup(string_data); + Z_TYPE_P(val) = IS_STRING; + Z_STRLEN_P(val) = sprintf(string_data, "%.*f", -scale, *(double *)data); + Z_STRVAL_P(val) = estrdup(string_data); /* - val->value.str.val = string_data; + Z_STRVAL_P(val) = string_data; */ } else { - val->type = IS_DOUBLE; - val->value.dval = *(double *)data; + Z_TYPE_P(val) = IS_DOUBLE; + Z_DVAL_P(val) = *(double *)data; } break; #ifdef SQL_INT64 case SQL_INT64: - val->type = IS_STRING; - val->value.str.len = sprintf(string_data, "%Ld.%0*Ld", + Z_TYPE_P(val) = IS_STRING; + Z_STRLEN_P(val) = sprintf(string_data, "%Ld.%0*Ld", (ISC_INT64) (*((ISC_INT64 *)data) / (int) pow(10.0, (double) -scale)), -scale, (ISC_INT64) abs((int) (*((ISC_INT64 *)data) % (int) pow(10.0, (double) -scale)))); - val->value.str.val = estrdup(string_data); + Z_STRVAL_P(val) = estrdup(string_data); break; #endif #ifndef SQL_TIMESTAMP @@ -1824,23 +1824,23 @@ static int _php_ibase_var_pval(pval *val, void *data, int type, int len, int sca t.tm_zone = tzname[0]; #endif if (flag & PHP_IBASE_UNIXTIME) { - val->type = IS_LONG; - val->value.lval = timestamp; + Z_TYPE_P(val) = IS_LONG; + Z_LVAL_P(val) = timestamp; } else { - val->type = IS_STRING; + Z_TYPE_P(val) = IS_STRING; #if HAVE_STRFTIME - val->value.str.len = strftime(string_data, sizeof(string_data), format, &t); + Z_STRLEN_P(val) = strftime(string_data, sizeof(string_data), format, &t); #else /* FIXME */ if (!t.tm_hour && !t.tm_min && !t.tm_sec) - val->value.str.len = sprintf(string_data, "%02d/%02d/%4d", t.tm_mon+1, t.tm_mday, t.tm_year+1900); + Z_STRLEN_P(val) = sprintf(string_data, "%02d/%02d/%4d", t.tm_mon+1, t.tm_mday, t.tm_year+1900); else - val->value.str.len = sprintf(string_data, "%02d/%02d/%4d %02d:%02d:%02d", + Z_STRLEN_P(val) = sprintf(string_data, "%02d/%02d/%4d %02d:%02d:%02d", t.tm_mon+1, t.tm_mday, t.tm_year+1900, t.tm_hour, t.tm_min, t.tm_sec); #endif - val->value.str.val = estrdup(string_data); + Z_STRVAL_P(val) = estrdup(string_data); /* - val->value.str.val = string_data; + Z_STRVAL_P(val) = string_data; */ break; } @@ -1889,7 +1889,7 @@ static int _php_ibase_arr_pval(pval *ar_pval, char **datap, ibase_array *ib_arra return FAILURE; } /* FIXME ??? */ - zend_hash_index_update(ar_pval->value.ht, + zend_hash_index_update(Z_ARRVAL_P(ar_pval), l_bound + i, (void *) &tmp, sizeof(pval), NULL); *datap += ib_array->el_size; @@ -1925,7 +1925,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) RETURN_FALSE; } convert_to_long_ex(flag_arg); - flag = (*flag_arg)->value.lval; + flag = Z_LVAL_PP(flag_arg); break; default: WRONG_PARAM_COUNT; @@ -2037,9 +2037,9 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) _php_ibase_error(); RETURN_FALSE; } - tmp->type = IS_STRING; - tmp->value.str.len = cur_len; - tmp->value.str.val = estrndup(bl_data, cur_len); + Z_TYPE_P(tmp) = IS_STRING; + Z_STRLEN_P(tmp) = cur_len; + Z_STRVAL_P(tmp) = estrndup(bl_data, cur_len); efree(bl_data); } else { /* blob id only */ ISC_QUAD *bl_qd = (ISC_QUAD ISC_FAR *) var->sqldata; @@ -2053,9 +2053,9 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) ib_blob_id->bl_qd.gds_quad_low = bl_qd->gds_quad_low; ib_blob_id->bl_handle = NULL; - tmp->type = IS_STRING; - tmp->value.str.len = sizeof(ibase_blob_handle); - tmp->value.str.val = estrndup((char *)ib_blob_id, sizeof(ibase_blob_handle)); + Z_TYPE_P(tmp) = IS_STRING; + Z_STRLEN_P(tmp) = sizeof(ibase_blob_handle); + Z_STRVAL_P(tmp) = estrndup((char *)ib_blob_id, sizeof(ibase_blob_handle)); efree(ib_blob_id); } break; @@ -2084,27 +2084,27 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) break; } /*switch*/ if (fetch_type & FETCH_ARRAY) { - switch (tmp->type) { + switch (Z_TYPE_P(tmp)) { case IS_STRING: - add_index_stringl(return_value, i, tmp->value.str.val, tmp->value.str.len, 0); + add_index_stringl(return_value, i, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0); break; case IS_LONG: - add_index_long(return_value, i, tmp->value.lval); + add_index_long(return_value, i, Z_LVAL_P(tmp)); break; case IS_DOUBLE: - add_index_double(return_value, i, tmp->value.dval); + add_index_double(return_value, i, Z_DVAL_P(tmp)); break; } } else { - switch (tmp->type) { + switch (Z_TYPE_P(tmp)) { case IS_STRING: - add_property_stringl(return_value, var->aliasname, tmp->value.str.val, tmp->value.str.len, 0); + add_property_stringl(return_value, var->aliasname, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp), 0); break; case IS_LONG: - add_property_long(return_value, var->aliasname, tmp->value.lval); + add_property_long(return_value, var->aliasname, Z_LVAL_P(tmp)); break; case IS_DOUBLE: - add_property_double(return_value, var->aliasname, tmp->value.dval); + add_property_double(return_value, var->aliasname, Z_DVAL_P(tmp)); break; } } @@ -2147,7 +2147,7 @@ PHP_FUNCTION(ibase_free_result) } ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, "InterBase result", le_result); - zend_list_delete((*result_arg)->value.lval); + zend_list_delete(Z_LVAL_PP(result_arg)); RETURN_TRUE; } /* }}} */ @@ -2184,7 +2184,7 @@ PHP_FUNCTION(ibase_prepare) } convert_to_string_ex(query_arg); - query = (*query_arg)->value.str.val; + query = Z_STRVAL_PP(query_arg); /* open default transaction */ if (_php_ibase_def_trans(ib_link, trans_n) == FAILURE) { @@ -2269,7 +2269,7 @@ PHP_FUNCTION(ibase_free_query) } ZEND_FETCH_RESOURCE(ib_query, ibase_query *, query_arg, -1, "InterBase query", le_query); - zend_list_delete((*query_arg)->value.lval); + zend_list_delete(Z_LVAL_PP(query_arg)); RETURN_TRUE; } /* }}} */ @@ -2382,13 +2382,13 @@ PHP_FUNCTION(ibase_field_info) convert_to_long_ex(field_arg); - if ((*field_arg)->value.lval<0 || (*field_arg)->value.lval>=ib_result->out_sqlda->sqld) + if (Z_LVAL_PP(field_arg)<0 || Z_LVAL_PP(field_arg)>=ib_result->out_sqlda->sqld) RETURN_FALSE; if (array_init(return_value)==FAILURE) RETURN_FALSE; - var = ib_result->out_sqlda->sqlvar + (*field_arg)->value.lval; + var = ib_result->out_sqlda->sqlvar + Z_LVAL_PP(field_arg); add_get_index_stringl(return_value, 0, var->sqlname, var->sqlname_length, (void **) &ret_val, 1); add_assoc_stringl(return_value, "name", var->sqlname, var->sqlname_length, 1); @@ -2592,7 +2592,7 @@ PHP_FUNCTION(ibase_blob_add) convert_to_string(string_arg); - if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) string_arg->value.str.len, string_arg->value.str.val)) { + if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(string_arg), Z_STRVAL_P(string_arg))) { _php_ibase_error(); RETURN_FALSE; } @@ -2617,7 +2617,7 @@ PHP_FUNCTION(ibase_blob_get) } convert_to_long(len_arg); - max_len = (unsigned short) len_arg->value.lval; + max_len = (unsigned short) Z_LVAL_P(len_arg); GET_BLOB_HANDLE_ARG(blob_arg, ib_blob); @@ -2675,14 +2675,14 @@ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) } ib_blob->bl_handle = NULL; RETVAL_STRINGL((char *)ib_blob, sizeof(ibase_blob_handle), 1); - zend_list_delete(blob_arg->value.lval); + zend_list_delete(Z_LVAL_P(blob_arg)); } else { /* discard created blob */ if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) { _php_ibase_error(); RETURN_FALSE; } ib_blob->bl_handle = NULL; - zend_list_delete(blob_arg->value.lval); + zend_list_delete(Z_LVAL_P(blob_arg)); RETURN_TRUE; } } @@ -2749,22 +2749,22 @@ PHP_FUNCTION(ibase_blob_info) /* FIXME */ add_get_index_long(return_value, 0, bl_info.total_length, (void **)&result_var); /* - zend_hash_pointer_update(return_value->value.ht, "length", sizeof("length"), result_var); + zend_hash_pointer_update(Z_ARRVAL_P(return_value), "length", sizeof("length"), result_var); */ add_get_index_long(return_value, 1, bl_info.num_segments, (void **)&result_var); /* - zend_hash_pointer_update(return_value->value.ht, "numseg", sizeof("numseg"), result_var); + zend_hash_pointer_update(Z_ARRVAL_P(return_value), "numseg", sizeof("numseg"), result_var); */ add_get_index_long(return_value, 2, bl_info.max_segment, (void **)&result_var); /* - zend_hash_pointer_update(return_value->value.ht, "maxseg", sizeof("maxseg"), result_var); + zend_hash_pointer_update(Z_ARRVAL_P(return_value), "maxseg", sizeof("maxseg"), result_var); */ add_get_index_long(return_value, 3, bl_info.bl_stream, (void **)&result_var); /* - zend_hash_pointer_update(return_value->value.ht, "stream", sizeof("stream"), result_var); + zend_hash_pointer_update(Z_ARRVAL_P(return_value), "stream", sizeof("stream"), result_var); */ add_get_index_long(return_value, 4, @@ -2772,7 +2772,7 @@ PHP_FUNCTION(ibase_blob_info) && !ib_blob_id->bl_qd.gds_quad_low), (void **)&result_var); /* - zend_hash_pointer_update(return_value->value.ht, "isnull", sizeof("isnull"), result_var); + zend_hash_pointer_update(Z_ARRVAL_P(return_value), "isnull", sizeof("isnull"), result_var); */ } /* }}} */ |