cvs: /php4/ext/interbase interbase.c php_interbase.h /php4/ext/oci8 oci8.c /php4/ext/odbc php_odbc.c php_velocis.h velocis.c

From: Date: Fri, 17 Dec 1999 22:27:56 +0000
Subject: cvs: /php4/ext/interbase interbase.c php_interbase.h /php4/ext/oci8 oci8.c /php4/ext/odbc php_odbc.c php_velocis.h velocis.c
Groups: php.version4 
Request: Send a blank email to php-version4+get-8104@lists.php.net to get a copy of this message
zeev Fri Dec 17 17:27:56 1999 EDT Modified files: /php4/ext/interbase interbase.c php_interbase.h /php4/ext/oci8 oci8.c /php4/ext/odbc php_odbc.c php_velocis.h velocis.c Log: More php3_ cleanup Index: php4/ext/interbase/interbase.c diff -u php4/ext/interbase/interbase.c:1.11 php4/ext/interbase/interbase.c:1.12 --- php4/ext/interbase/interbase.c:1.11 Fri Dec 17 15:55:06 1999 +++ php4/ext/interbase/interbase.c Fri Dec 17 17:27:23 1999 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: interbase.c,v 1.11 1999/12/17 20:55:06 zeev Exp $ */ +/* $Id: interbase.c,v 1.12 1999/12/17 22:27:23 zeev Exp $ */ /* TODO: A lot... */ @@ -62,7 +62,7 @@ /* {{{ thread safety stuff */ #if defined(THREAD_SAFE) typedef ibase_global_struct{ - ibase_module php3_ibase_module; + ibase_module php_ibase_module; } ibase_global_struct; #define IBASE_GLOBAL(a) ibase_globals->a @@ -74,41 +74,41 @@ #else #define IBASE_GLOBAL(a) a #define IBASE_TLS_VARS -ibase_module php3_ibase_module; +ibase_module php_ibase_module; #endif /* }}} */ -/* {{{ _php3_ibase_close_link() */ -static void _php3_ibase_close_link(isc_db_handle db) +/* {{{ php_ibase_close_link() */ +static void php_ibase_close_link(isc_db_handle db) { ISC_STATUS status[20]; IBASE_TLS_VARS; isc_detach_database(status, &db); - IBASE_GLOBAL(php3_ibase_module).num_links--; + IBASE_GLOBAL(php_ibase_module).num_links--; } /* }}} */ -/* {{{ _php3_ibase_close_plink() */ -static void _php3_ibase_close_plink(isc_db_handle db) +/* {{{ php_ibase_close_plink() */ +static void php_ibase_close_plink(isc_db_handle db) { ISC_STATUS status[20]; IBASE_TLS_VARS; isc_detach_database(status, &db); - php3_ibase_module.num_persistent--; - php3_ibase_module.num_links--; + php_ibase_module.num_persistent--; + php_ibase_module.num_links--; } /* }}} */ -/* {{{ _php3_ibase_free_result() */ -static void _php3_ibase_free_result(ibase_result_handle *result) +/* {{{ php_ibase_free_result() */ +static void php_ibase_free_result(ibase_result_handle *result) { int i; ISC_STATUS status[20]; IBASE_TLS_VARS; - if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions && result->commitok) { + if (!IBASE_GLOBAL(php_ibase_module).manualtransactions && result->commitok) { isc_commit_transaction(status, &result->trans); } if (result->sqlda != NULL) { @@ -123,8 +123,8 @@ } /* }}} */ -/* {{{ _php3_ibase_free_query() */ -static void _php3_ibase_free_query(ibase_query_handle *query) +/* {{{ php_ibase_free_query() */ +static void php_ibase_free_query(ibase_query_handle *query) { int i; ISC_STATUS status[20]; @@ -148,37 +148,37 @@ { IBASE_TLS_VARS; - if (cfg_get_long("ibase.allow_persistent", &IBASE_GLOBAL(php3_ibase_module).allow_persistent) == FAILURE) { - IBASE_GLOBAL(php3_ibase_module).allow_persistent = 1; + if (cfg_get_long("ibase.allow_persistent", &IBASE_GLOBAL(php_ibase_module).allow_persistent) == FAILURE) { + IBASE_GLOBAL(php_ibase_module).allow_persistent = 1; } - if (cfg_get_long("ibase.max_persistent", &IBASE_GLOBAL(php3_ibase_module).max_persistent) == FAILURE) { - IBASE_GLOBAL(php3_ibase_module).max_persistent = -1; + if (cfg_get_long("ibase.max_persistent", &IBASE_GLOBAL(php_ibase_module).max_persistent) == FAILURE) { + IBASE_GLOBAL(php_ibase_module).max_persistent = -1; } - if (cfg_get_long("ibase.max_links", &IBASE_GLOBAL(php3_ibase_module).max_links) == FAILURE) { - IBASE_GLOBAL(php3_ibase_module).max_links = -1; + if (cfg_get_long("ibase.max_links", &IBASE_GLOBAL(php_ibase_module).max_links) == FAILURE) { + IBASE_GLOBAL(php_ibase_module).max_links = -1; } /* - if (cfg_get_long("ibase.manualtransactions", &IBASE_GLOBAL(php3_ibase_module).manualtransactions) == FAILURE) { - IBASE_GLOBAL(php3_ibase_module).manualtransactions = 0; + if (cfg_get_long("ibase.manualtransactions", &IBASE_GLOBAL(php_ibase_module).manualtransactions) == FAILURE) { + IBASE_GLOBAL(php_ibase_module).manualtransactions = 0; } */ - IBASE_GLOBAL(php3_ibase_module).manualtransactions = 0; - if (cfg_get_string("ibase.default_user", &IBASE_GLOBAL(php3_ibase_module).default_user) == FAILURE - || IBASE_GLOBAL(php3_ibase_module).default_user[0] == 0) { - IBASE_GLOBAL(php3_ibase_module).default_user = ""; - } - if (cfg_get_string("ibase.default_password", &IBASE_GLOBAL(php3_ibase_module).default_password) == FAILURE - || IBASE_GLOBAL(php3_ibase_module).default_password[0] == 0) { - IBASE_GLOBAL(php3_ibase_module).default_password = ""; - } - if (cfg_get_string("ibase.timeformat", &IBASE_GLOBAL(php3_ibase_module).timeformat) == FAILURE) { - IBASE_GLOBAL(php3_ibase_module).timeformat = "%Y-%m-%d %H:%M:%S"; - } - IBASE_GLOBAL(php3_ibase_module).num_persistent=0; - IBASE_GLOBAL(php3_ibase_module).le_result = register_list_destructors(_php3_ibase_free_result, NULL); - IBASE_GLOBAL(php3_ibase_module).le_query = register_list_destructors(_php3_ibase_free_query, NULL); - IBASE_GLOBAL(php3_ibase_module).le_link = register_list_destructors(_php3_ibase_close_link, NULL); - IBASE_GLOBAL(php3_ibase_module).le_plink = register_list_destructors(NULL, _php3_ibase_close_plink); + IBASE_GLOBAL(php_ibase_module).manualtransactions = 0; + if (cfg_get_string("ibase.default_user", &IBASE_GLOBAL(php_ibase_module).default_user) == FAILURE + || IBASE_GLOBAL(php_ibase_module).default_user[0] == 0) { + IBASE_GLOBAL(php_ibase_module).default_user = ""; + } + if (cfg_get_string("ibase.default_password", &IBASE_GLOBAL(php_ibase_module).default_password) == FAILURE + || IBASE_GLOBAL(php_ibase_module).default_password[0] == 0) { + IBASE_GLOBAL(php_ibase_module).default_password = ""; + } + if (cfg_get_string("ibase.timeformat", &IBASE_GLOBAL(php_ibase_module).timeformat) == FAILURE) { + IBASE_GLOBAL(php_ibase_module).timeformat = "%Y-%m-%d %H:%M:%S"; + } + IBASE_GLOBAL(php_ibase_module).num_persistent=0; + IBASE_GLOBAL(php_ibase_module).le_result = register_list_destructors(php_ibase_free_result, NULL); + IBASE_GLOBAL(php_ibase_module).le_query = register_list_destructors(php_ibase_free_query, NULL); + IBASE_GLOBAL(php_ibase_module).le_link = register_list_destructors(php_ibase_close_link, NULL); + IBASE_GLOBAL(php_ibase_module).le_plink = register_list_destructors(NULL, php_ibase_close_plink); return SUCCESS; } @@ -186,18 +186,18 @@ { IBASE_TLS_VARS; - IBASE_GLOBAL(php3_ibase_module).default_link=-1; - IBASE_GLOBAL(php3_ibase_module).num_links = php3_ibase_module.num_persistent; + IBASE_GLOBAL(php_ibase_module).default_link=-1; + IBASE_GLOBAL(php_ibase_module).num_links = php_ibase_module.num_persistent; return SUCCESS; } /* TODO IF NEEDED -int php3_mfinish_ibase(void) +int php_mfinish_ibase(void) { } -int php3_rfinish_ibase(void) +int php_rfinish_ibase(void) { } */ @@ -248,8 +248,8 @@ } /* }}} */ -/* {{{ _php3_ibase_connect() */ -static void _php3_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) +/* {{{ php_ibase_connect() */ +static void php_ibase_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) { pval *server, *uname, *passwd; @@ -260,8 +260,8 @@ int hashed_details_length; IBASE_TLS_VARS; - ib_uname = IBASE_GLOBAL(php3_ibase_module).default_user; - ib_passwd = IBASE_GLOBAL(php3_ibase_module).default_password; + ib_uname = IBASE_GLOBAL(php_ibase_module).default_user; + ib_passwd = IBASE_GLOBAL(php_ibase_module).default_password; ib_uname_len = ib_uname ? strlen(ib_uname) : 0; ib_passwd_len = ib_passwd ? strlen(ib_passwd) : 0; @@ -325,13 +325,13 @@ if (zend_hash_find(plist, hashed_details, hashed_details_length+1, (void **) &le)==FAILURE) { list_entry new_le; - if (IBASE_GLOBAL(php3_ibase_module).max_links!=-1 && IBASE_GLOBAL(php3_ibase_module).num_links>=IBASE_GLOBAL(php3_ibase_module).max_links) { - php_error(E_WARNING,"InterBase: Too many open links (%d)", IBASE_GLOBAL(php3_ibase_module).num_links); + if (IBASE_GLOBAL(php_ibase_module).max_links!=-1 && IBASE_GLOBAL(php_ibase_module).num_links>=IBASE_GLOBAL(php_ibase_module).max_links) { + php_error(E_WARNING,"InterBase: Too many open links (%d)", IBASE_GLOBAL(php_ibase_module).num_links); efree(hashed_details); RETURN_FALSE; } - if (IBASE_GLOBAL(php3_ibase_module).max_persistent!=-1 && IBASE_GLOBAL(php3_ibase_module).num_persistent>=IBASE_GLOBAL(php3_ibase_module).max_persistent) { - php_error(E_WARNING,"InterBase: Too many open persistent links (%d)", IBASE_GLOBAL(php3_ibase_module).num_persistent); + if (IBASE_GLOBAL(php_ibase_module).max_persistent!=-1 && IBASE_GLOBAL(php_ibase_module).num_persistent>=IBASE_GLOBAL(php_ibase_module).max_persistent) { + php_error(E_WARNING,"InterBase: Too many open persistent links (%d)", IBASE_GLOBAL(php_ibase_module).num_persistent); efree(hashed_details); RETURN_FALSE; } @@ -344,23 +344,23 @@ } /* hash it up */ - new_le.type = php3_ibase_module.le_plink; + new_le.type = php_ibase_module.le_plink; new_le.ptr = db_handle; if (zend_hash_update(plist, hashed_details, hashed_details_length+1, (void *) &new_le, sizeof(list_entry), NULL)==FAILURE) { efree(hashed_details); RETURN_FALSE; } - IBASE_GLOBAL(php3_ibase_module).num_links++; - IBASE_GLOBAL(php3_ibase_module).num_persistent++; + IBASE_GLOBAL(php_ibase_module).num_links++; + IBASE_GLOBAL(php_ibase_module).num_persistent++; } else { - if (le->type != IBASE_GLOBAL(php3_ibase_module).le_plink) { + if (le->type != IBASE_GLOBAL(php_ibase_module).le_plink) { RETURN_FALSE; } /* TODO: ensure that the link did not die */ db_handle = (isc_db_handle) le->ptr; } - return_value->value.lval = zend_list_insert(db_handle, IBASE_GLOBAL(php3_ibase_module).le_plink); + return_value->value.lval = zend_list_insert(db_handle, IBASE_GLOBAL(php_ibase_module).le_plink); return_value->type = IS_LONG; } else { list_entry *index_ptr, new_index_ptr; @@ -379,8 +379,8 @@ } link = (int) index_ptr->ptr; ptr = zend_list_find(link,&type); /* check if the link is still there */ - if (ptr && (type==IBASE_GLOBAL(php3_ibase_module).le_link || type==IBASE_GLOBAL(php3_ibase_module).le_plink)) { - return_value->value.lval = IBASE_GLOBAL(php3_ibase_module).default_link = link; + if (ptr && (type==IBASE_GLOBAL(php_ibase_module).le_link || type==IBASE_GLOBAL(php_ibase_module).le_plink)) { + return_value->value.lval = IBASE_GLOBAL(php_ibase_module).default_link = link; return_value->type = IS_LONG; efree(hashed_details); return; @@ -388,8 +388,8 @@ zend_hash_del(list,hashed_details,hashed_details_length+1); } } - if (IBASE_GLOBAL(php3_ibase_module).max_links!=-1 && IBASE_GLOBAL(php3_ibase_module).num_links>=IBASE_GLOBAL(php3_ibase_module).max_links) { - php_error(E_WARNING,"InterBase: Too many open links (%d)", IBASE_GLOBAL(php3_ibase_module).num_links); + if (IBASE_GLOBAL(php_ibase_module).max_links!=-1 && IBASE_GLOBAL(php_ibase_module).num_links>=IBASE_GLOBAL(php_ibase_module).max_links) { + php_error(E_WARNING,"InterBase: Too many open links (%d)", IBASE_GLOBAL(php_ibase_module).num_links); efree(hashed_details); RETURN_FALSE; } @@ -401,7 +401,7 @@ } /* add it to the list */ - return_value->value.lval = zend_list_insert(db_handle, IBASE_GLOBAL(php3_ibase_module).le_link); + return_value->value.lval = zend_list_insert(db_handle, IBASE_GLOBAL(php_ibase_module).le_link); return_value->type = IS_LONG; /* add it to the hash */ @@ -411,10 +411,10 @@ efree(hashed_details); RETURN_FALSE; } - IBASE_GLOBAL(php3_ibase_module).num_links++; + IBASE_GLOBAL(php_ibase_module).num_links++; } efree(hashed_details); - IBASE_GLOBAL(php3_ibase_module).default_link=return_value->value.lval; + IBASE_GLOBAL(php_ibase_module).default_link=return_value->value.lval; } /* }}} */ @@ -422,7 +422,7 @@ Open a connection to an InterBase database */ PHP_FUNCTION(ibase_connect) { - _php3_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); + php_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 0); } /* }}} */ @@ -430,7 +430,7 @@ Open a persistent connection to an InterBase database */ PHP_FUNCTION(ibase_pconnect) { - _php3_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); + php_ibase_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU, 1); } /* }}} */ @@ -445,7 +445,7 @@ switch (ARG_COUNT(ht)) { case 0: - id = IBASE_GLOBAL(php3_ibase_module).default_link; + id = IBASE_GLOBAL(php_ibase_module).default_link; break; case 1: if (getParameters(ht, 1, &ibase_link) == FAILURE) { @@ -460,7 +460,7 @@ } db_handle = (isc_db_handle) zend_list_find(id, &type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_link && type!=IBASE_GLOBAL(php3_ibase_module).le_plink) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_link && type!=IBASE_GLOBAL(php_ibase_module).le_plink) { php_error(E_WARNING, "%d is not an InterBase link index",id); RETURN_FALSE; } @@ -470,8 +470,8 @@ } /* }}} */ -/* {{{ _php3_ibase_prepare() */ -static XSQLDA *_php3_ibase_prepare(isc_db_handle db, isc_tr_handle tr, isc_stmt_handle *query_handle, char *query) +/* {{{ php_ibase_prepare() */ +static XSQLDA *php_ibase_prepare(isc_db_handle db, isc_tr_handle tr, isc_stmt_handle *query_handle, char *query) { ISC_STATUS status[20]; XSQLDA *isqlda; @@ -517,8 +517,8 @@ } /* }}} */ -/* {{{ _php3_ibase_execute() */ -static XSQLDA *_php3_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle query_handle, XSQLDA *isqlda, ISC_STATUS *status) +/* {{{ php_ibase_execute() */ +static XSQLDA *php_ibase_execute(isc_tr_handle tr_handle, isc_stmt_handle query_handle, XSQLDA *isqlda, ISC_STATUS *status) { int i, coltype; static char query_info[] = { isc_info_sql_stmt_type }; @@ -614,7 +614,7 @@ php_error(E_WARNING, "InterBase: couldn't execute query"); } /* - if (!php3_ibase_module.manualtransactions) { + if (!php_ibase_module.manualtransactions) { if(0) { isc_commit_transaction(status, tr_handle); } else { @@ -647,7 +647,7 @@ if (getParameters(ht, 1, &query) == FAILURE) { RETURN_FALSE; } - id = IBASE_GLOBAL(php3_ibase_module).default_link; + id = IBASE_GLOBAL(php_ibase_module).default_link; break; case 2: if (getParameters(ht, 2, &ibase_link, &query) == FAILURE) { @@ -662,21 +662,21 @@ } db_handle = (isc_db_handle) zend_list_find(id, &type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_link && type!=IBASE_GLOBAL(php3_ibase_module).le_plink) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_link && type!=IBASE_GLOBAL(php_ibase_module).le_plink) { php_error(E_WARNING, "%d is not an InterBase link index", id); RETURN_FALSE; } convert_to_string(query); - if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions) { + if (!IBASE_GLOBAL(php_ibase_module).manualtransactions) { if (isc_start_transaction(status, &tr_handle, 1, &db_handle, 0, NULL)) { php_error(E_WARNING, "InterBase: couldn't start transaction"); RETURN_FALSE; } } - isqlda = _php3_ibase_prepare(db_handle, tr_handle, &query_handle, query->value.str.val); + isqlda = php_ibase_prepare(db_handle, tr_handle, &query_handle, query->value.str.val); if (isqlda != NULL) { isc_rollback_transaction(status, &tr_handle); isc_dsql_free_statement(status, &query_handle, DSQL_drop); @@ -684,24 +684,24 @@ RETURN_FALSE; } - osqlda = _php3_ibase_execute(tr_handle, query_handle, isqlda, status); + osqlda = php_ibase_execute(tr_handle, query_handle, isqlda, status); if (osqlda != NULL) { ibase_result = (ibase_result_handle *) emalloc(sizeof(ibase_result_handle)); ibase_result->result = query_handle; ibase_result->sqlda = osqlda; ibase_result->trans = tr_handle; ibase_result->commitok = 1; - return_value->value.lval = zend_list_insert(ibase_result, php3_ibase_module.le_result); + return_value->value.lval = zend_list_insert(ibase_result, php_ibase_module.le_result); return_value->type = IS_LONG; } else { if (status[0] == 1 && status[1]) { - if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions) { + if (!IBASE_GLOBAL(php_ibase_module).manualtransactions) { isc_rollback_transaction(status, &tr_handle); isc_dsql_free_statement(status, &query_handle, DSQL_drop); RETURN_FALSE; } } else { - if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions) { + if (!IBASE_GLOBAL(php_ibase_module).manualtransactions) { isc_commit_transaction(status, &tr_handle); isc_dsql_free_statement(status, &query_handle, DSQL_drop); RETURN_FALSE; @@ -739,7 +739,7 @@ convert_to_long(result); ibase_result = (ibase_result_handle *) zend_list_find(result->value.lval, &type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_result) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_result) { php_error(E_WARNING,"%d is not an InterBase result index", result->value.lval); RETURN_FALSE; } @@ -841,7 +841,7 @@ isc_decode_date((ISC_QUAD *) var[i].sqldata, t); /* #if HAVE_STRFTIME - collen = (int) strftime(string_data, 255, IBASE_GLOBAL(php3_ibase_module).timeformat, t); + collen = (int) strftime(string_data, 255, IBASE_GLOBAL(php_ibase_module).timeformat, t); #else */ collen = sprintf(string_data, "%4d-%02d-%02d %02d:%02d:%02d", t->tm_year+1900, t->tm_mon+1, t->tm_mday, t->tm_hour, t->tm_min, t->tm_sec); @@ -892,7 +892,7 @@ ibase_result = (ibase_result_handle *) zend_list_find(result->value.lval,&type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_result) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_result) { php_error(E_WARNING,"%d is not an InterBase result index",result->value.lval); RETURN_FALSE; } @@ -920,7 +920,7 @@ if (getParameters(ht, 1, &query) == FAILURE) { RETURN_FALSE; } - id = IBASE_GLOBAL(php3_ibase_module).default_link; + id = IBASE_GLOBAL(php_ibase_module).default_link; break; case 2: if (getParameters(ht, 2, &ibase_link, &query) == FAILURE) { @@ -935,27 +935,27 @@ } db_handle = (isc_db_handle) zend_list_find(id, &type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_link && type!=IBASE_GLOBAL(php3_ibase_module).le_plink) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_link && type!=IBASE_GLOBAL(php_ibase_module).le_plink) { php_error(E_WARNING, "%d is not an InterBase link index", id); RETURN_FALSE; } convert_to_string(query); - if (!IBASE_GLOBAL(php3_ibase_module).manualtransactions) { + if (!IBASE_GLOBAL(php_ibase_module).manualtransactions) { if (isc_start_transaction(status, &tr_handle, 1, &db_handle, 0, NULL)) { php_error(E_WARNING, "InterBase: couldn't start transaction"); RETURN_FALSE; } } - isqlda = _php3_ibase_prepare(db_handle, tr_handle, &query_handle, query->value.str.val); + isqlda = php_ibase_prepare(db_handle, tr_handle, &query_handle, query->value.str.val); ibase_query = (ibase_query_handle *) emalloc(sizeof(ibase_query_handle)); ibase_query->query = query_handle; ibase_query->sqlda = isqlda; ibase_query->trans = tr_handle; ibase_query->alloced = 0; - return_value->value.lval = zend_list_insert(ibase_query, php3_ibase_module.le_query); + return_value->value.lval = zend_list_insert(ibase_query, php_ibase_module.le_query); return_value->type = IS_LONG; } /* }}} */ @@ -980,7 +980,7 @@ ibase_query = (ibase_query_handle *) zend_list_find(query->value.lval,&type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_query) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_query) { php_error(E_WARNING,"%d is not an InterBase query index",query->value.lval); RETURN_FALSE; } @@ -1043,16 +1043,16 @@ ibase_query = (ibase_query_handle *) zend_list_find(query->value.lval,&type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_query) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_query) { php_error(E_WARNING,"%d is not an InterBase query index", query->value.lval); RETURN_FALSE; } - osqlda = _php3_ibase_execute(ibase_query->trans, ibase_query->query, ibase_query->sqlda, status); + osqlda = php_ibase_execute(ibase_query->trans, ibase_query->query, ibase_query->sqlda, status); ibase_result = (ibase_result_handle *) emalloc(sizeof(ibase_result_handle)); ibase_result->result = ibase_query->query; ibase_result->sqlda = osqlda; - return_value->value.lval = zend_list_insert(ibase_result, IBASE_GLOBAL(php3_ibase_module).le_result); + return_value->value.lval = zend_list_insert(ibase_result, IBASE_GLOBAL(php_ibase_module).le_result); return_value->type = IS_LONG; } /* }}} */ @@ -1077,7 +1077,7 @@ ibase_query = (ibase_query_handle *) zend_list_find(query->value.lval, &type); - if (type!=IBASE_GLOBAL(php3_ibase_module).le_query) { + if (type!=IBASE_GLOBAL(php_ibase_module).le_query) { php_error(E_WARNING,"%d is not an InterBase query index", query->value.lval); RETURN_FALSE; } Index: php4/ext/interbase/php_interbase.h diff -u php4/ext/interbase/php_interbase.h:1.2 php4/ext/interbase/php_interbase.h:1.3 --- php4/ext/interbase/php_interbase.h:1.2 Fri Dec 17 15:55:06 1999 +++ php4/ext/interbase/php_interbase.h Fri Dec 17 17:27:23 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_interbase.h,v 1.2 1999/12/17 20:55:06 zeev Exp $ */ +/* $Id: php_interbase.h,v 1.3 1999/12/17 22:27:23 zeev Exp $ */ #ifndef _PHP3_IBASE_H #define _PHP3_IBASE_H @@ -42,7 +42,7 @@ #include <ibase.h> extern zend_module_entry ibase_module_entry; -#define php3_ibase_module_ptr &ibase_module_entry +#define php_ibase_module_ptr &ibase_module_entry extern PHP_MINIT_FUNCTION(ibase); extern PHP_RINIT_FUNCTION(ibase); @@ -72,34 +72,34 @@ char *timeformat; } ibase_module; -typedef struct _php3_ibase_result { +typedef struct _php_ibase_result { isc_stmt_handle result; isc_tr_handle trans; XSQLDA *sqlda; int commitok; } ibase_result_handle; -typedef struct _php3_ibase_query { +typedef struct _php_ibase_query { isc_stmt_handle query; isc_tr_handle trans; XSQLDA *sqlda; int alloced; } ibase_query_handle; -typedef struct _php3_ibase_varchar { +typedef struct _php_ibase_varchar { short var_len; char var_str[1]; } IBASE_VCHAR; -extern ibase_module php3_ibase_module; +extern ibase_module php_ibase_module; #else -#define php3_ibase_module_ptr NULL +#define php_ibase_module_ptr NULL #endif /* HAVE_IBASE */ -#define phpext_interbase_ptr php3_ibase_module_ptr +#define phpext_interbase_ptr php_ibase_module_ptr #endif /* _PHP3_IBASE_H */ Index: php4/ext/oci8/oci8.c diff -u php4/ext/oci8/oci8.c:1.46 php4/ext/oci8/oci8.c:1.47 --- php4/ext/oci8/oci8.c:1.46 Fri Dec 17 15:55:13 1999 +++ php4/ext/oci8/oci8.c Fri Dec 17 17:27:23 1999 @@ -22,7 +22,7 @@ #define OCI_USE_EMALLOC 0 /* set this to 1 if you want to use the php memory manager! */ -/* $Id: oci8.c,v 1.46 1999/12/17 20:55:13 zeev Exp $ */ +/* $Id: oci8.c,v 1.47 1999/12/17 22:27:23 zeev Exp $ */ /* TODO list: * @@ -405,7 +405,7 @@ OCI(debug_mode) = 0; /* start "fresh" */ - oci_debug("php3_rinit_oci8"); + oci_debug("php_rinit_oci8"); return SUCCESS; } @@ -428,7 +428,7 @@ { OCILS_FETCH(); - oci_debug("php3_mshutdown_oci8"); + oci_debug("php_mshutdown_oci8"); zend_hash_apply(OCI(user),(int (*)(void *))_user_pcleanup); zend_hash_apply(OCI(server),(int (*)(void *))_server_pcleanup); @@ -483,7 +483,7 @@ { OCILS_FETCH(); - oci_debug("php3_rshutdown_oci8"); + oci_debug("php_rshutdown_oci8"); zend_hash_apply(OCI(user),(int (*)(void *))_user_cleanup); zend_hash_apply(OCI(server),(int (*)(void *))_server_cleanup); Index: php4/ext/odbc/php_odbc.c diff -u php4/ext/odbc/php_odbc.c:1.17 php4/ext/odbc/php_odbc.c:1.18 --- php4/ext/odbc/php_odbc.c:1.17 Fri Dec 17 15:55:14 1999 +++ php4/ext/odbc/php_odbc.c Fri Dec 17 17:27:25 1999 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_odbc.c,v 1.17 1999/12/17 20:55:14 zeev Exp $ */ +/* $Id: php_odbc.c,v 1.18 1999/12/17 22:27:25 zeev Exp $ */ #if COMPILE_DL #include "dl/phpdl.h" @@ -477,7 +477,7 @@ } while ( SQL_SUCCEEDED( ret )); } -void php3_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode) +void php_odgbc_fetch_attribs(INTERNAL_FUNCTION_PARAMETERS, int mode) { odbc_result *result; pval **pv_res, **pv_flag; @@ -608,7 +608,7 @@ Handle binary column data */ PHP_FUNCTION(odbc_binmode) { - php3_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); + php_odgbc_fetch_attribs(INTERNAL_FUNCTION_PARAM_PASSTHRU,0); } /* }}} */ @@ -616,7 +616,7 @@ Handle LONG columns */ PHP_FUNCTION(odbc_longreadlen) { - php3_odbc_fetch_attribs(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); + php_odgbc_fetch_attribs(INTERNAL_FUNCTION_PARAM_PASSTHRU,1); } /* }}} */ @@ -650,7 +650,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_prepare"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_prepare"); RETURN_FALSE; } @@ -889,7 +889,7 @@ result->stmt, state, &error, errormsg, sizeof(errormsg)-1, &errormsgsize); if (!strncmp(state,"S1015",5)) { - sprintf(cursorname,"php3_curs_%d", (int)result->stmt); + sprintf(cursorname,"php_curs_%d", (int)result->stmt); if (SQLSetCursorName(result->stmt,cursorname,SQL_NTS) != SQL_SUCCESS) { ODBC_SQL_ERROR(result->conn_ptr->henv, result->conn_ptr->hdbc, result->stmt, "SQLSetCursorName"); @@ -2202,7 +2202,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_tables"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_tables"); RETURN_FALSE; } @@ -2284,7 +2284,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_columns"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_columns"); RETURN_FALSE; } @@ -2363,7 +2363,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_columnprivileges"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_columnprivileges"); RETURN_FALSE; } @@ -2461,7 +2461,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_foreignkeys"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_foreignkeys"); RETURN_FALSE; } @@ -2540,7 +2540,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_gettypeinfo"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_gettypeinfo"); RETURN_FALSE; } @@ -2612,7 +2612,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_primarykeys"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_primarykeys"); RETURN_FALSE; } @@ -2694,7 +2694,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_procedurecolumns"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_procedurecolumns"); RETURN_FALSE; } @@ -2776,7 +2776,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_procedures"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_procedures"); RETURN_FALSE; } @@ -2862,7 +2862,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_specialcolumns"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_specialcolumns"); RETURN_FALSE; } @@ -2947,7 +2947,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_statistics"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_statistics"); RETURN_FALSE; } @@ -3025,7 +3025,7 @@ rc = SQLAllocStmt(conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE) { efree(result); - php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_tableprivileges"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in odbc_tableprivileges"); RETURN_FALSE; } Index: php4/ext/odbc/php_velocis.h diff -u php4/ext/odbc/php_velocis.h:1.2 php4/ext/odbc/php_velocis.h:1.3 --- php4/ext/odbc/php_velocis.h:1.2 Fri Dec 17 15:55:14 1999 +++ php4/ext/odbc/php_velocis.h Fri Dec 17 17:27:25 1999 @@ -28,7 +28,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_velocis.h,v 1.2 1999/12/17 20:55:14 zeev Exp $ */ +/* $Id: php_velocis.h,v 1.3 1999/12/17 22:27:25 zeev Exp $ */ #ifndef _PHP_VELOCIS_H #define _PHP_VELOCIS_H @@ -92,7 +92,7 @@ PHP_FUNCTION(velocis_fieldnum); PHP_FUNCTION(velocis_fieldname); -extern velocis_module php3_velocis_module; +extern velocis_module php_velocis_module; #else Index: php4/ext/odbc/velocis.c diff -u php4/ext/odbc/velocis.c:1.11 php4/ext/odbc/velocis.c:1.12 --- php4/ext/odbc/velocis.c:1.11 Fri Dec 17 15:55:14 1999 +++ php4/ext/odbc/velocis.c Fri Dec 17 17:27:25 1999 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: velocis.c,v 1.11 1999/12/17 20:55:14 zeev Exp $ */ +/* $Id: velocis.c,v 1.12 1999/12/17 22:27:25 zeev Exp $ */ /* * TODO: @@ -69,7 +69,7 @@ zend_module_entry *get_module() { return &velocis_module_entry; } #endif -THREAD_LS velocis_module php3_velocis_module; +THREAD_LS velocis_module php_velocis_module; THREAD_LS static HENV henv; static void _close_velocis_link(VConn *conn) @@ -97,12 +97,12 @@ PHP_MINIT_FUNCTION(velocis) { SQLAllocEnv(&henv); - if ( cfg_get_long("velocis.max_links",&php3_velocis_module.max_links) == FAILURE ) { - php3_velocis_module.max_links = -1; + if ( cfg_get_long("velocis.max_links",&php_velocis_module.max_links) == FAILURE ) { + php_velocis_module.max_links = -1; } - php3_velocis_module.num_links = 0; - php3_velocis_module.le_link = register_list_destructors(_close_velocis_link,NULL); - php3_velocis_module.le_result = register_list_destructors(_free_velocis_result,NULL); + php_velocis_module.num_links = 0; + php_velocis_module.le_link = register_list_destructors(_close_velocis_link,NULL); + php_velocis_module.le_result = register_list_destructors(_free_velocis_result,NULL); return SUCCESS; } @@ -131,7 +131,7 @@ { int ind; - ind = zend_list_insert(conn,php3_velocis_module.le_link); + ind = zend_list_insert(conn,php_velocis_module.le_link); conn->hdbc = hdbc; conn->index = ind; @@ -145,7 +145,7 @@ int type; conn = zend_list_find(ind,&type); - if ( !conn || type != php3_velocis_module.le_link ) { + if ( !conn || type != php_velocis_module.le_link ) { return(NULL); } return(conn); @@ -162,7 +162,7 @@ { int ind; - ind = zend_list_insert(res,php3_velocis_module.le_result); + ind = zend_list_insert(res,php_velocis_module.le_result); res->conn = conn; res->index = ind; @@ -176,7 +176,7 @@ int type; res = zend_list_find(ind,&type); - if ( !res || type != php3_velocis_module.le_result ) { + if ( !res || type != php_velocis_module.le_result ) { return(NULL); } return(res); @@ -201,8 +201,8 @@ VConn *new; long ind; - if ( php3_velocis_module.max_links != -1 && php3_velocis_module.num_links == php3_velocis_module.max_links ) { - php_error(E_WARNING,"Velocis: Too many open connections (%d)",php3_velocis_module.num_links); + if ( php_velocis_module.max_links != -1 && php_velocis_module.num_links == php_velocis_module.max_links ) { + php_error(E_WARNING,"Velocis: Too many open connections (%d)",php_velocis_module.num_links); RETURN_FALSE; } if ( ARG_COUNT(ht) != 3 || @@ -233,7 +233,7 @@ RETURN_FALSE; } ind = velocis_add_conn(list,new,hdbc); - php3_velocis_module.num_links++; + php_velocis_module.num_links++; RETURN_LONG(ind); } @@ -254,7 +254,7 @@ SQLDisconnect(conn->hdbc); SQLFreeConnect(conn->hdbc); velocis_del_conn(list,id->value.lval); - php3_velocis_module.num_links--; + php_velocis_module.num_links--; RETURN_TRUE; }

« previous php.version4 (#8104) next »