diff options
Diffstat (limited to 'ext/interbase/ibase_query.c')
-rw-r--r-- | ext/interbase/ibase_query.c | 176 |
1 files changed, 88 insertions, 88 deletions
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c index 2cd2ada65f..95c462e55c 100644 --- a/ext/interbase/ibase_query.c +++ b/ext/interbase/ibase_query.c @@ -116,7 +116,7 @@ static void _php_ibase_free_xsqlda(XSQLDA *sqlda) /* {{{ */ } /* }}} */ -static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stmt TSRMLS_DC) /* {{{ */ +static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stmt) /* {{{ */ { static char info[] = { isc_info_base_level, isc_info_end }; @@ -127,14 +127,14 @@ static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stm if (SUCCESS == isc_database_info(IB_STATUS, &link->handle, sizeof(info), info, sizeof(res_buf), res_buf)) { if (isc_dsql_free_statement(IB_STATUS, &stmt, DSQL_drop)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); } } } } /* }}} */ -static void _php_ibase_free_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */ +static void _php_ibase_free_result(zend_resource *rsrc) /* {{{ */ { ibase_result *ib_result = (ibase_result *) rsrc->ptr; @@ -145,14 +145,14 @@ static void _php_ibase_free_result(zend_resource *rsrc TSRMLS_DC) /* {{{ */ IBDEBUG("query still valid; don't drop statement handle"); ib_result->query->result = NULL; /* Indicate to query, that result is released */ } else { - _php_ibase_free_stmt_handle(ib_result->link, ib_result->stmt TSRMLS_CC); + _php_ibase_free_stmt_handle(ib_result->link, ib_result->stmt); } efree(ib_result); } } /* }}} */ -static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */ +static void _php_ibase_free_query(ibase_query *ib_query) /* {{{ */ { IBDEBUG("Freeing query..."); @@ -166,7 +166,7 @@ static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */ IBDEBUG("result still valid; don't drop statement handle"); ib_query->result->query = NULL; /* Indicate to result, that query is released */ } else { - _php_ibase_free_stmt_handle(ib_query->link, ib_query->stmt TSRMLS_CC); + _php_ibase_free_stmt_handle(ib_query->link, ib_query->stmt); } if (ib_query->in_array) { efree(ib_query->in_array); @@ -180,13 +180,13 @@ static void _php_ibase_free_query(ibase_query *ib_query TSRMLS_DC) /* {{{ */ } /* }}} */ -static void php_ibase_free_query_rsrc(zend_resource *rsrc TSRMLS_DC) /* {{{ */ +static void php_ibase_free_query_rsrc(zend_resource *rsrc) /* {{{ */ { ibase_query *ib_query = (ibase_query *)rsrc->ptr; if (ib_query != NULL) { IBDEBUG("Preparing to free query by dtor..."); - _php_ibase_free_query(ib_query TSRMLS_CC); + _php_ibase_free_query(ib_query); efree(ib_query); } } @@ -202,7 +202,7 @@ void php_ibase_query_minit(INIT_FUNC_ARGS) /* {{{ */ /* }}} */ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ */ - isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt TSRMLS_DC) + isc_db_handle link, isc_tr_handle trans, unsigned short *array_cnt) { unsigned short i, n; ibase_array *ar; @@ -228,7 +228,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ if (isc_array_lookup_bounds(IB_STATUS, &link, &trans, var->relname, var->sqlname, ar_desc)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); efree(ar); return FAILURE; } @@ -313,14 +313,14 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ /* allocate and prepare query */ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* {{{ */ - ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id TSRMLS_DC) + ibase_trans *trans, char *query, unsigned short dialect, int trans_res_id) { static char info_type[] = {isc_info_sql_stmt_type}; char result[8]; /* Return FAILURE, if querystring is empty */ if (*query == '\0') { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Querystring empty."); + php_error_docref(NULL, E_WARNING, "Querystring empty."); return FAILURE; } @@ -338,7 +338,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* ib_query->in_sqlda = NULL; if (isc_dsql_allocate_statement(IB_STATUS, &link->handle, &ib_query->stmt)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_alloc_query_error; } @@ -348,14 +348,14 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* if (isc_dsql_prepare(IB_STATUS, &ib_query->trans->handle, &ib_query->stmt, 0, query, dialect, ib_query->out_sqlda)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_alloc_query_error; } /* find out what kind of statement was prepared */ if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_type), info_type, sizeof(result), result)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_alloc_query_error; } ib_query->statement_type = result[3]; @@ -366,7 +366,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* ib_query->out_sqlda->sqln = ib_query->out_sqlda->sqld; ib_query->out_sqlda->version = SQLDA_CURRENT_VERSION; if (isc_dsql_describe(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->out_sqlda)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_alloc_query_error; } } @@ -376,7 +376,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* ib_query->in_sqlda->sqln = 1; ib_query->in_sqlda->version = SQLDA_CURRENT_VERSION; if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_alloc_query_error; } @@ -388,7 +388,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* if (isc_dsql_describe_bind(IB_STATUS, &ib_query->stmt, SQLDA_CURRENT_VERSION, ib_query->in_sqlda)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_alloc_query_error; } } @@ -398,7 +398,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* efree(ib_query->in_sqlda); ib_query->in_sqlda = NULL; } else if (FAILURE == _php_ibase_alloc_array(&ib_query->in_array, ib_query->in_sqlda, - link->handle, trans->handle, &ib_query->in_array_cnt TSRMLS_CC)) { + link->handle, trans->handle, &ib_query->in_array_cnt)) { goto _php_ibase_alloc_query_error; } @@ -406,7 +406,7 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* efree(ib_query->out_sqlda); ib_query->out_sqlda = NULL; } else if (FAILURE == _php_ibase_alloc_array(&ib_query->out_array, ib_query->out_sqlda, - link->handle, trans->handle, &ib_query->out_array_cnt TSRMLS_CC)) { + link->handle, trans->handle, &ib_query->out_array_cnt)) { goto _php_ibase_alloc_query_error; } @@ -431,7 +431,7 @@ _php_ibase_alloc_query_error: /* }}} */ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, /* {{{ */ - ibase_array *array, int dim TSRMLS_DC) + ibase_array *array, int dim) { zval null_val, *pnull_val = &null_val; int u_bound = array->ar_desc.array_desc_bounds[dim].array_bound_upper, @@ -457,7 +457,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / subval = pnull_val; } - if (_php_ibase_bind_array(subval, buf, slice_size, array, dim+1 TSRMLS_CC) == FAILURE) + if (_php_ibase_bind_array(subval, buf, slice_size, array, dim+1) == FAILURE) { return FAILURE; } @@ -492,14 +492,14 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / switch (array->el_type) { case SQL_SHORT: if (l > SHRT_MAX || l < SHRT_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); + _php_ibase_module_error("Array parameter exceeds field width"); return FAILURE; } *(short*) buf = (short) l; break; case SQL_LONG: if (l > ISC_LONG_MAX || l < ISC_LONG_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); + _php_ibase_module_error("Array parameter exceeds field width"); return FAILURE; } *(ISC_LONG*) buf = (ISC_LONG) l; @@ -536,7 +536,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / case SQL_SHORT: convert_to_long(val); if (Z_LVAL_P(val) > SHRT_MAX || Z_LVAL_P(val) < SHRT_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); + _php_ibase_module_error("Array parameter exceeds field width"); return FAILURE; } *(short *) buf = (short) Z_LVAL_P(val); @@ -545,7 +545,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / convert_to_long(val); #if (SIZEOF_LONG > 4) if (Z_LVAL_P(val) > ISC_LONG_MAX || Z_LVAL_P(val) < ISC_LONG_MIN) { - _php_ibase_module_error("Array parameter exceeds field width" TSRMLS_CC); + _php_ibase_module_error("Array parameter exceeds field width"); return FAILURE; } #endif @@ -584,7 +584,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / 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')" TSRMLS_CC, n, Z_STRVAL_P(val)); + " Use format 'm/d/Y H:i:s'. You gave '%s')", n, Z_STRVAL_P(val)); return FAILURE; } t.tm_year -= 1900; @@ -601,7 +601,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / if (n != 3) { _php_ibase_module_error("Invalid date format (expected 3 fields, got %d. " - "Use format 'm/d/Y' You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val)); + "Use format 'm/d/Y' You gave '%s')", n, Z_STRVAL_P(val)); return FAILURE; } t.tm_year -= 1900; @@ -618,7 +618,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / if (n != 3) { _php_ibase_module_error("Invalid time format (expected 3 fields, got %d. " - "Use format 'H:i:s'. You gave '%s')" TSRMLS_CC, n, Z_STRVAL_P(val)); + "Use format 'H:i:s'. You gave '%s')", n, Z_STRVAL_P(val)); return FAILURE; } #endif @@ -635,7 +635,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / /* }}} */ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ - ibase_query *ib_query TSRMLS_DC) + ibase_query *ib_query) { int i, array_cnt = 0, rv = SUCCESS; @@ -741,16 +741,16 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ if (isc_create_blob(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle, &ib_blob.bl_handle, &ib_blob.bl_qd)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); return FAILURE; } - if (_php_ibase_blob_add(b_var, &ib_blob TSRMLS_CC) != SUCCESS) { + if (_php_ibase_blob_add(b_var, &ib_blob) != SUCCESS) { return FAILURE; } if (isc_close_blob(IB_STATUS, &ib_blob.bl_handle)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); return FAILURE; } buf[i].val.qval = ib_blob.bl_qd; @@ -765,7 +765,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ if (Z_STRLEN_P(b_var) != BLOB_ID_LEN || !_php_ibase_string_to_quad(Z_STRVAL_P(b_var), &buf[i].val.qval)) { - _php_ibase_module_error("Parameter %d: invalid array ID" TSRMLS_CC,i+1); + _php_ibase_module_error("Parameter %d: invalid array ID",i+1); rv = FAILURE; } } else { @@ -775,7 +775,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ ISC_QUAD array_id = { 0, 0 }; if (FAILURE == _php_ibase_bind_array(b_var, array_data, ar->ar_size, - ar, 0 TSRMLS_CC)) { + ar, 0)) { _php_ibase_module_error("Parameter %d: failed to bind array argument" TSRMLS_CC,i+1); efree(array_data); @@ -785,7 +785,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ if (isc_array_put_slice(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle, &array_id, &ar->ar_desc, array_data, &ar->ar_size)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); efree(array_data); return FAILURE; } @@ -888,7 +888,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &tr, 0, ib_query->query, ib_query->dialect, NULL)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_exec_error; } @@ -920,7 +920,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle, 0, ib_query->query, ib_query->dialect, NULL)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_exec_error; } @@ -969,7 +969,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul in_sqlda = emalloc(XSQLDA_LENGTH(ib_query->in_sqlda->sqld)); memcpy(in_sqlda, ib_query->in_sqlda, XSQLDA_LENGTH(ib_query->in_sqlda->sqld)); bind_buf = safe_emalloc(sizeof(BIND_BUF), ib_query->in_sqlda->sqld, 0); - if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query TSRMLS_CC) == FAILURE) { + if (_php_ibase_bind(in_sqlda, args, bind_buf, ib_query) == FAILURE) { IBDEBUG("Could not bind input XSQLDA"); goto _php_ibase_exec_error; } @@ -984,7 +984,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul } if (isc_result) { IBDEBUG("Could not execute query"); - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_exec_error; } ib_query->trans->affected_rows = 0; @@ -1000,7 +1000,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_count), info_count, sizeof(result), result)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_exec_error; } @@ -1077,7 +1077,7 @@ PHP_FUNCTION(ibase_query) long l; default: - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3 TSRMLS_CC, "rrs", + if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 3, "rrs", &zlink, &ztrans, &query, &query_len)) { ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link*, zlink, -1, LE_LINK, le_link, le_plink); @@ -1088,7 +1088,7 @@ PHP_FUNCTION(ibase_query) break; } case 2: - if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2 TSRMLS_CC, "rs", + if (SUCCESS == zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, 2, "rs", &zlink, &query, &query_len)) { _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, zlink, &ib_link, &trans); @@ -1107,19 +1107,19 @@ PHP_FUNCTION(ibase_query) if (PG(sql_safe_mode)) { _php_ibase_module_error("CREATE DATABASE is not allowed in SQL safe mode" - TSRMLS_CC); + ); } else if (((l = INI_INT("ibase.max_links")) != -1) && (IBG(num_links) >= l)) { _php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count " - "(%ld) reached" TSRMLS_CC, l); + "(%ld) reached", l); } else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len, query, SQL_DIALECT_CURRENT, NULL)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); } else if (!db) { _php_ibase_module_error("Connection to created database could not be " - "established" TSRMLS_CC); + "established"); } else { @@ -1140,7 +1140,7 @@ PHP_FUNCTION(ibase_query) } case 1: case 0: - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0 TSRMLS_CC, "s", &query, + if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0, "s", &query, &query_len)) { ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, le_link, le_plink); @@ -1152,9 +1152,9 @@ PHP_FUNCTION(ibase_query) } /* open default transaction */ - if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC) + if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans) || FAILURE == _php_ibase_alloc_query(&ib_query, ib_link, trans, query, ib_link->dialect, - trans_res_id TSRMLS_CC)) { + trans_res_id)) { return; } @@ -1163,13 +1163,13 @@ PHP_FUNCTION(ibase_query) expected_n = ib_query.in_sqlda ? ib_query.in_sqlda->sqld : 0; if (bind_n != expected_n) { - php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE, + php_error_docref(NULL, (bind_n < expected_n) ? E_WARNING : E_NOTICE, "Statement expects %d arguments, %d given", expected_n, bind_n); if (bind_n < expected_n) { break; } } else if (bind_n > 0) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &bind_args, &bind_num) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &bind_args, &bind_num) == FAILURE) { return; } } @@ -1191,7 +1191,7 @@ PHP_FUNCTION(ibase_query) } } while (0); - _php_ibase_free_query(&ib_query TSRMLS_CC); + _php_ibase_free_query(&ib_query); } /* }}} */ @@ -1206,7 +1206,7 @@ PHP_FUNCTION(ibase_affected_rows) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) { return; } @@ -1264,14 +1264,14 @@ PHP_FUNCTION(ibase_num_rows) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result_arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ib_result, ibase_result *, &result_arg, -1, LE_RESULT, le_result); if (isc_dsql_sql_info(IB_STATUS, &ib_result->stmt, sizeof(info_count), info_count, sizeof(result), result)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); RETURN_FALSE; } @@ -1291,7 +1291,7 @@ PHP_FUNCTION(ibase_num_rows) /* }}} */ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ */ - int scale, int flag TSRMLS_DC) + int scale, int flag) { static ISC_INT64 const scales[] = { 1, 10, 100, 1000, 10000, @@ -1423,7 +1423,7 @@ format_date_time: /* }}} */ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_size, /* {{{ */ - ibase_array *ib_array, int dim, int flag TSRMLS_DC) + ibase_array *ib_array, int dim, int flag) { /** * Create multidimension array - recursion function @@ -1444,7 +1444,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz /* recursion here */ if (FAILURE == _php_ibase_arr_zval(&slice_zval, data, slice_size, ib_array, dim + 1, - flag TSRMLS_CC)) { + flag)) { return FAILURE; } data += slice_size; @@ -1454,7 +1454,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz } else { /* data at last */ if (FAILURE == _php_ibase_var_zval(ar_zval, data, ib_array->el_type, - ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag TSRMLS_CC)) { + ib_array->ar_desc.array_desc_length, ib_array->ar_desc.array_desc_scale, flag)) { return FAILURE; } @@ -1478,7 +1478,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &result_arg, &flag)) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &result_arg, &flag)) { return; } @@ -1492,7 +1492,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) if (isc_dsql_fetch(IB_STATUS, &ib_result->stmt, 1, ib_result->out_sqlda)) { ib_result->has_more_rows = 0; if (IB_STATUS[0] && IB_STATUS[1]) { /* error in fetch */ - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); } RETURN_FALSE; } @@ -1537,7 +1537,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) default: _php_ibase_var_zval(&result, var->sqldata, var->sqltype, var->sqllen, - var->sqlscale, flag TSRMLS_CC); + var->sqlscale, flag); break; case SQL_BLOB: if (flag & PHP_IBASE_FETCH_BLOBS) { /* fetch blob contents into hash */ @@ -1553,13 +1553,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) if (isc_open_blob(IB_STATUS, &ib_result->link->handle, &ib_result->trans->handle, &blob_handle.bl_handle, &blob_handle.bl_qd)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_fetch_error; } if (isc_blob_info(IB_STATUS, &blob_handle.bl_handle, sizeof(bl_items), bl_items, sizeof(bl_info), bl_info)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_fetch_error; } @@ -1572,7 +1572,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) item == isc_info_error || i >= sizeof(bl_info)) { _php_ibase_module_error("Could not determine BLOB size (internal error)" - TSRMLS_CC); + ); goto _php_ibase_fetch_error; } @@ -1588,12 +1588,12 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) if (max_len == 0) { ZVAL_STRING(&result, ""); } else if (SUCCESS != _php_ibase_blob_get(&result, &blob_handle, - max_len TSRMLS_CC)) { + max_len)) { goto _php_ibase_fetch_error; } if (isc_close_blob(IB_STATUS, &blob_handle.bl_handle)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); goto _php_ibase_fetch_error; } @@ -1614,13 +1614,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) if (isc_array_get_slice(IB_STATUS, &ib_result->link->handle, &ib_result->trans->handle, &ar_qd, &ib_array->ar_desc, ar_data, &ib_array->ar_size)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); efree(ar_data); goto _php_ibase_fetch_error; } if (FAILURE == _php_ibase_arr_zval(&result, ar_data, ib_array->ar_size, ib_array, - 0, flag TSRMLS_CC)) { + 0, flag)) { efree(ar_data); goto _php_ibase_fetch_error; } @@ -1694,14 +1694,14 @@ PHP_FUNCTION(ibase_name_result) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &result_arg, &name_arg, &name_arg_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); if (isc_dsql_set_cursor_name(IB_STATUS, &ib_result->stmt, name_arg, 0)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); RETURN_FALSE; } RETURN_TRUE; @@ -1718,7 +1718,7 @@ PHP_FUNCTION(ibase_free_result) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result_arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result_arg) == FAILURE) { return; } @@ -1742,12 +1742,12 @@ PHP_FUNCTION(ibase_prepare) RESET_ERRMSG; if (ZEND_NUM_ARGS() == 1) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &query, &query_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, NULL, IBG(default_link), LE_LINK, le_link, le_plink); } else if (ZEND_NUM_ARGS() == 2) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs", &link_arg, &query, &query_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rs", &link_arg, &query, &query_len) == FAILURE) { return; } _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAM_PASSTHRU, link_arg, &ib_link, &trans); @@ -1756,7 +1756,7 @@ PHP_FUNCTION(ibase_prepare) trans_res_id = Z_RES_P(link_arg)->handle; } } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrs", &link_arg, &trans_arg, &query, &query_len) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rrs", &link_arg, &trans_arg, &query, &query_len) == FAILURE) { return; } ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, -1, LE_LINK, le_link, le_plink); @@ -1764,13 +1764,13 @@ PHP_FUNCTION(ibase_prepare) trans_res_id = Z_RES_P(trans_arg)->handle; } - if (FAILURE == _php_ibase_def_trans(ib_link, &trans TSRMLS_CC)) { + if (FAILURE == _php_ibase_def_trans(ib_link, &trans)) { RETURN_FALSE; } ib_query = (ibase_query *) emalloc(sizeof(ibase_query)); - if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, trans_res_id TSRMLS_CC)) { + if (FAILURE == _php_ibase_alloc_query(ib_query, ib_link, trans, query, ib_link->dialect, trans_res_id)) { efree(ib_query); RETURN_FALSE; } @@ -1792,7 +1792,7 @@ PHP_FUNCTION(ibase_execute) RETVAL_FALSE; - if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r*", &query, &args, &bind_n)) { + if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|r*", &query, &args, &bind_n)) { return; } @@ -1802,7 +1802,7 @@ PHP_FUNCTION(ibase_execute) int expected_n = ib_query->in_sqlda ? ib_query->in_sqlda->sqld : 0; if (bind_n != expected_n) { - php_error_docref(NULL TSRMLS_CC, (bind_n < expected_n) ? E_WARNING : E_NOTICE, + php_error_docref(NULL, (bind_n < expected_n) ? E_WARNING : E_NOTICE, "Statement expects %d arguments, %d given", expected_n, bind_n); if (bind_n < expected_n) { @@ -1818,7 +1818,7 @@ PHP_FUNCTION(ibase_execute) IBDEBUG("Implicitly closing a cursor"); if (isc_dsql_free_statement(IB_STATUS, &ib_query->stmt, DSQL_close)) { - _php_ibase_error(TSRMLS_C); + _php_ibase_error(); break; } /* invalidate previous results returned by this query (not necessary for exec proc) */ @@ -1846,7 +1846,7 @@ PHP_FUNCTION(ibase_execute) result->stmt = NULL; } - ret = zend_list_insert(result, le_result TSRMLS_CC); + ret = zend_list_insert(result, le_result); ib_query->result_res_id = Z_RES_HANDLE_P(ret); ZVAL_COPY_VALUE(return_value, ret); Z_ADDREF_P(return_value); @@ -1865,7 +1865,7 @@ PHP_FUNCTION(ibase_free_query) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &query_arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &query_arg) == FAILURE) { return; } @@ -1885,7 +1885,7 @@ PHP_FUNCTION(ibase_num_fields) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) { return; } @@ -2009,7 +2009,7 @@ PHP_FUNCTION(ibase_field_info) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result_arg, &field_arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result_arg, &field_arg) == FAILURE) { return; } @@ -2028,7 +2028,7 @@ PHP_FUNCTION(ibase_field_info) } if (sqlda == NULL) { - _php_ibase_module_error("Trying to get field info from a non-select query" TSRMLS_CC); + _php_ibase_module_error("Trying to get field info from a non-select query"); RETURN_FALSE; } @@ -2048,7 +2048,7 @@ PHP_FUNCTION(ibase_num_params) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &result) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &result) == FAILURE) { return; } @@ -2072,7 +2072,7 @@ PHP_FUNCTION(ibase_param_info) RESET_ERRMSG; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &result_arg, &field_arg) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &result_arg, &field_arg) == FAILURE) { return; } |