diff options
author | Stanislav Malyshev <stas@php.net> | 2015-01-03 01:22:58 -0800 |
---|---|---|
committer | Stanislav Malyshev <stas@php.net> | 2015-01-10 15:07:38 -0800 |
commit | b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc (patch) | |
tree | 0e09490075ee4f9a75a77ef4168d8ee254c52e5b /ext/interbase | |
parent | 773c8b0c092a0e9ad5c5548815bcb9991d54d5c1 (diff) | |
download | php-git-b7a7b1a624c97945c0aaa49d46ae996fc0bdb6bc.tar.gz |
trailing whitespace removal
Diffstat (limited to 'ext/interbase')
-rw-r--r-- | ext/interbase/ibase_blobs.c | 2 | ||||
-rw-r--r-- | ext/interbase/ibase_events.c | 6 | ||||
-rw-r--r-- | ext/interbase/ibase_query.c | 172 | ||||
-rw-r--r-- | ext/interbase/ibase_service.c | 14 | ||||
-rw-r--r-- | ext/interbase/interbase.c | 126 | ||||
-rw-r--r-- | ext/interbase/php_ibase_udf.c | 56 |
6 files changed, 188 insertions, 188 deletions
diff --git a/ext/interbase/ibase_blobs.c b/ext/interbase/ibase_blobs.c index a0600d15aa..982dd93462 100644 --- a/ext/interbase/ibase_blobs.c +++ b/ext/interbase/ibase_blobs.c @@ -48,7 +48,7 @@ static void _php_ibase_free_blob(zend_resource *rsrc) /* {{{ */ void php_ibase_blobs_minit(INIT_FUNC_ARGS) /* {{{ */ { - le_blob = zend_register_list_destructors_ex(_php_ibase_free_blob, NULL, + le_blob = zend_register_list_destructors_ex(_php_ibase_free_blob, NULL, "interbase blob", module_number); } /* }}} */ diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c index 72fc18d00f..5653456e62 100644 --- a/ext/interbase/ibase_events.c +++ b/ext/interbase/ibase_events.c @@ -81,7 +81,7 @@ static void _php_ibase_free_event_rsrc(zend_resource *rsrc) /* {{{ */ void php_ibase_events_minit(INIT_FUNC_ARGS) /* {{{ */ { - le_event = zend_register_list_destructors_ex(_php_ibase_free_event_rsrc, NULL, + le_event = zend_register_list_destructors_ex(_php_ibase_free_event_rsrc, NULL, "interbase event", module_number); } /* }}} */ @@ -271,7 +271,7 @@ PHP_FUNCTION(ibase_set_event_handler) int link_res_id, num_args; RESET_ERRMSG; - + /* Minimum and maximum number of arguments allowed */ if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 17) { WRONG_PARAM_COUNT; @@ -301,7 +301,7 @@ PHP_FUNCTION(ibase_set_event_handler) link_res_id = Z_LVAL(args[0]); } else { - /* callback, event_1 [, ... event_15] + /* callback, event_1 [, ... event_15] * No more than 15 events */ if (ZEND_NUM_ARGS() < 2 || ZEND_NUM_ARGS() > 16) { diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c index 95c462e55c..b87b9cd147 100644 --- a/ext/interbase/ibase_query.c +++ b/ext/interbase/ibase_query.c @@ -75,7 +75,7 @@ typedef struct { char vary_string[1]; } IBVARY; -/* sql variables union +/* sql variables union * used for convert and binding input variables */ typedef struct { @@ -124,7 +124,7 @@ static void _php_ibase_free_stmt_handle(ibase_db_link *link, isc_stmt_handle stm char res_buf[8]; IBDEBUG("Dropping statement handle (free_stmt_handle)..."); /* Only free statement if db-connection is still open */ - if (SUCCESS == isc_database_info(IB_STATUS, &link->handle, + 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(); @@ -194,9 +194,9 @@ static void php_ibase_free_query_rsrc(zend_resource *rsrc) /* {{{ */ void php_ibase_query_minit(INIT_FUNC_ARGS) /* {{{ */ { - le_result = zend_register_list_destructors_ex(_php_ibase_free_result, NULL, + le_result = zend_register_list_destructors_ex(_php_ibase_free_result, NULL, "interbase result", module_number); - le_query = zend_register_list_destructors_ex(php_ibase_free_query_rsrc, NULL, + le_query = zend_register_list_destructors_ex(php_ibase_free_query_rsrc, NULL, "interbase query", module_number); } /* }}} */ @@ -275,7 +275,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ case blr_varying2: /** * IB has a strange way of handling VARCHAR arrays. It doesn't store - * the length in the first short, as with VARCHAR fields. It does, + * the length in the first short, as with VARCHAR fields. It does, * however, expect the extra short to be allocated for each element. */ a->el_type = SQL_TEXT; @@ -286,7 +286,7 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ case blr_cstring: case blr_cstring2: /** - * These types are mentioned as array types in the manual, but I + * These types are mentioned as array types in the manual, but I * wouldn't know how to create an array field with any of these * types. I assume these types are not applicable to arrays, and * were mentioned erroneously. @@ -353,12 +353,12 @@ static int _php_ibase_alloc_query(ibase_query *ib_query, ibase_db_link *link, /* } /* find out what kind of statement was prepared */ - if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_type), + if (isc_dsql_sql_info(IB_STATUS, &ib_query->stmt, sizeof(info_type), info_type, sizeof(result), result)) { _php_ibase_error(); goto _php_ibase_alloc_query_error; } - ib_query->statement_type = result[3]; + ib_query->statement_type = result[3]; /* not enough output variables ? */ if (ib_query->out_sqlda->sqld > ib_query->out_sqlda->sqln) { @@ -449,7 +449,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / zend_hash_internal_pointer_reset(Z_ARRVAL_P(val)); } - for (i = 0; i < dim_len; ++i) { + for (i = 0; i < dim_len; ++i) { if (Z_TYPE_P(val) == IS_ARRAY && (subval = zend_hash_get_current_data(Z_ARRVAL_P(val))) == NULL) @@ -517,15 +517,15 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / } if (l > 0) { - *(ISC_INT64 *) buf = (ISC_INT64) (l * pow(10, + *(ISC_INT64 *) buf = (ISC_INT64) (l * pow(10, -array->ar_desc.array_desc_scale) + .5); } else { - *(ISC_INT64 *) buf = (ISC_INT64) (l * pow(10, + *(ISC_INT64 *) buf = (ISC_INT64) (l * pow(10, -array->ar_desc.array_desc_scale) - .5); } } break; - } + } } else { struct tm t = { 0, 0, 0, 0, 0, 0 }; @@ -579,7 +579,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / #ifdef HAVE_STRPTIME strptime(Z_STRVAL_P(val), INI_STR("ibase.timestampformat"), &t); #else - n = sscanf(Z_STRVAL_P(val), "%d%*[/]%d%*[/]%d %d%*[:]%d%*[:]%d", + n = sscanf(Z_STRVAL_P(val), "%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) { @@ -631,7 +631,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / } } return SUCCESS; -} +} /* }}} */ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ @@ -774,7 +774,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ void *array_data = emalloc(ar->ar_size); ISC_QUAD array_id = { 0, 0 }; - if (FAILURE == _php_ibase_bind_array(b_var, array_data, ar->ar_size, + if (FAILURE == _php_ibase_bind_array(b_var, array_data, ar->ar_size, ar, 0)) { _php_ibase_module_error("Parameter %d: failed to bind array argument" TSRMLS_CC,i+1); @@ -783,7 +783,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ continue; } - if (isc_array_put_slice(IB_STATUS, &ib_query->link->handle, &ib_query->trans->handle, + 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(); efree(array_data); @@ -791,7 +791,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval *b_vars, BIND_BUF *buf, /* {{{ */ } buf[i].val.qval = array_id; efree(array_data); - } + } ++array_cnt; continue; } /* switch */ @@ -869,7 +869,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul char result[64]; ISC_STATUS isc_result; int argc = ib_query->in_sqlda ? ib_query->in_sqlda->sqld : 0; - + RESET_ERRMSG; for (i = 0; i < argc; ++i) { @@ -886,7 +886,7 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul /* a SET TRANSACTION statement should be executed with a NULL trans handle */ tr = NULL; - if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &tr, 0, + if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, &tr, 0, ib_query->query, ib_query->dialect, NULL)) { _php_ibase_error(); goto _php_ibase_exec_error; @@ -918,14 +918,14 @@ static int _php_ibase_exec(INTERNAL_FUNCTION_PARAMETERS, ibase_result **ib_resul case isc_info_sql_stmt_commit: case isc_info_sql_stmt_rollback: - if (isc_dsql_execute_immediate(IB_STATUS, &ib_query->link->handle, + 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(); goto _php_ibase_exec_error; } if (ib_query->trans->handle == NULL && ib_query->trans_res_id != 0) { - /* transaction was released by the query and was a registered resource, + /* transaction was released by the query and was a registered resource, so we have to release it */ zval *res = zend_hash_index_find(&EG(regular_list), ib_query->trans_res_id); zend_list_delete(Z_RES_P(res)); @@ -1070,7 +1070,7 @@ PHP_FUNCTION(ibase_query) ibase_result *result = NULL; RESET_ERRMSG; - + RETVAL_FALSE; switch (ZEND_NUM_ARGS()) { @@ -1082,7 +1082,7 @@ PHP_FUNCTION(ibase_query) ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link*, zlink, -1, LE_LINK, le_link, le_plink); ZEND_FETCH_RESOURCE(trans, ibase_trans*, ztrans, -1, LE_TRANS, le_trans); - + trans_res_id = Z_RES_P(ztrans)->handle; bind_i = 3; break; @@ -1091,7 +1091,7 @@ PHP_FUNCTION(ibase_query) 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); - + if (trans != NULL) { trans_res_id = Z_RES_P(zlink)->handle; } @@ -1113,7 +1113,7 @@ PHP_FUNCTION(ibase_query) _php_ibase_module_error("CREATE DATABASE is not allowed: maximum link count " "(%ld) reached", l); - } else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len, + } else if (isc_dsql_execute_immediate(IB_STATUS, &db, &trans, (short)query_len, query, SQL_DIALECT_CURRENT, NULL)) { _php_ibase_error(); @@ -1123,7 +1123,7 @@ PHP_FUNCTION(ibase_query) } else { - /* register the link as a resource; unfortunately, we cannot register + /* register the link as a resource; unfortunately, we cannot register it in the hash table, because we don't know the connection params */ ib_link = (ibase_db_link *) emalloc(sizeof(ibase_db_link)); ib_link->handle = db; @@ -1137,10 +1137,10 @@ PHP_FUNCTION(ibase_query) ++IBG(num_links); } return; - } + } case 1: case 0: - if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() ? 1 : 0, "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,7 +1152,7 @@ PHP_FUNCTION(ibase_query) } /* open default transaction */ - if (ib_link == NULL || FAILURE == _php_ibase_def_trans(ib_link, &trans) + 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)) { return; @@ -1161,26 +1161,26 @@ PHP_FUNCTION(ibase_query) do { int bind_n = ZEND_NUM_ARGS() - bind_i, expected_n = ib_query.in_sqlda ? ib_query.in_sqlda->sqld : 0; - + if (bind_n != expected_n) { 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) { + } else if (bind_n > 0) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "+", &bind_args, &bind_num) == FAILURE) { return; } } - - if (FAILURE == _php_ibase_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, &result, &ib_query, + + if (FAILURE == _php_ibase_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, &result, &ib_query, &bind_args[bind_i])) { break; } if (result != NULL) { /* statement returns a result */ - result->type = QUERY_RESULT; + result->type = QUERY_RESULT; /* EXECUTE PROCEDURE returns only one row => statement can be released immediately */ if (ib_query.statement_type != isc_info_sql_stmt_exec_procedure) { @@ -1203,9 +1203,9 @@ PHP_FUNCTION(ibase_affected_rows) ibase_trans *trans = NULL; ibase_db_link *ib_link; zval *arg = NULL; - + RESET_ERRMSG; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) { return; } @@ -1232,28 +1232,28 @@ PHP_FUNCTION(ibase_affected_rows) } /* }}} */ -/* {{{ proto int ibase_num_rows( resource result_identifier ) +/* {{{ proto int ibase_num_rows( resource result_identifier ) Return the number of rows that are available in a result */ #if abies_0 -PHP_FUNCTION(ibase_num_rows) +PHP_FUNCTION(ibase_num_rows) { /** * As this function relies on the InterBase API function isc_dsql_sql_info() - * which has a couple of limitations (which I hope will be fixed in future + * which has a couple of limitations (which I hope will be fixed in future * releases of Firebird), this function is fairly useless. I'm leaving it - * in place for people who can live with the limitations, which I only + * in place for people who can live with the limitations, which I only * found out about after I had implemented it anyway. * * Currently, there's no way to determine how many rows can be fetched from * a cursor. The only number that _can_ be determined is the number of rows - * that have already been pre-fetched by the client library. + * that have already been pre-fetched by the client library. * This implies the following: * - num_rows() always returns zero before the first fetch; * - num_rows() for SELECT ... FOR UPDATE is broken -> never returns a * higher number than the number of records fetched so far (no pre-fetch); - * - the result of num_rows() for other statements is merely a lower bound + * - the result of num_rows() for other statements is merely a lower bound * on the number of records => calling ibase_num_rows() again after a couple - * of fetches will most likely return a new (higher) figure for large result + * of fetches will most likely return a new (higher) figure for large result * sets. */ @@ -1285,7 +1285,7 @@ PHP_FUNCTION(ibase_num_rows) } i += len+3; } - } + } } #endif /* }}} */ @@ -1293,21 +1293,21 @@ PHP_FUNCTION(ibase_num_rows) static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ */ int scale, int flag) { - static ISC_INT64 const scales[] = { 1, 10, 100, 1000, - 10000, - 100000, - 1000000, + static ISC_INT64 const scales[] = { 1, 10, 100, 1000, + 10000, + 100000, + 1000000, 10000000, - 100000000, - 1000000000, - LL_LIT(10000000000), + 100000000, + 1000000000, + LL_LIT(10000000000), LL_LIT(100000000000), - LL_LIT(1000000000000), - LL_LIT(10000000000000), + LL_LIT(1000000000000), + LL_LIT(10000000000000), LL_LIT(100000000000000), LL_LIT(1000000000000000), - LL_LIT(10000000000000000), - LL_LIT(100000000000000000), + LL_LIT(10000000000000000), + LL_LIT(100000000000000000), LL_LIT(1000000000000000000) }; @@ -1342,7 +1342,7 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ if (n >= 0) { l = slprintf(string_data, sizeof(string_data), "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, n % f); } else if (n <= -f) { - l = slprintf(string_data, sizeof(string_data), "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, -n % f); + l = slprintf(string_data, sizeof(string_data), "%" LL_MASK "d.%0*" LL_MASK "d", n / f, -scale, -n % f); } else { l = slprintf(string_data, sizeof(string_data), "-0.%0*" LL_MASK "d", -scale, -n % f); } @@ -1351,7 +1351,7 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ break; #endif case SQL_LONG: - n = *(ISC_LONG *) data; + n = *(ISC_LONG *) data; _sql_long: if (scale == 0) { ZVAL_LONG(val,n); @@ -1403,7 +1403,7 @@ format_date_time: #else switch (type & ~1) { default: - l = slprintf(string_data, sizeof(string_data), "%02d/%02d/%4d %02d:%02d:%02d", t.tm_mon+1, t.tm_mday, + l = slprintf(string_data, sizeof(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); break; case SQL_TYPE_DATE: @@ -1428,7 +1428,7 @@ static int _php_ibase_arr_zval(zval *ar_zval, char *data, unsigned long data_siz /** * Create multidimension array - recursion function */ - int + int u_bound = ib_array->ar_desc.array_desc_bounds[dim].array_bound_upper, l_bound = ib_array->ar_desc.array_desc_bounds[dim].array_bound_lower, dim_len = 1 + u_bound - l_bound; @@ -1498,32 +1498,32 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) } } else { ib_result->has_more_rows = 0; - } + } array_init(return_value); for (i = 0; i < ib_result->out_sqlda->sqld; ++i) { XSQLVAR *var = &ib_result->out_sqlda->sqlvar[i]; char buf[METADATALENGTH+4], *alias = var->aliasname; - + if (! (fetch_type & FETCH_ROW)) { int i = 0; char const *base = "FIELD"; /* use 'FIELD' if name is empty */ - + /** - * Ensure no two columns have identical names: + * Ensure no two columns have identical names: * keep generating new names until we find one that is unique. */ switch (*alias) { void *p; - + default: i = 1; base = alias; - + while ((p = zend_symtable_str_find_ptr( Z_ARRVAL_P(return_value), alias, strlen(alias))) != NULL) { - + case '\0': snprintf(alias = buf, sizeof(buf), "%s_%02d", base, i++); } @@ -1568,13 +1568,13 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) unsigned short item_len; char item = bl_info[i++]; - if (item == isc_info_end || item == isc_info_truncated || + if (item == isc_info_end || item == isc_info_truncated || item == isc_info_error || i >= sizeof(bl_info)) { _php_ibase_module_error("Could not determine BLOB size (internal error)" ); goto _php_ibase_fetch_error; - } + } item_len = (unsigned short) isc_vax_integer(&bl_info[i], 2); @@ -1587,7 +1587,7 @@ 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, + } else if (SUCCESS != _php_ibase_blob_get(&result, &blob_handle, max_len)) { goto _php_ibase_fetch_error; } @@ -1611,7 +1611,7 @@ static void _php_ibase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int fetch_type) ibase_array *ib_array = &ib_result->out_array[array_cnt++]; void *ar_data = emalloc(ib_array->ar_size); - if (isc_array_get_slice(IB_STATUS, &ib_result->link->handle, + 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(); @@ -1740,7 +1740,7 @@ PHP_FUNCTION(ibase_prepare) char *query; RESET_ERRMSG; - + if (ZEND_NUM_ARGS() == 1) { if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &query, &query_len) == FAILURE) { return; @@ -1789,7 +1789,7 @@ PHP_FUNCTION(ibase_execute) int bind_n = 0; RESET_ERRMSG; - + RETVAL_FALSE; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS(), "|r*", &query, &args, &bind_n)) { @@ -1811,7 +1811,7 @@ PHP_FUNCTION(ibase_execute) } /* Have we used this cursor before and it's still open (exec proc has no cursor) ? */ - if (ib_query->result_res_id != 0 + if (ib_query->result_res_id != 0 && ib_query->statement_type != isc_info_sql_stmt_exec_procedure) { zval *res; @@ -1828,7 +1828,7 @@ PHP_FUNCTION(ibase_execute) } } - if (FAILURE == _php_ibase_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, &result, ib_query, + if (FAILURE == _php_ibase_exec(INTERNAL_FUNCTION_PARAM_PASSTHRU, &result, ib_query, args)) { break; } @@ -1837,7 +1837,7 @@ PHP_FUNCTION(ibase_execute) if (ib_query->trans->handle == NULL) { zend_list_delete(Z_RES_P(query)); } - + if (result != NULL) { zval *ret; @@ -1952,36 +1952,36 @@ static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */ } else { switch (var->sqltype & ~1) { case SQL_TEXT: - s = "CHAR"; + s = "CHAR"; break; case SQL_VARYING: - s = "VARCHAR"; + s = "VARCHAR"; break; case SQL_SHORT: - s = "SMALLINT"; + s = "SMALLINT"; break; case SQL_LONG: - s = "INTEGER"; + s = "INTEGER"; break; case SQL_FLOAT: s = "FLOAT"; break; case SQL_DOUBLE: case SQL_D_FLOAT: s = "DOUBLE PRECISION"; break; - case SQL_INT64: - s = "BIGINT"; + case SQL_INT64: + s = "BIGINT"; break; - case SQL_TIMESTAMP: - s = "TIMESTAMP"; + case SQL_TIMESTAMP: + s = "TIMESTAMP"; break; case SQL_TYPE_DATE: s = "DATE"; break; case SQL_TYPE_TIME: - s = "TIME"; + s = "TIME"; break; case SQL_BLOB: - s = "BLOB"; + s = "BLOB"; break; case SQL_ARRAY: s = "ARRAY"; @@ -2025,7 +2025,7 @@ PHP_FUNCTION(ibase_field_info) ZEND_FETCH_RESOURCE(ib_result, ibase_result *, result_arg, -1, LE_RESULT, le_result); sqlda = ib_result->out_sqlda; - } + } if (sqlda == NULL) { _php_ibase_module_error("Trying to get field info from a non-select query"); diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c index 04125cf2aa..9f32525393 100644 --- a/ext/interbase/ibase_service.c +++ b/ext/interbase/ibase_service.c @@ -55,15 +55,15 @@ static void _php_ibase_free_service(zend_resource *rsrc) /* {{{ */ } /* }}} */ -/* the svc api seems to get confused after an error has occurred, +/* the svc api seems to get confused after an error has occurred, so invalidate the handle on errors */ #define IBASE_SVC_ERROR(svm) \ do { zend_list_delete(svm->res); _php_ibase_error(); } while (0) - + void php_ibase_service_minit(INIT_FUNC_ARGS) /* {{{ */ { - le_service = zend_register_list_destructors_ex(_php_ibase_free_service, NULL, + le_service = zend_register_list_destructors_ex(_php_ibase_free_service, NULL, "interbase service manager handle", module_number); /* backup options */ @@ -134,7 +134,7 @@ void php_ibase_service_minit(INIT_FUNC_ARGS) /* {{{ */ static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, char operation) /* {{{ */ { /* user = 0, password = 1, first_name = 2, middle_name = 3, last_name = 4 */ - static char const user_flags[] = { isc_spb_sec_username, isc_spb_sec_password, + static char const user_flags[] = { isc_spb_sec_username, isc_spb_sec_password, isc_spb_sec_firstname, isc_spb_sec_middlename, isc_spb_sec_lastname }; char buf[128], *args[] = { NULL, NULL, NULL, NULL, NULL }; int i, args_len[] = { 0, 0, 0, 0, 0 }; @@ -150,17 +150,17 @@ static void _php_ibase_user(INTERNAL_FUNCTION_PARAMETERS, char operation) /* {{{ &args[3], &args_len[3], &args[4], &args_len[4])) { RETURN_FALSE; } - + ZEND_FETCH_RESOURCE(svm, ibase_service *, res, -1, "Interbase service manager handle", le_service); buf[0] = operation; - + for (i = 0; i < sizeof(user_flags); ++i) { if (args[i] != NULL) { int chunk = slprintf(&buf[spb_len], sizeof(buf) - spb_len, "%c%c%c%s", user_flags[i], (char)args_len[i], (char)(args_len[i] >> 8), args[i]); - + if ((spb_len + chunk) > sizeof(buf) || chunk <= 0) { _php_ibase_module_error("Internal error: insufficient buffer space for SPB (%d)" TSRMLS_CC, spb_len); diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index a91bc320cf..8599bdf900 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -470,7 +470,7 @@ int le_link, le_plink, le_trans; /* error handling ---------------------------- */ -/* {{{ proto string ibase_errmsg(void) +/* {{{ proto string ibase_errmsg(void) Return error message */ PHP_FUNCTION(ibase_errmsg) { @@ -486,7 +486,7 @@ PHP_FUNCTION(ibase_errmsg) } /* }}} */ -/* {{{ proto int ibase_errcode(void) +/* {{{ proto int ibase_errcode(void) Return error code */ PHP_FUNCTION(ibase_errcode) { @@ -508,7 +508,7 @@ void _php_ibase_error(void) /* {{{ */ ISC_STATUS *statusp = IB_STATUS; IBG(sql_code) = isc_sqlcode(IB_STATUS); - + while ((s - IBG(errmsg)) < MAX_ERRMSG - (IBASE_MSGSIZE + 2) && isc_interprete(s, &statusp)) { strcat(IBG(errmsg), " "); s = IBG(errmsg) + strlen(IBG(errmsg)); @@ -554,7 +554,7 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */ { IBDEBUG("Transaction or database link?"); if (Z_RES_P(link_id)->type == le_trans) { - /* Transaction resource: make sure it refers to one link only, then + /* Transaction resource: make sure it refers to one link only, then fetch it; database link is stored in ib_trans->db_link[]. */ IBDEBUG("Type is le_trans"); ZEND_FETCH_RESOURCE(*trans, ibase_trans *, link_id, -1, LE_TRANS, le_trans); @@ -562,16 +562,16 @@ void _php_ibase_get_link_trans(INTERNAL_FUNCTION_PARAMETERS, /* {{{ */ _php_ibase_module_error("Link id is ambiguous: transaction spans multiple connections." ); return; - } + } *ib_link = (*trans)->db_link[0]; return; - } + } IBDEBUG("Type is le_[p]link or id not found"); /* Database link resource, use default transaction. */ *trans = NULL; ZEND_FETCH_RESOURCE2(*ib_link, ibase_db_link *, link_id, -1, LE_LINK, le_link, le_plink); } -/* }}} */ +/* }}} */ /* destructors ---------------------- */ @@ -594,7 +594,7 @@ static void _php_ibase_commit_link(ibase_db_link *link) /* {{{ */ } efree(p->trans); /* default transaction is not a registered resource: clean up */ } else { - if (p->trans->handle != NULL) { + if (p->trans->handle != NULL) { /* non-default trans might have been rolled back by other call of this dtor */ IBDEBUG("Rolling back other transactions..."); if (isc_rollback_transaction(IB_STATUS, &p->trans->handle)) { @@ -614,7 +614,7 @@ static void _php_ibase_commit_link(ibase_db_link *link) /* {{{ */ efree(p); } link->tr_list = NULL; - + for (e = link->event_head; e; e = e->event_next) { _php_ibase_free_event(e); e->link = NULL; @@ -664,7 +664,7 @@ static void _php_ibase_free_trans(zend_resource *rsrc) /* {{{ */ { ibase_trans *trans = (ibase_trans *)rsrc->ptr; unsigned short i; - + IBDEBUG("Cleaning up transaction resource..."); if (trans->handle != NULL) { IBDEBUG("Rolling back unhandled transaction..."); @@ -695,7 +695,7 @@ static void _php_ibase_free_trans(zend_resource *rsrc) /* {{{ */ static PHP_INI_DISP(php_ibase_password_displayer_cb) { - if ((type == PHP_INI_DISPLAY_ORIG && ini_entry->orig_value) + if ((type == PHP_INI_DISPLAY_ORIG && ini_entry->orig_value) || (type == PHP_INI_DISPLAY_ACTIVE && ini_entry->value)) { PUTS("********"); } else if (!sapi_module.phpinfo_as_text) { @@ -756,22 +756,22 @@ PHP_MINIT_FUNCTION(ibase) php_ibase_blobs_minit(INIT_FUNC_ARGS_PASSTHRU); php_ibase_events_minit(INIT_FUNC_ARGS_PASSTHRU); php_ibase_service_minit(INIT_FUNC_ARGS_PASSTHRU); - - return SUCCESS; -} - + + return SUCCESS; +} + PHP_MSHUTDOWN_FUNCTION(ibase) { #ifndef PHP_WIN32 /** - * When the Interbase client API library libgds.so is first loaded, it registers a call to + * When the Interbase client API library libgds.so is first loaded, it registers a call to * gds__cleanup() with atexit(), in order to clean up after itself when the process exits. * This means that the library is called at process shutdown, and cannot be unloaded beforehand. - * PHP tries to unload modules after every request [dl()'ed modules], and right before the + * PHP tries to unload modules after every request [dl()'ed modules], and right before the * process shuts down [modules loaded from php.ini]. This results in a segfault for this module. * By NULLing the dlopen() handle in the module entry, Zend omits the call to dlclose(), * ensuring that the module will remain present until the process exits. However, the functions - * and classes exported by the module will not be available until the module is 'reloaded'. + * and classes exported by the module will not be available until the module is 'reloaded'. * When reloaded, dlopen() will return the handle of the already loaded module. The module will * be unloaded automatically when the process exits. */ @@ -793,14 +793,14 @@ PHP_RSHUTDOWN_FUNCTION(ibase) RESET_ERRMSG; return SUCCESS; -} - +} + PHP_MINFO_FUNCTION(ibase) { char tmp[64], *s; php_info_print_table_start(); - php_info_print_table_row(2, "Firebird/InterBase Support", + php_info_print_table_row(2, "Firebird/InterBase Support", #ifdef COMPILE_DL_INTERBASE "dynamic"); #else @@ -832,7 +832,7 @@ PHP_MINFO_FUNCTION(ibase) } php_info_print_table_row(2, "Run-time Client Library Version", s); } while (0); -#endif +#endif php_info_print_table_end(); DISPLAY_INI_ENTRIES(); @@ -841,11 +841,11 @@ PHP_MINFO_FUNCTION(ibase) /* }}} */ enum connect_args { DB = 0, USER = 1, PASS = 2, CSET = 3, ROLE = 4, BUF = 0, DLECT = 1, SYNC = 2 }; - -static char const dpb_args[] = { + +static char const dpb_args[] = { 0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name, 0 }; - + int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db) { short i, dpb_len, buf_len = 257-2; /* version byte at the front, and a null at the end */ @@ -861,7 +861,7 @@ int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db) } } if (largs[BUF] && buf_len > 0) { - dpb_len = slprintf(dpb, buf_len, "%c\2%c%c", isc_dpb_num_buffers, + dpb_len = slprintf(dpb, buf_len, "%c\2%c%c", isc_dpb_num_buffers, (char)(largs[BUF] >> 8), (char)(largs[BUF] & 0xff)); dpb += dpb_len; buf_len -= dpb_len; @@ -897,9 +897,9 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* &largs[SYNC])) { RETURN_FALSE; } - + /* restrict to the server/db in the .ini if in safe mode */ - if ((!len[DB] || PG(sql_safe_mode)) && (c = INI_STR("ibase.default_db"))) { + if ((!len[DB] || PG(sql_safe_mode)) && (c = INI_STR("ibase.default_db"))) { args[DB] = c; len[DB] = strlen(c); } @@ -915,7 +915,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* args[CSET] = c; len[CSET] = strlen(c); } - + /* don't want usernames and passwords floating around */ PHP_MD5Init(&hash_context); for (i = 0; i < sizeof(args)/sizeof(char*); ++i) { @@ -925,7 +925,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* PHP_MD5Update(&hash_context,(char*)&largs[i],sizeof(long)); } PHP_MD5Final((unsigned char*)hash, &hash_context); - + /* try to reuse a connection */ if ((le = zend_hash_str_find_ptr(&EG(regular_list), hash, sizeof(hash)-1)) != NULL) { zend_resource *xlink; @@ -933,7 +933,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* if (le->type != le_index_ptr) { RETURN_FALSE; } - + xlink = (zend_resource*) le->ptr; if ((!persistent && xlink->type == le_link) || xlink->type == le_plink) { if (IBG(default_link) > 0) { @@ -949,7 +949,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* } else { zend_hash_str_del(&EG(regular_list), hash, sizeof(hash)-1); } - } + } /* ... or a persistent one */ do { @@ -972,17 +972,17 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* } /* no link found, so we have to open one */ - + if ((l = INI_INT("ibase.max_links")) != -1 && IBG(num_links) >= l) { _php_ibase_module_error("Too many open links (%ld)", IBG(num_links)); RETURN_FALSE; } - + /* create the ib_link */ if (FAILURE == _php_ibase_attach_db(args, len, largs, &db_handle)) { RETURN_FALSE; } - + /* use non-persistent if allowed number of persistent links is exceeded */ if (!persistent || ((l = INI_INT("ibase.max_persistent") != -1) && IBG(num_persistent) >= l)) { ib_link = (ibase_db_link *) emalloc(sizeof(ibase_db_link)); @@ -1010,7 +1010,7 @@ static void _php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* ib_link->dialect = largs[DLECT] ? (unsigned short)largs[DLECT] : SQL_DIALECT_CURRENT; ib_link->tr_list = NULL; ib_link->event_head = NULL; - + ++IBG(num_links); } while (0); @@ -1058,11 +1058,11 @@ PHP_FUNCTION(ibase_close) int link_id; RESET_ERRMSG; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link_arg) == FAILURE) { return; } - + if (ZEND_NUM_ARGS() == 0) { link_id = IBG(default_link); CHECK_LINK(link_id); @@ -1096,11 +1096,11 @@ PHP_FUNCTION(ibase_drop_db) int link_id; RESET_ERRMSG; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &link_arg) == FAILURE) { return; } - + if (ZEND_NUM_ARGS() == 0) { link_id = IBG(default_link); CHECK_LINK(link_id); @@ -1108,7 +1108,7 @@ PHP_FUNCTION(ibase_drop_db) } else { link_id = Z_RES_P(link_arg)->handle; } - + ZEND_FETCH_RESOURCE2(ib_link, ibase_db_link *, link_arg, link_id, LE_LINK, le_link, le_plink); if (isc_drop_database(IB_STATUS, &ib_link->handle)) { @@ -1144,14 +1144,14 @@ PHP_FUNCTION(ibase_trans) ibase_trans *ib_trans; isc_tr_handle tr_handle = NULL; ISC_STATUS result; - + RESET_ERRMSG; argn = ZEND_NUM_ARGS(); /* (1+argn) is an upper bound for the number of links this trans connects to */ ib_link = (ibase_db_link **) safe_emalloc(sizeof(ibase_db_link *),1+argn,0); - + if (argn > 0) { long trans_argl = 0; char *tpb; @@ -1166,19 +1166,19 @@ PHP_FUNCTION(ibase_trans) teb = (ISC_TEB *) safe_emalloc(sizeof(ISC_TEB),argn,0); tpb = (char *) safe_emalloc(TPB_MAX_SIZE,argn,0); - /* enumerate all the arguments: assume every non-resource argument + /* enumerate all the arguments: assume every non-resource argument specifies modifiers for the link ids that follow it */ for (i = 0; i < argn; ++i) { - + if (Z_TYPE(args[i]) == IS_RESOURCE) { - + if (!ZEND_FETCH_RESOURCE2_NO_RETURN(ib_link[link_cnt], ibase_db_link *, &args[i], -1, LE_LINK, le_link, le_plink)) { efree(teb); efree(tpb); efree(ib_link); RETURN_FALSE; } - + /* copy the most recent modifier string into tbp[] */ memcpy(&tpb[TPB_MAX_SIZE * link_cnt], last_tpb, TPB_MAX_SIZE); @@ -1186,11 +1186,11 @@ PHP_FUNCTION(ibase_trans) teb[link_cnt].db_ptr = &ib_link[link_cnt]->handle; teb[link_cnt].tpb_len = tpb_len; teb[link_cnt].tpb_ptr = &tpb[TPB_MAX_SIZE * link_cnt]; - + ++link_cnt; - + } else { - + tpb_len = 0; convert_to_long_ex(&args[i]); @@ -1212,14 +1212,14 @@ PHP_FUNCTION(ibase_trans) if (PHP_IBASE_REC_VERSION == (trans_argl & PHP_IBASE_REC_VERSION)) { last_tpb[tpb_len++] = isc_tpb_rec_version; } else if (PHP_IBASE_REC_NO_VERSION == (trans_argl & PHP_IBASE_REC_NO_VERSION)) { - last_tpb[tpb_len++] = isc_tpb_no_rec_version; - } + last_tpb[tpb_len++] = isc_tpb_no_rec_version; + } } else if (PHP_IBASE_CONSISTENCY == (trans_argl & PHP_IBASE_CONSISTENCY)) { last_tpb[tpb_len++] = isc_tpb_consistency; } else if (PHP_IBASE_CONCURRENCY == (trans_argl & PHP_IBASE_CONCURRENCY)) { last_tpb[tpb_len++] = isc_tpb_concurrency; } - + /* lock resolution */ if (PHP_IBASE_NOWAIT == (trans_argl & PHP_IBASE_NOWAIT)) { last_tpb[tpb_len++] = isc_tpb_nowait; @@ -1228,8 +1228,8 @@ PHP_FUNCTION(ibase_trans) } } } - } - + } + if (link_cnt > 0) { result = isc_start_multiple(IB_STATUS, &tr_handle, link_cnt, teb); } @@ -1246,7 +1246,7 @@ PHP_FUNCTION(ibase_trans) } result = isc_start_transaction(IB_STATUS, &tr_handle, 1, &ib_link[0]->handle, tpb_len, last_tpb); } - + /* start the transaction */ if (result) { _php_ibase_error(); @@ -1262,7 +1262,7 @@ PHP_FUNCTION(ibase_trans) for (i = 0; i < link_cnt; ++i) { ibase_tr_list **l; ib_trans->db_link[i] = ib_link[i]; - + /* the first item in the connection-transaction list is reserved for the default transaction */ if (ib_link[i]->tr_list == NULL) { ib_link[i]->tr_list = (ibase_tr_list *) emalloc(sizeof(ibase_tr_list)); @@ -1328,7 +1328,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{ zval *arg = NULL; RESET_ERRMSG; - + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &arg) == FAILURE) { return; } @@ -1372,7 +1372,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{ result = isc_commit_retaining(IB_STATUS, &trans->handle); break; } - + if (result) { _php_ibase_error(); RETURN_FALSE; @@ -1437,20 +1437,20 @@ PHP_FUNCTION(ibase_gen_id) &inc, &link)) { RETURN_FALSE; } - + if (gen_len > 31) { php_error_docref(NULL, E_WARNING, "Invalid generator name"); RETURN_FALSE; } PHP_IBASE_LINK_TRANS(link, ib_link, trans); - + snprintf(query, sizeof(query), "SELECT GEN_ID(%s,%ld) FROM rdb$database", generator, inc); /* allocate a minimal descriptor area */ out_sqlda.sqln = out_sqlda.sqld = 1; out_sqlda.version = SQLDA_CURRENT_VERSION; - + /* allocate the field for the result */ out_sqlda.sqlvar[0].sqltype = SQL_INT64; out_sqlda.sqlvar[0].sqlscale = 0; @@ -1478,7 +1478,7 @@ PHP_FUNCTION(ibase_gen_id) } /* }}} */ - + #endif /* HAVE_IBASE */ /* diff --git a/ext/interbase/php_ibase_udf.c b/ext/interbase/php_ibase_udf.c index bd8ba550d5..8f33db2c99 100644 --- a/ext/interbase/php_ibase_udf.c +++ b/ext/interbase/php_ibase_udf.c @@ -20,27 +20,27 @@ * This UDF library adds the ability to call PHP functions from SQL * statements. Because of SQL's strong typing, you will have to declare * an external function for every combination { output type, #args } that -* your application requires. -* +* your application requires. +* * Declare the functions like this: -* +* * DECLARE EXTERNAL FUNCTION CALL_PHP1 * CSTRING(xx), * <return type> BY DESCRIPTOR, * INTEGER BY DESCRIPTOR * RETURNS PARAMETER 2 * ENTRY_POINT 'udf_call_php1' MODULE_NAME 'php_ibase_udf' -* +* * DECLARE EXTERNAL FUNCTION CALL_PHP2 * CSTRING(xx), -* <return type> BY DESCRIPTOR, +* <return type> BY DESCRIPTOR, * INTEGER BY DESCRIPTOR, * INTEGER BY DESCRIPTOR * RETURNS PARAMETER 2 * ENTRY_POINT 'udf_call_php2' MODULE_NAME 'php_ibase_udf' -* +* * ... and so on. [for up to 8 input arguments] -* +* * The first input parameter contains the name of the PHP function you want * to call. The second argument is the result. (omit this argument when calling * the function) The return type of the function is the declared type of the @@ -49,13 +49,13 @@ * The arguments should have their types declared as well, but you're free * to pass arguments of other types instead. They will be converted to the * best matching PHP type before being passed to the PHP function. -* +* * The declared functions can be called from SQL like: -* +* * SELECT * FROM <table> WHERE CALL_PHP1('soundex',<field>) NOT LIKE ? * or * UPDATE <table> SET <field> = CALL_PHP1('ucwords',<field>) -* +* * Additionally, there's a function 'exec_php' which allows the contents * of text BLOB fields to be parsed and executed by PHP. This is most useful * for declaring functions that can then be called with CALL_PHPx. @@ -80,7 +80,7 @@ * `php-config --libs` -o php_ibase_udf.so php_ibase_udf.c * * If you connect to the classic server by TCP/IP, you should build the -* PHP embedded static library and link against that. +* PHP embedded static library and link against that. * * gcc -shared `php-config --includes` `php-config --ldflags` \ * `php-config --libs` -o php_ibase_udf.so php_ibase_udf.c \ @@ -147,7 +147,7 @@ void exec_php(BLOBCALLBACK b, PARAMDSC *res, ISC_SHORT *init) ISC_USHORT read; for (code[remaining] = '\0'; remaining > 0; remaining -= read) - b->blob_get_segment(b->blob_handle, &code[i++<<16],min(0x10000,remaining), &read); + b->blob_get_segment(b->blob_handle, &code[i++<<16],min(0x10000,remaining), &read); LOCK(); @@ -166,7 +166,7 @@ void exec_php(BLOBCALLBACK b, PARAMDSC *res, ISC_SHORT *init) result = zend_eval_stringl(code, b->blob_total_length, NULL, "Firebird Embedded PHP engine"); } zend_end_try(); } - + UNLOCK(); free(code); @@ -190,14 +190,14 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv) ZVAL_STRING(&callback, name); LOCK(); - + /* check if the requested function exists */ if (!zend_is_callable(&callback, 0, NULL)) { break; } - + UNLOCK(); - + /* create the argument array */ for (i = 0; i < argc; ++i) { @@ -267,17 +267,17 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv) case dtype_sql_date: isc_decode_sql_date((ISC_DATE*)argv[i]->dsc_address, &t); - ZVAL_STRINGL(&args[i], d, strftime(d, sizeof(d), INI_STR("ibase.dateformat"), &t),1); + ZVAL_STRINGL(&args[i], d, strftime(d, sizeof(d), INI_STR("ibase.dateformat"), &t),1); break; case dtype_sql_time: isc_decode_sql_time((ISC_TIME*)argv[i]->dsc_address, &t); - ZVAL_STRINGL(&args[i], d, strftime(d, sizeof(d), INI_STR("ibase.timeformat"), &t),1); + ZVAL_STRINGL(&args[i], d, strftime(d, sizeof(d), INI_STR("ibase.timeformat"), &t),1); break; case dtype_timestamp: isc_decode_timestamp((ISC_TIMESTAMP*)argv[i]->dsc_address, &t); - ZVAL_STRINGL(&args[i], d, strftime(d, sizeof(d), INI_STR("ibase.timestampformat"), &t)); + ZVAL_STRINGL(&args[i], d, strftime(d, sizeof(d), INI_STR("ibase.timestampformat"), &t)); break; } } @@ -290,7 +290,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv) UNLOCK(); break; } - + UNLOCK(); for (i = 0; i < argc; ++i) { @@ -298,7 +298,7 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv) case dtype_sql_date: case dtype_sql_time: case dtype_timestamp: - zval_dtor(&args[i]); + zval_dtor(&args[i]); } } @@ -333,13 +333,13 @@ static void call_php(char *name, PARAMDSC *r, int argc, PARAMDSC **argv) r->dsc_length = res->vary_length+2; break; } - + zval_dtor(&return_value); return; } while (0); - + /** * If we end up here, we should report an error back to the DB engine, but * that's not possible. We can however report it back to PHP. @@ -370,35 +370,35 @@ void udf_call_php3(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARA call_php(name, r, 3, args); } -void udf_call_php4(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, +void udf_call_php4(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, PARAMDSC *arg4) { PARAMDSC *args[4] = { arg1, arg2, arg3, arg4 }; call_php(name, r, 4, args); } -void udf_call_php5(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, +void udf_call_php5(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, PARAMDSC *arg4, PARAMDSC *arg5) { PARAMDSC *args[5] = { arg1, arg2, arg3, arg4, arg5 }; call_php(name, r, 5, args); } -void udf_call_php6(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, +void udf_call_php6(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, PARAMDSC *arg4, PARAMDSC *arg5, PARAMDSC *arg6) { PARAMDSC *args[6] = { arg1, arg2, arg3, arg4, arg5, arg6 }; call_php(name, r, 6, args); } -void udf_call_php7(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, +void udf_call_php7(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, PARAMDSC *arg4, PARAMDSC *arg5, PARAMDSC *arg6, PARAMDSC *arg7) { PARAMDSC *args[7] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; call_php(name, r, 7, args); } -void udf_call_php8(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, +void udf_call_php8(char *name, PARAMDSC *r, PARAMDSC *arg1, PARAMDSC *arg2, PARAMDSC *arg3, PARAMDSC *arg4, PARAMDSC *arg5, PARAMDSC *arg6, PARAMDSC *arg7, PARAMDSC *arg8) { PARAMDSC *args[8] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 }; |