diff options
author | Ard Biesheuvel <abies@php.net> | 2004-05-12 14:29:42 +0000 |
---|---|---|
committer | Ard Biesheuvel <abies@php.net> | 2004-05-12 14:29:42 +0000 |
commit | afc9cb151bec01d3d3a9a8f353a35940495e2e5a (patch) | |
tree | b099c5036ba184d6c0c38497733e43211033555f | |
parent | b4939dfa9adfc3d1561735cd3f95206844aca680 (diff) | |
download | php-git-afc9cb151bec01d3d3a9a8f353a35940495e2e5a.tar.gz |
Dropped support for ancient Interbase versions (< 6)
# This has no consequences for Firebird, as its initial release was based on IB 6
-rw-r--r-- | ext/interbase/config.m4 | 12 | ||||
-rw-r--r-- | ext/interbase/config.w32 | 8 | ||||
-rw-r--r-- | ext/interbase/ibase_query.c | 131 | ||||
-rw-r--r-- | ext/interbase/ibase_service.c | 4 | ||||
-rw-r--r-- | ext/interbase/interbase.c | 41 | ||||
-rwxr-xr-x | ext/interbase/php_ibase_includes.h | 43 | ||||
-rw-r--r-- | ext/interbase/php_interbase.h | 11 |
7 files changed, 56 insertions, 194 deletions
diff --git a/ext/interbase/config.m4 b/ext/interbase/config.m4 index e61bf49adc..5f8d66ba8b 100644 --- a/ext/interbase/config.m4 +++ b/ext/interbase/config.m4 @@ -38,18 +38,6 @@ if test "$PHP_INTERBASE" != "no"; then -L$IBASE_LIBDIR ]) - if test " $IBASE_LIBNAME" != " "; then - PHP_CHECK_LIBRARY($IBASE_LIBNAME, isc_service_attach, - [ - AC_DEFINE(HAVE_IBASE6_API,1,[ ]) - AC_MSG_RESULT([Interbase version 6 API has been enabled.]) - ], [ - AC_MSG_RESULT([Interbase version 6 API has NOT been enabled.]) - ], [ - -L$IBASE_LIBDIR - ]) - fi - PHP_ADD_LIBRARY_WITH_PATH($IBASE_LIBNAME, $IBASE_LIBDIR, INTERBASE_SHARED_LIBADD) PHP_ADD_INCLUDE($IBASE_INCDIR) AC_DEFINE(HAVE_IBASE,1,[ ]) diff --git a/ext/interbase/config.w32 b/ext/interbase/config.w32 index 0019861c59..78a442d8ca 100644 --- a/ext/interbase/config.w32 +++ b/ext/interbase/config.w32 @@ -2,19 +2,15 @@ // vim:ft=javascript ARG_WITH("interbase", "InterBase support", "no"); -ARG_WITH("interbase5", "InterBase 5.x support", "no"); -if (PHP_INTERBASE != "no" || PHP_INTERBASE5 != "no") { +if (PHP_INTERBASE != "no") { if (CHECK_HEADER_ADD_INCLUDE("ibase.h", "CFLAGS_INTERBASE", PHP_PHP_BUILD + "\\interbase\\include;" + PHP_INTERBASE) && (CHECK_LIB("fbclient_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE) || CHECK_LIB("gds32_ms.lib", "interbase", PHP_PHP_BUILD + "\\interbase\\lib_ms;" + PHP_INTERBASE))) { + EXTENSION("interbase", "interbase.c ibase_query.c ibase_service.c ibase_events.c ibase_blobs.c"); AC_DEFINE('HAVE_IBASE', 1, 'Have interbase library'); - - if (PHP_INTERBASE != "no") { - AC_DEFINE('HAVE_IBASE6_API', 1, 'Have interbase version 6 API library'); - } } else { WARNING("interbase not enabled; libraries and headers not found"); } diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c index 68abf99c46..c7ae9260aa 100644 --- a/ext/interbase/ibase_query.c +++ b/ext/interbase/ibase_query.c @@ -40,6 +40,36 @@ #define FETCH_ARRAY 2 typedef struct { + ISC_ARRAY_DESC ar_desc; + ISC_LONG ar_size; /* size of entire array in bytes */ + unsigned short el_type, el_size; +} ibase_array; + +typedef struct { + ibase_db_link *link; + ibase_trans *trans; + isc_stmt_handle stmt; + unsigned short type; + unsigned char has_more_rows, statement_type; + XSQLDA *out_sqlda; + ibase_array out_array[1]; /* last member */ +} ibase_result; + +typedef struct { + ibase_db_link *link; + ibase_trans *trans; + int result_res_id; + isc_stmt_handle stmt; + XSQLDA *in_sqlda, *out_sqlda; + ibase_array *in_array, *out_array; + unsigned short in_array_cnt, out_array_cnt; + unsigned short dialect; + char statement_type; + char *query; + long trans_res_id; +} ibase_query; + +typedef struct { unsigned short vary_length; char vary_string[1]; } IBVARY; @@ -53,11 +83,9 @@ typedef struct { float fval; ISC_LONG lval; ISC_QUAD qval; -#ifdef SQL_TIMESTAMP ISC_TIMESTAMP tsval; ISC_DATE dtval; ISC_TIME tmval; -#endif } val; short sqlind; } BIND_BUF; @@ -207,18 +235,10 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ a->el_type = SQL_DOUBLE; a->el_size = sizeof(double); break; -#ifdef blr_int64 case blr_int64: a->el_type = SQL_INT64; a->el_size = sizeof(ISC_INT64); break; -#endif -#ifndef blr_timestamp - case blr_date: - a->el_type = SQL_DATE; - a->el_size = sizeof(ISC_QUAD); - break; -#else case blr_timestamp: a->el_type = SQL_TIMESTAMP; a->el_size = sizeof(ISC_TIMESTAMP); @@ -231,7 +251,6 @@ static int _php_ibase_alloc_array(ibase_array **ib_arrayp, XSQLDA *sqlda, /* {{{ a->el_type = SQL_TYPE_TIME; a->el_size = sizeof(ISC_TIME); break; -#endif case blr_varying: case blr_varying2: /** @@ -456,7 +475,6 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / } *(ISC_LONG*) buf = (ISC_LONG) l; break; -#ifdef SQL_INT64 case SQL_INT64: { long double l; @@ -478,13 +496,13 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / } } break; -#endif } } else { struct tm t = { 0, 0, 0, 0, 0, 0 }; switch (array->el_type) { unsigned short n; + ISC_INT64 l; case SQL_SHORT: convert_to_long(val); @@ -504,27 +522,21 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / #endif *(ISC_LONG *) buf = (ISC_LONG) Z_LVAL_P(val); break; -#ifdef SQL_INT64 case SQL_INT64: #if (SIZEOF_LONG >= 8) convert_to_long(val); *(long *) buf = Z_LVAL_P(val); #else - { - ISC_INT64 l; - - convert_to_string(val); - if (!sscanf(Z_STRVAL_P(val), "%" LL_MASK "d", &l)) { - _php_ibase_module_error("Cannot convert '%s' to long integer" - TSRMLS_CC, Z_STRVAL_P(val)); - return FAILURE; - } else { - *(ISC_INT64 *) buf = l; - } + convert_to_string(val); + if (!sscanf(Z_STRVAL_P(val), "%" LL_MASK "d", &l)) { + _php_ibase_module_error("Cannot convert '%s' to long integer" + TSRMLS_CC, Z_STRVAL_P(val)); + return FAILURE; + } else { + *(ISC_INT64 *) buf = l; } #endif break; -#endif case SQL_FLOAT: convert_to_double(val); *(float*) buf = (float) Z_DVAL_P(val); @@ -533,11 +545,7 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / convert_to_double(val); *(double*) buf = Z_DVAL_P(val); break; -#ifndef SQL_TIMESTAMP - case SQL_DATE: -#else case SQL_TIMESTAMP: -#endif convert_to_string(val); #ifdef HAVE_STRPTIME strptime(Z_STRVAL_P(val), IBG(timestampformat), &t); @@ -553,10 +561,6 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / t.tm_year -= 1900; t.tm_mon--; #endif -#ifndef SQL_TIMESTAMP - isc_encode_date(&t, (ISC_QUAD *) buf); - break; -#else isc_encode_timestamp(&t, (ISC_TIMESTAMP * ) buf); break; case SQL_TYPE_DATE: @@ -591,7 +595,6 @@ static int _php_ibase_bind_array(zval *val, char *buf, unsigned long buf_size, / #endif isc_encode_sql_time(&t, (ISC_TIME *) buf); break; -#endif default: convert_to_string(val); strncpy(buf, Z_STRVAL_P(val), array->el_size); @@ -652,7 +655,7 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{ #endif buf[i].val.lval = (ISC_LONG) Z_LVAL_P(b_var); break; -#if defined(SQL_INT64) && (SIZEOF_LONG == 8) +#if (SIZEOF_LONG == 8) case SQL_INT64: convert_to_long(b_var); var->sqldata = (void *) &Z_LVAL_P(b_var); @@ -667,36 +670,15 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{ var->sqldata = (void *) &Z_DVAL_P(b_var); break; - case SQL_DATE: /* == SQL_TIMESTAMP: */ -#ifdef SQL_TIMESTAMP + case SQL_TIMESTAMP: case SQL_TYPE_DATE: case SQL_TYPE_TIME: -#endif if (Z_TYPE_P(b_var) == IS_LONG) { /* insert timestamp directly */ t = *gmtime(&Z_LVAL_P(b_var)); } else { #ifndef HAVE_STRPTIME -#ifndef SQL_TIMESTAMP - int n; - - t.tm_year = t.tm_mon = t.tm_mday = t.tm_hour = t.tm_min = t.tm_sec = 0; - - 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("Parameter %d: invalid date/time format " - "(expected 3 or 6 fields, got %d. Use format m/d/Y H:i:s. You gave '%s')" - TSRMLS_CC, i+1, n, Z_STRVAL_P(b_var)); - rv = FAILURE; - break; - } - t.tm_year -= 1900; - t.tm_mon--; -#else goto php_ibase_bind_default; /* let IB string handling take over */ -#endif #else convert_to_string(b_var); @@ -714,9 +696,6 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{ #endif } -#ifndef SQL_TIMESTAMP - isc_encode_date(&t, &buf[i].val.qval); -#else switch (var->sqltype & ~1) { default: /* == case SQL_TIMESTAMP */ isc_encode_timestamp(&t, &buf[i].val.tsval); @@ -727,7 +706,6 @@ static int _php_ibase_bind(XSQLDA *sqlda, zval ***b_vars, BIND_BUF *buf, /* {{{ case SQL_TYPE_TIME: isc_encode_sql_time(&t, &buf[i].val.tmval); break; -#endif } break; case SQL_BLOB: @@ -847,12 +825,9 @@ static void _php_ibase_alloc_xsqlda(XSQLDA *sqlda) /* {{{ */ case SQL_DOUBLE: var->sqldata = emalloc(sizeof(double)); break; -#ifdef SQL_INT64 case SQL_INT64: var->sqldata = emalloc(sizeof(ISC_INT64)); break; -#endif -#ifdef SQL_TIMESTAMP case SQL_TIMESTAMP: var->sqldata = emalloc(sizeof(ISC_TIMESTAMP)); break; @@ -862,9 +837,6 @@ static void _php_ibase_alloc_xsqlda(XSQLDA *sqlda) /* {{{ */ case SQL_TYPE_TIME: var->sqldata = emalloc(sizeof(ISC_TIME)); break; -#else - case SQL_DATE: -#endif case SQL_BLOB: case SQL_ARRAY: var->sqldata = emalloc(sizeof(ISC_QUAD)); @@ -1331,14 +1303,9 @@ 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) { -#ifdef SQL_INT64 static ISC_INT64 const scales[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 100000000, 1000000000, 1000000000, LL_LIT(10000000000),LL_LIT(100000000000),LL_LIT(10000000000000),LL_LIT(100000000000000), LL_LIT(1000000000000000),LL_LIT(1000000000000000),LL_LIT(1000000000000000000) }; -#else - static long const scales[] = { 1, 10, 100, 1000, 10000, 100000, 1000000, 100000000, 1000000000, - 1000000000 }; -#endif switch (type & ~1) { unsigned short l; @@ -1362,7 +1329,6 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ case SQL_SHORT: n = *(short *) data; goto _sql_long; -#ifdef SQL_INT64 case SQL_INT64: #if (SIZEOF_LONG >= 8) n = *(long *) data; @@ -1385,7 +1351,6 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ } break; #endif -#endif case SQL_LONG: n = *(ISC_LONG *) data; _sql_long: @@ -1412,9 +1377,6 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ break; case SQL_DATE: /* == case SQL_TIMESTAMP: */ format = IBG(timestampformat); -#ifndef SQL_TIMESTAMP - isc_decode_date((ISC_QUAD *) data, &t); -#else isc_decode_timestamp((ISC_TIMESTAMP *) data, &t); goto format_date_time; case SQL_TYPE_DATE: @@ -1426,7 +1388,6 @@ static int _php_ibase_var_zval(zval *val, void *data, int type, int len, /* {{{ isc_decode_sql_time((ISC_TIME *) data, &t); format_date_time: -#endif /* XXX - Might have to remove this later - seems that isc_decode_date() always sets tm_isdst to 0, sometimes incorrectly (InterBase 6 bug?) @@ -1446,14 +1407,12 @@ format_date_time: l = 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); break; -#ifdef SQL_TIMESTAMP case SQL_TYPE_DATE: l = sprintf(string_data, "%02d/%02d/%4d", t.tm_mon + 1, t.tm_mday, t.tm_year+1900); break; case SQL_TYPE_TIME: l = sprintf(string_data, "%02d:%02d:%02d", t.tm_hour, t.tm_min, t.tm_sec); break; -#endif } #endif ZVAL_STRINGL(val,string_data,l,1); @@ -1973,11 +1932,9 @@ static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */ case SQL_LONG: precision = 9; break; -#ifdef SQL_INT64 case SQL_INT64: precision = 18; break; -#endif } len = sprintf(buf, "NUMERIC(%d,%d)", precision, -var->sqlscale); add_index_stringl(return_value, 4, s, len, 1); @@ -2001,12 +1958,9 @@ static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */ case SQL_DOUBLE: case SQL_D_FLOAT: s = "DOUBLE PRECISION"; break; -#ifdef SQL_INT64 case SQL_INT64: s = "BIGINT"; break; -#endif -#ifdef SQL_TIMESTAMP case SQL_TIMESTAMP: s = "TIMESTAMP"; break; @@ -2016,11 +1970,6 @@ static void _php_ibase_field_info(zval *return_value, XSQLVAR *var) /* {{{ */ case SQL_TYPE_TIME: s = "TIME"; break; -#else - case SQL_DATE: - s = "DATE"; - break; -#endif case SQL_BLOB: s = "BLOB"; break; diff --git a/ext/interbase/ibase_service.c b/ext/interbase/ibase_service.c index d63db1dc80..fe02daeec9 100644 --- a/ext/interbase/ibase_service.c +++ b/ext/interbase/ibase_service.c @@ -24,7 +24,7 @@ #include "php.h" -#if HAVE_IBASE6_API +#if HAVE_IBASE #include "php_interbase.h" #include "php_ibase_includes.h" @@ -617,7 +617,7 @@ PHP_FUNCTION(ibase_server_info) void php_ibase_register_service_constants(INIT_FUNC_ARGS) { /* nop */ } -#endif /* HAVE_IBASE6_API */ +#endif /* HAVE_IBASE */ /* * Local variables: diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 87a23ee76d..11a3547ad9 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -24,9 +24,7 @@ #include "config.h" #endif -#ifdef __GNUC__ #define _GNU_SOURCE -#endif #include "php.h" @@ -61,9 +59,7 @@ function_entry ibase_functions[] = { PHP_FE(ibase_prepare, NULL) PHP_FE(ibase_execute, NULL) PHP_FE(ibase_free_query, NULL) -#if HAVE_STRFTIME PHP_FE(ibase_timefmt, NULL) -#endif PHP_FE(ibase_gen_id, NULL) PHP_FE(ibase_num_fields, NULL) PHP_FE(ibase_num_params, NULL) @@ -78,6 +74,7 @@ function_entry ibase_functions[] = { PHP_FE(ibase_commit, NULL) PHP_FE(ibase_rollback, NULL) PHP_FE(ibase_commit_ret, NULL) + PHP_FE(ibase_rollback_ret, NULL) PHP_FE(ibase_blob_info, NULL) PHP_FE(ibase_blob_create, NULL) @@ -91,13 +88,10 @@ function_entry ibase_functions[] = { PHP_FE(ibase_errmsg, NULL) PHP_FE(ibase_errcode, NULL) -#if HAVE_IBASE6_API PHP_FE(ibase_add_user, NULL) PHP_FE(ibase_modify_user, NULL) PHP_FE(ibase_delete_user, NULL) - PHP_FE(ibase_rollback_ret, NULL) - PHP_FE(ibase_service_attach, NULL) PHP_FE(ibase_service_detach, NULL) PHP_FE(ibase_backup, NULL) @@ -105,7 +99,7 @@ function_entry ibase_functions[] = { PHP_FE(ibase_maintain_db, NULL) PHP_FE(ibase_db_info, NULL) PHP_FE(ibase_server_info, NULL) -#endif + PHP_FE(ibase_wait_event, NULL) PHP_FE(ibase_set_event_handler, NULL) PHP_FE(ibase_free_event_handler, NULL) @@ -272,8 +266,7 @@ static void _php_ibase_commit_link(ibase_db_link *link TSRMLS_DC) /* {{{ */ } } efree(p->trans); /* default transaction is not a registered resource: clean up */ - } - else { + } else { if (p->trans->handle != NULL) { /* non-default trans might have been rolled back by other call of this dtor */ IBDEBUG("Rolling back other transactions..."); @@ -513,8 +506,6 @@ PHP_MINFO_FUNCTION(ibase) sprintf( (s = tmp), "Firebird API version %d", FB_API_VER); #elif (SQLDA_CURRENT_VERSION > 1) s = "Interbase 7.0 and up"; -#elif (SQL_DIALECT_CURRENT == 1) - s = "Interbase 5.6 or earlier"; #elif !defined(DSC_null) s = "Interbase 6"; #else @@ -538,11 +529,7 @@ PHP_MINFO_FUNCTION(ibase) if (info_func) { info_func(s = tmp); } else { -#if HAVE_IBASE6_API s = "Firebird 1.0/Interbase 6"; -#else - s = "Firebird 1.0/Interbase 6 or earlier"; -#endif } php_info_print_table_row(2, "Run-time Client Library Version", s); } while (0); @@ -578,10 +565,8 @@ PHP_MINFO_FUNCTION(ibase) enum connect_args { DB = 0, USER = 1, PASS = 2, CSET = 3, ROLE = 4, BUF = 0, DLECT = 1 }; -static char const dpb_args[] = { 0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype -#ifdef isc_dpb_sql_role_name - , isc_dpb_sql_role_name -#endif +static char const dpb_args[] = { + 0, isc_dpb_user_name, isc_dpb_password, isc_dpb_lc_ctype, isc_dpb_sql_role_name }; int _php_ibase_attach_db(char **args, int *len, long *largs, isc_db_handle *db TSRMLS_DC) @@ -956,7 +941,7 @@ PHP_FUNCTION(ibase_trans) } /* register the transaction in our own data structures */ - ib_trans = (ibase_trans *) safe_emalloc((link_cnt-1), sizeof(ibase_db_link *), sizeof(ibase_trans)); + ib_trans = (ibase_trans *) safe_emalloc(link_cnt-1, sizeof(ibase_db_link *), sizeof(ibase_trans)); ib_trans->handle = tr_handle; ib_trans->link_cnt = link_cnt; ib_trans->affected_rows = 0; @@ -1079,11 +1064,9 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) /* {{ case COMMIT: result = isc_commit_transaction(IB_STATUS, &trans->handle); break; -#if HAVE_IBASE6_API case (ROLLBACK | RETAIN): result = isc_rollback_retaining(IB_STATUS, &trans->handle); break; -#endif case (COMMIT | RETAIN): result = isc_commit_retaining(IB_STATUS, &trans->handle); break; @@ -1128,12 +1111,10 @@ PHP_FUNCTION(ibase_commit_ret) /* {{{ proto bool ibase_rollback_ret( resource link_identifier ) Rollback transaction and retain the transaction context */ -#if HAVE_IBASE6_API PHP_FUNCTION(ibase_rollback_ret) { _php_ibase_trans_end(INTERNAL_FUNCTION_PARAM_PASSTHRU, ROLLBACK | RETAIN); } -#endif /* }}} */ /* {{{ proto bool ibase_timefmt(string format [, int type ]) @@ -1186,11 +1167,7 @@ PHP_FUNCTION(ibase_gen_id) ibase_db_link *ib_link; ibase_trans *trans = NULL; XSQLDA out_sqlda; -#ifdef SQL_INT64 ISC_INT64 result; -#else - ISC_LONG result; -#endif RESET_ERRMSG; @@ -1208,11 +1185,7 @@ PHP_FUNCTION(ibase_gen_id) out_sqlda.version = SQLDA_CURRENT_VERSION; /* allocate the field for the result */ -#ifdef SQL_INT64 out_sqlda.sqlvar[0].sqltype = SQL_INT64; -#else - out_sqlda.sqlvar[0].sqltype = SQL_LONG; -#endif out_sqlda.sqlvar[0].sqlscale = 0; out_sqlda.sqlvar[0].sqllen = sizeof(result); out_sqlda.sqlvar[0].sqldata = (void*) &result; @@ -1225,7 +1198,7 @@ PHP_FUNCTION(ibase_gen_id) } /* don't return the generator value as a string unless it doesn't fit in a long */ -#if SQL_INT64 && SIZEOF_LONG < 8 +#if SIZEOF_LONG < 8 if (result < LONG_MIN || result > LONG_MAX) { char res[24]; diff --git a/ext/interbase/php_ibase_includes.h b/ext/interbase/php_ibase_includes.h index 66257ffdfa..b5e453fbf1 100755 --- a/ext/interbase/php_ibase_includes.h +++ b/ext/interbase/php_ibase_includes.h @@ -29,19 +29,6 @@ #define SQLDA_CURRENT_VERSION SQLDA_VERSION1 #endif -/* IB < 6 doesn't define these */ -#ifndef SQL_DIALECT_CURRENT -#define SQL_DIALECT_CURRENT 1 /* == SQL_DIALECT_V5 */ - -#ifdef PHP_WIN32 -typedef __int64 ISC_INT64; -typedef unsigned __int64 ISC_UINT64; -#else -typedef long long ISC_INT64; -typedef unsigned long long ISC_UINT64; -#endif /* PHP_WIN32 */ -#endif /* SQL_DIALECT_CURRENT */ - #define RESET_ERRMSG do { IBG(errmsg)[0] = '\0'; IBG(sql_code) = 0; } while (0) #define IB_STATUS (IBG(status)) @@ -97,41 +84,11 @@ typedef struct tr_list { } ibase_tr_list; typedef struct { - ISC_ARRAY_DESC ar_desc; - ISC_LONG ar_size; /* size of entire array in bytes */ - unsigned short el_type, el_size; -} ibase_array; - -typedef struct { isc_blob_handle bl_handle; unsigned short type; ISC_QUAD bl_qd; } ibase_blob; -typedef struct { - ibase_db_link *link; - ibase_trans *trans; - isc_stmt_handle stmt; - unsigned short type; - unsigned char has_more_rows, statement_type; - XSQLDA *out_sqlda; - ibase_array out_array[1]; /* last member */ -} ibase_result; - -typedef struct { - ibase_db_link *link; - ibase_trans *trans; - int result_res_id; - isc_stmt_handle stmt; - XSQLDA *in_sqlda, *out_sqlda; - ibase_array *in_array, *out_array; - unsigned short in_array_cnt, out_array_cnt; - unsigned short dialect; - char statement_type; - char *query; - long trans_res_id; -} ibase_query; - typedef struct event { ibase_db_link *link; long link_res_id; diff --git a/ext/interbase/php_interbase.h b/ext/interbase/php_interbase.h index 3cefb2a744..1469b2a4bd 100644 --- a/ext/interbase/php_interbase.h +++ b/ext/interbase/php_interbase.h @@ -45,9 +45,9 @@ PHP_FUNCTION(ibase_name_result); PHP_FUNCTION(ibase_prepare); PHP_FUNCTION(ibase_execute); PHP_FUNCTION(ibase_free_query); -#if HAVE_STRFTIME + PHP_FUNCTION(ibase_timefmt); -#endif + PHP_FUNCTION(ibase_gen_id); PHP_FUNCTION(ibase_num_fields); PHP_FUNCTION(ibase_num_params); @@ -62,6 +62,7 @@ PHP_FUNCTION(ibase_trans); PHP_FUNCTION(ibase_commit); PHP_FUNCTION(ibase_rollback); PHP_FUNCTION(ibase_commit_ret); +PHP_FUNCTION(ibase_rollback_ret); PHP_FUNCTION(ibase_blob_create); PHP_FUNCTION(ibase_blob_add); @@ -72,13 +73,11 @@ PHP_FUNCTION(ibase_blob_close); PHP_FUNCTION(ibase_blob_echo); PHP_FUNCTION(ibase_blob_info); PHP_FUNCTION(ibase_blob_import); -#if HAVE_IBASE6_API + PHP_FUNCTION(ibase_add_user); PHP_FUNCTION(ibase_modify_user); PHP_FUNCTION(ibase_delete_user); -PHP_FUNCTION(ibase_rollback_ret); - PHP_FUNCTION(ibase_service_attach); PHP_FUNCTION(ibase_service_detach); PHP_FUNCTION(ibase_backup); @@ -86,7 +85,7 @@ PHP_FUNCTION(ibase_restore); PHP_FUNCTION(ibase_maintain_db); PHP_FUNCTION(ibase_db_info); PHP_FUNCTION(ibase_server_info); -#endif + PHP_FUNCTION(ibase_errmsg); PHP_FUNCTION(ibase_errcode); |