diff options
author | Zeev Suraski <zeev@php.net> | 1999-08-02 19:17:14 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-08-02 19:17:14 +0000 |
commit | 3cb1eb047187d53688545ae6f64d4df880298e72 (patch) | |
tree | 7fb20f178b9df5a33a83a2b7537f5614910697c0 /ext/odbc | |
parent | 07e0885519ccabbd9cebfce7223be657171a6629 (diff) | |
download | php-git-3cb1eb047187d53688545ae6f64d4df880298e72.tar.gz |
Removed '3' from key functions in PHP (maintained compatibility through
php3_compat.h)
Diffstat (limited to 'ext/odbc')
-rw-r--r-- | ext/odbc/odbc.c | 174 | ||||
-rw-r--r-- | ext/odbc/velocis.c | 66 |
2 files changed, 120 insertions, 120 deletions
diff --git a/ext/odbc/odbc.c b/ext/odbc/odbc.c index c32ca5cc26..fa39583bb7 100644 --- a/ext/odbc/odbc.c +++ b/ext/odbc/odbc.c @@ -146,7 +146,7 @@ static void _close_connection(odbc_connection *conn) ODBC_TLS_VARS; conn->open = 0; - _php3_hash_apply(ODBCG(resource_list), + zend_hash_apply(ODBCG(resource_list), (int (*)(void *))_results_cleanup); SQLDisconnect(conn->hdbc); SQLFreeConnect(conn->hdbc); @@ -161,7 +161,7 @@ static void _close_pconnection(odbc_connection *conn) conn->open = 0; - _php3_hash_apply(ODBCG(resource_plist), + zend_hash_apply(ODBCG(resource_plist), (int (*)(void *))_results_cleanup); SQLDisconnect(conn->hdbc); @@ -280,16 +280,16 @@ PHP_MINFO_FUNCTION(odbc) { ODBC_TLS_VARS; - php3_printf("ODBC compiled with \"" ODBC_TYPE "\" library"); - php3_printf("<BR>"); + php_printf("ODBC compiled with \"" ODBC_TYPE "\" library"); + php_printf("<BR>"); #if DEBUG - php3_printf("default_db: %s<br>\n", ODBCG(defDB)); - php3_printf("default_user: %s<br>\n", ODBCG(defUser)); - php3_printf("default_pw: %s<br>\n", ODBCG(defPW)); + php_printf("default_db: %s<br>\n", ODBCG(defDB)); + php_printf("default_user: %s<br>\n", ODBCG(defUser)); + php_printf("default_pw: %s<br>\n", ODBCG(defPW)); #endif - php3_printf("allow_persistent: %d<br>\n", ODBCG(allow_persistent)); - php3_printf("max_persistent: %d<br>\n", ODBCG(max_persistent)); - php3_printf("max_links: %d<br>\n", ODBCG(max_links)); + php_printf("allow_persistent: %d<br>\n", ODBCG(allow_persistent)); + php_printf("max_persistent: %d<br>\n", ODBCG(max_persistent)); + php_printf("max_links: %d<br>\n", ODBCG(max_links)); } @@ -312,7 +312,7 @@ odbc_result *odbc_get_result(HashTable *list, int ind) res = (odbc_result*)php3_list_find(ind, &type); if (!res || type != ODBCG(le_result)) { - php3_error(E_WARNING, "Bad result index %d", ind); + php_error(E_WARNING, "Bad result index %d", ind); return NULL; } return res; @@ -326,7 +326,7 @@ void odbc_del_result(HashTable *list, int ind) res = (odbc_result *)php3_list_find(ind, &type); if (!res || type != ODBCG(le_result)) { - php3_error(E_WARNING,"Can't find result %d", ind); + php_error(E_WARNING,"Can't find result %d", ind); return; } php3_list_delete(ind); @@ -350,7 +350,7 @@ odbc_connection *odbc_get_conn(HashTable *list, int ind) if (conn && (type == ODBCG(le_conn) || type == ODBCG(le_pconn))) return conn; - php3_error(E_WARNING,"Bad ODBC connection number (%d)", ind); + php_error(E_WARNING,"Bad ODBC connection number (%d)", ind); return NULL; } @@ -369,10 +369,10 @@ void ODBC_SQL_ERROR(HDBC conn, HSTMT stmt, char *func) SQLError(ODBCG(henv), conn, stmt, state, &error, errormsg, sizeof(errormsg)-1, &errormsgsize); if (func) { - php3_error(E_WARNING, "SQL error: %s, SQL state %s in %s", + php_error(E_WARNING, "SQL error: %s, SQL state %s in %s", errormsg, state, func); } else { - php3_error(E_WARNING, "SQL error: %s, SQL state %s", + php_error(E_WARNING, "SQL error: %s, SQL state %s", errormsg, state); } } @@ -384,7 +384,7 @@ PHP_FUNCTION(odbc_close_all) { void *ptr; int type; - int i, nument = _php3_hash_next_free_element(list); + int i, nument = zend_hash_next_free_element(list); ODBC_TLS_VARS; for (i = 1; i < nument; i++) { @@ -457,7 +457,7 @@ int odbc_bindcols(odbc_result *result) emalloc(sizeof(odbc_result_value)*result->numcols); if (result->values == NULL){ - php3_error(E_WARNING, "Out of memory"); + php_error(E_WARNING, "Out of memory"); SQLFreeStmt(result->stmt, SQL_DROP); return 0; } @@ -534,7 +534,7 @@ PHP_FUNCTION(odbc_prepare) result = (odbc_result *)emalloc(sizeof(odbc_result)); if (result == NULL){ - php3_error(E_WARNING, "Out of memory"); + php_error(E_WARNING, "Out of memory"); RETURN_FALSE; } @@ -543,7 +543,7 @@ PHP_FUNCTION(odbc_prepare) rc = SQLAllocStmt(curr_conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE){ efree(result); - php3_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_prepare"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in php3_odbc_prepare"); RETURN_FALSE; } @@ -606,7 +606,7 @@ PHP_FUNCTION(odbc_execute) arr = *arg2; if (arr.type != IS_ARRAY) { - php3_error(E_WARNING, "No array passed to odbc_execute()"); + php_error(E_WARNING, "No array passed to odbc_execute()"); return; } } @@ -620,33 +620,33 @@ PHP_FUNCTION(odbc_execute) } if (result->numparams > 0 && numArgs == 1) { - php3_error(E_WARNING, "No parameters to SQL statement given"); + php_error(E_WARNING, "No parameters to SQL statement given"); RETURN_FALSE; } if (result->numparams > 0){ - if ((ne = _php3_hash_num_elements(arr.value.ht)) < result->numparams){ - php3_error(E_WARNING,"Not enough parameters (%d should be %d) given", + if ((ne = zend_hash_num_elements(arr.value.ht)) < result->numparams){ + php_error(E_WARNING,"Not enough parameters (%d should be %d) given", ne, result->numparams); RETURN_FALSE; } pval_copy_constructor(arg2); - _php3_hash_internal_pointer_reset(arr.value.ht); + zend_hash_internal_pointer_reset(arr.value.ht); params = (params_t *)emalloc(sizeof(params_t) * result->numparams); for (i = 1; i <= result->numparams; i++) { - if (_php3_hash_get_current_data(arr.value.ht, (void **) &tmp) == FAILURE) { - php3_error(E_WARNING,"Error getting parameter"); + if (zend_hash_get_current_data(arr.value.ht, (void **) &tmp) == FAILURE) { + php_error(E_WARNING,"Error getting parameter"); SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); efree(params); RETURN_FALSE; } convert_to_string(tmp); if (tmp->type != IS_STRING) { - php3_error(E_WARNING,"Error converting parameter"); + php_error(E_WARNING,"Error converting parameter"); SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); - _php3_hash_destroy(arr.value.ht); + zend_hash_destroy(arr.value.ht); efree(arr.value.ht); efree(params); RETURN_FALSE; @@ -663,14 +663,14 @@ PHP_FUNCTION(odbc_execute) filename[tmp->value.str.len - 2] = '\0'; if ((params[i-1].fp = open(filename,O_RDONLY)) == -1) { - php3_error(E_WARNING,"Can't open file %s", filename); + php_error(E_WARNING,"Can't open file %s", filename); SQLFreeStmt(result->stmt, SQL_RESET_PARAMS); for (i = 0; i < result->numparams; i++) { if (params[i].fp != -1) { close(params[i].fp); } } - _php3_hash_destroy(arr.value.ht); + zend_hash_destroy(arr.value.ht); efree(arr.value.ht); efree(params); RETURN_FALSE; @@ -684,9 +684,9 @@ PHP_FUNCTION(odbc_execute) ¶ms[i-1].vallen); } else { /*if (IS_SQL_BINARY(sqltype)){ - php3_error(E_WARNING,"No Filename for binary parameter"); + php_error(E_WARNING,"No Filename for binary parameter"); SQLFreeStmt(result->stmt,SQL_RESET_PARAMS); - _php3_hash_destroy(arr.value.ht); + zend_hash_destroy(arr.value.ht); efree(arr.value.ht); efree(params); RETURN_FALSE; @@ -697,7 +697,7 @@ PHP_FUNCTION(odbc_execute) tmp->value.str.val, 0, ¶ms[i-1].vallen); } - _php3_hash_move_forward(arr.value.ht); + zend_hash_move_forward(arr.value.ht); } } /* Close cursor, needed for doing multiple selects */ @@ -733,7 +733,7 @@ PHP_FUNCTION(odbc_execute) if (params[i].fp != -1) close(params[i].fp); } - _php3_hash_destroy(arr.value.ht); + zend_hash_destroy(arr.value.ht); efree(arr.value.ht); efree(params); } @@ -777,7 +777,7 @@ PHP_FUNCTION(odbc_cursor) if (max_len > 0){ cursorname = emalloc(max_len + 1); if (cursorname == NULL){ - php3_error(E_WARNING,"Out of memory"); + php_error(E_WARNING,"Out of memory"); RETURN_FALSE; } rc = SQLGetCursorName(result->stmt,cursorname,(SWORD)max_len,&len); @@ -801,7 +801,7 @@ PHP_FUNCTION(odbc_cursor) RETVAL_STRING(cursorname,1); } } else { - php3_error(E_WARNING, "SQL error: %s, SQL state %s", errormsg, state); + php_error(E_WARNING, "SQL error: %s, SQL state %s", errormsg, state); RETVAL_FALSE; } } else { @@ -846,13 +846,13 @@ PHP_FUNCTION(odbc_exec) result = (odbc_result *)emalloc(sizeof(odbc_result)); if (result == NULL){ - php3_error(E_WARNING, "Out of memory"); + php_error(E_WARNING, "Out of memory"); RETURN_FALSE; } rc = SQLAllocStmt(curr_conn->hdbc, &(result->stmt)); if (rc == SQL_INVALID_HANDLE){ - php3_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in PHP3_ODBC_DO"); + php_error(E_WARNING, "SQLAllocStmt error 'Invalid Handle' in PHP3_ODBC_DO"); efree(result); RETURN_FALSE; } @@ -946,7 +946,7 @@ PHP_FUNCTION(odbc_fetch_into) } if (!ParameterPassedByReference(ht, numArgs)){ - php3_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()"); + php_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()"); RETURN_FALSE; } #else @@ -959,7 +959,7 @@ PHP_FUNCTION(odbc_fetch_into) } if (!ParameterPassedByReference(ht, numArgs)){ - php3_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()"); + php_error(E_WARNING, "Array not passed by reference in call to odbc_fetch_into()"); RETURN_FALSE; } #endif @@ -973,13 +973,13 @@ PHP_FUNCTION(odbc_fetch_into) } if (result->numcols == 0) { - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } if (arr->type != IS_ARRAY){ if (array_init(arr) == FAILURE){ - php3_error(E_WARNING, "Can't convert to type Array"); + php_error(E_WARNING, "Can't convert to type Array"); RETURN_FALSE; } } @@ -1055,7 +1055,7 @@ PHP_FUNCTION(odbc_fetch_into) tmp.value.str.val = estrndup(result->values[i].value,tmp.value.str.len); break; } - _php3_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval), NULL); + zend_hash_index_update(arr->value.ht, i, (void *) &tmp, sizeof(pval), NULL); } if (buf) efree(buf); RETURN_LONG(result->numcols); @@ -1082,7 +1082,7 @@ PHP_FUNCTION(solid_fetch_prev) } if (result->numcols == 0) { - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } rc = SQLFetchPrev(result->stmt); @@ -1131,7 +1131,7 @@ PHP_FUNCTION(odbc_fetch_row) } if (result->numcols == 0) { - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } @@ -1200,7 +1200,7 @@ PHP_FUNCTION(odbc_result) } if ((result->numcols == 0)){ - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } @@ -1214,13 +1214,13 @@ PHP_FUNCTION(odbc_result) } if (field_ind < 0){ - php3_error(E_WARNING, "Field %s not found", field); + php_error(E_WARNING, "Field %s not found", field); RETURN_FALSE; } } else { /* check for limits of field_ind if the field parameter was an int */ if (field_ind >= result->numcols || field_ind < 0){ - php3_error(E_WARNING, "Field index is larger than the number of fields"); + php_error(E_WARNING, "Field index is larger than the number of fields"); RETURN_FALSE; } } @@ -1263,7 +1263,7 @@ PHP_FUNCTION(odbc_result) fieldsize = (result->longreadlen <= 0) ? 4096 : result->longreadlen; field = emalloc(fieldsize); if (!field){ - php3_error(E_WARNING, "Out of memory"); + php_error(E_WARNING, "Out of memory"); RETURN_FALSE; } /* SQLGetData will truncate CHAR data to fieldsize - 1 bytes and append \0. @@ -1307,7 +1307,7 @@ PHP_FUNCTION(odbc_result) /* We emalloc 1 byte more for SQL_C_CHAR (trailing \0) */ fieldsize = (sql_c_type == SQL_C_CHAR) ? 4096 : 4095; if ((field = emalloc(fieldsize)) == NULL){ - php3_error(E_WARNING,"Out of memory"); + php_error(E_WARNING,"Out of memory"); RETURN_FALSE; } @@ -1373,7 +1373,7 @@ PHP_FUNCTION(odbc_result_all) } if (result->numcols == 0){ - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } #if HAVE_SQL_EXTENDED_FETCH @@ -1384,26 +1384,26 @@ PHP_FUNCTION(odbc_result_all) rc = SQLFetch(result->stmt); if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO){ - php3_printf("<h2>No rows found</h2>\n"); + php_printf("<h2>No rows found</h2>\n"); RETURN_LONG(0); } /* Start table tag */ if (numArgs == 1){ - php3_printf("<table><tr>"); + php_printf("<table><tr>"); } else { convert_to_string(arg2); - php3_printf("<table %s ><tr>",arg2->value.str.val); + php_printf("<table %s ><tr>",arg2->value.str.val); } for(i = 0; i < result->numcols; i++) - php3_printf("<th>%s</th>", result->values[i].name); + php_printf("<th>%s</th>", result->values[i].name); - php3_printf("</tr>\n"); + php_printf("</tr>\n"); while(rc == SQL_SUCCESS || rc == SQL_SUCCESS_WITH_INFO){ result->fetched++; - php3_printf("<tr>"); + php_printf("<tr>"); for(i = 0; i < result->numcols; i++){ sql_c_type = SQL_C_CHAR; switch(result->values[i].coltype){ @@ -1411,14 +1411,14 @@ PHP_FUNCTION(odbc_result_all) case SQL_VARBINARY: case SQL_LONGVARBINARY: if (result->binmode <= 0){ - php3_printf("<td>Not printable</td>"); + php_printf("<td>Not printable</td>"); break; } if (result->binmode <= 1) sql_c_type = SQL_C_BINARY; case SQL_LONGVARCHAR: if (IS_SQL_LONG(result->values[i].coltype) && result->longreadlen <= 0){ - php3_printf("<td>Not printable</td>"); + php_printf("<td>Not printable</td>"); break; } @@ -1427,37 +1427,37 @@ PHP_FUNCTION(odbc_result_all) rc = SQLGetData(result->stmt, (UWORD)(i + 1),sql_c_type, buf, result->longreadlen, &result->values[i].vallen); - php3_printf("<td>"); + php_printf("<td>"); if (rc == SQL_ERROR) { ODBC_SQL_ERROR(result->conn_ptr->hdbc, result->stmt, "SQLGetData"); - php3_printf("</td></tr></table>"); + php_printf("</td></tr></table>"); efree(buf); RETURN_FALSE; } if (rc == SQL_SUCCESS_WITH_INFO) - php3_printf(buf,result->longreadlen); + php_printf(buf,result->longreadlen); else if (result->values[i].vallen == SQL_NULL_DATA){ - php3_printf(" </td>"); + php_printf(" </td>"); break; } else { - php3_printf(buf, result->values[i].vallen); + php_printf(buf, result->values[i].vallen); } - php3_printf("</td>"); + php_printf("</td>"); break; default: if (result->values[i].vallen == SQL_NULL_DATA){ - php3_printf("<td> </td>"); + php_printf("<td> </td>"); } else { - php3_printf("<td>%s</td>", result->values[i].value); + php_printf("<td>%s</td>", result->values[i].value); } break; } } - php3_printf("</tr>\n"); + php_printf("</tr>\n"); #if HAVE_SQL_EXTENDED_FETCH if (result->fetch_abs) @@ -1466,7 +1466,7 @@ PHP_FUNCTION(odbc_result_all) #endif rc = SQLFetch(result->stmt); } - php3_printf("</table>\n"); + php_printf("</table>\n"); if (buf) efree(buf); RETURN_LONG(result->fetched); } @@ -1556,7 +1556,7 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) cur_opt == SQL_CUR_USE_ODBC || cur_opt == SQL_CUR_USE_DRIVER || cur_opt == SQL_CUR_DEFAULT) ) { - php3_error(E_WARNING, "odbc: Invalid Cursor type (%d)", cur_opt); + php_error(E_WARNING, "odbc: Invalid Cursor type (%d)", cur_opt); RETURN_FALSE; } break; @@ -1578,14 +1578,14 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } if (ODBCG(max_links) != -1 && ODBCG(num_links) >= ODBCG(max_links)) { - php3_error(E_WARNING, "odbc: Too many open links (%d)", + php_error(E_WARNING, "odbc: Too many open links (%d)", ODBCG(num_links)); RETURN_FALSE; } /* the user requested a persistent connection */ if (persistent && ODBCG(max_persistent) != -1 && ODBCG(num_persistent) >= ODBCG(max_persistent)) { - php3_error(E_WARNING,"odbc: Too many open persistent links (%d)", + php_error(E_WARNING,"odbc: Too many open persistent links (%d)", ODBCG(num_persistent)); RETURN_FALSE; } @@ -1594,11 +1594,11 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) hashed_details = emalloc(len); if (hashed_details == NULL) { - php3_error(E_WARNING, "Out of memory"); + php_error(E_WARNING, "Out of memory"); RETURN_FALSE; } - hashed_len = _php3_sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); + hashed_len = php_sprintf(hashed_details, "%s_%s_%s_%s_%d", ODBC_TYPE, db, uid, pwd, cur_opt); /* FIXME the idea of checking to see if our connection is already persistent is good, but it adds a lot of overhead to non-persistent connections. We @@ -1607,9 +1607,9 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) * no matter if it is to be persistent or not */ - if ((persistent || (_php3_hash_find(list, hashed_details, hashed_len + 1, + if ((persistent || (zend_hash_find(list, hashed_details, hashed_len + 1, (void **) &index_ptr) == FAILURE || !php3_list_find((int) index_ptr->ptr, &type))) && - _php3_hash_find(plist, hashed_details, hashed_len + 1, + zend_hash_find(plist, hashed_details, hashed_len + 1, (void **) &index_ptr) == FAILURE) { /* the link is not in the persistent list */ list_entry new_le, new_index_ptr; @@ -1713,7 +1713,7 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) #else new_index_ptr.type = le_index_ptr; #endif - if (_php3_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr, + if (zend_hash_update(plist,hashed_details,hashed_len + 1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { SQLDisconnect(db_conn->hdbc); SQLFreeConnect(db_conn->hdbc); @@ -1733,7 +1733,7 @@ void php3_odbc_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) #else new_index_ptr.type = le_index_ptr; #endif - if (_php3_hash_update(list,hashed_details,hashed_len + 1,(void *) &new_index_ptr, + if (zend_hash_update(list,hashed_details,hashed_len + 1,(void *) &new_index_ptr, sizeof(list_entry),NULL)==FAILURE) { SQLDisconnect(db_conn->hdbc); SQLFreeConnect(db_conn->hdbc); @@ -1868,17 +1868,17 @@ PHP_FUNCTION(odbc_field_name) } if (result->numcols == 0){ - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } if (arg2->value.lval > result->numcols){ - php3_error(E_WARNING, "Field index larger than number of fields"); + php_error(E_WARNING, "Field index larger than number of fields"); RETURN_FALSE; } if (arg2->value.lval < 1){ - php3_error(E_WARNING, "Field numbering starts at 1"); + php_error(E_WARNING, "Field numbering starts at 1"); RETURN_FALSE; } @@ -1907,12 +1907,12 @@ PHP_FUNCTION(odbc_field_type) } if (result->numcols == 0){ - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } if (arg2->value.lval > result->numcols){ - php3_error(E_WARNING, "Field index larger than number of fields"); + php_error(E_WARNING, "Field index larger than number of fields"); RETURN_FALSE; } @@ -1942,12 +1942,12 @@ PHP_FUNCTION(odbc_field_len) } if (result->numcols == 0){ - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } if (arg2->value.lval > result->numcols){ - php3_error(E_WARNING, "Field index larger than number of fields"); + php_error(E_WARNING, "Field index larger than number of fields"); RETURN_FALSE; } SQLColAttributes(result->stmt, (UWORD)arg2->value.lval, @@ -1976,7 +1976,7 @@ PHP_FUNCTION(odbc_field_num) fname = arg2->value.str.val; if (arg1->value.lval == 1){ - php3_error(E_WARNING, "No tuples available at this result index"); + php_error(E_WARNING, "No tuples available at this result index"); RETURN_FALSE; } if ((result = odbc_get_result(list, arg1->value.lval)) == NULL) { @@ -2129,7 +2129,7 @@ PHP_FUNCTION(odbc_setoption) } break; default: - php3_error(E_WARNING, "Unknown option type"); + php_error(E_WARNING, "Unknown option type"); RETURN_FALSE; break; } diff --git a/ext/odbc/velocis.c b/ext/odbc/velocis.c index d03f025576..51fca53980 100644 --- a/ext/odbc/velocis.c +++ b/ext/odbc/velocis.c @@ -101,7 +101,7 @@ PHP_RINIT_FUNCTION(velocis) PHP_MINFO_FUNCTION(velocis) { - php3_printf("RAIMA Velocis Support Active"); + php_printf("RAIMA Velocis Support Active"); } PHP_MSHUTDOWN_FUNCTION(velocis) @@ -188,7 +188,7 @@ PHP_FUNCTION(velocis_connect) long ind; if ( php3_velocis_module.max_links != -1 && php3_velocis_module.num_links == php3_velocis_module.max_links ) { - php3_error(E_WARNING,"Velocis: Too many open connections (%d)",php3_velocis_module.num_links); + php_error(E_WARNING,"Velocis: Too many open connections (%d)",php3_velocis_module.num_links); RETURN_FALSE; } if ( ARG_COUNT(ht) != 3 || @@ -203,18 +203,18 @@ PHP_FUNCTION(velocis_connect) Pass = pass->value.str.val; stat = SQLAllocConnect(henv,&hdbc); if ( stat != SQL_SUCCESS ) { - php3_error(E_WARNING,"Velocis: Could not allocate connection handle"); + php_error(E_WARNING,"Velocis: Could not allocate connection handle"); RETURN_FALSE; } stat = SQLConnect(hdbc,Serv,SQL_NTS,User,SQL_NTS,Pass,SQL_NTS); if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: Could not connect to server \"%s\" for %s",Serv,User); + php_error(E_WARNING,"Velocis: Could not connect to server \"%s\" for %s",Serv,User); SQLFreeConnect(hdbc); RETURN_FALSE; } new = (VConn *)emalloc(sizeof(VConn)); if ( new == NULL ) { - php3_error(E_WARNING,"Velocis: Out of memory for store connection"); + php_error(E_WARNING,"Velocis: Out of memory for store connection"); SQLFreeConnect(hdbc); RETURN_FALSE; } @@ -234,7 +234,7 @@ PHP_FUNCTION(velocis_close) convert_to_long(id); conn = velocis_find_conn(list,id->value.lval); if ( !conn ) { - php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); + php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); RETURN_FALSE; } SQLDisconnect(conn->hdbc); @@ -261,7 +261,7 @@ PHP_FUNCTION(velocis_exec) convert_to_long(ind); conn = velocis_find_conn(list,ind->value.lval); if ( !conn ) { - php3_error(E_WARNING,"Velocis: Not connection index (%d)",ind->value.lval); + php_error(E_WARNING,"Velocis: Not connection index (%d)",ind->value.lval); RETURN_FALSE; } convert_to_string(exec_str); @@ -269,18 +269,18 @@ PHP_FUNCTION(velocis_exec) res = (Vresult *)emalloc(sizeof(Vresult)); if ( res == NULL ) { - php3_error(E_WARNING,"Velocis: Out of memory for result"); + php_error(E_WARNING,"Velocis: Out of memory for result"); RETURN_FALSE; } stat = SQLAllocStmt(conn->hdbc,&res->hstmt); if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: SQLAllocStmt return %d",stat); + php_error(E_WARNING,"Velocis: SQLAllocStmt return %d",stat); efree(res); RETURN_FALSE; } stat = SQLExecDirect(res->hstmt,query,SQL_NTS); if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: Can not execute \"%s\" query",query); + php_error(E_WARNING,"Velocis: Can not execute \"%s\" query",query); SQLFreeStmt(res->hstmt,SQL_DROP); efree(res); RETURN_FALSE; @@ -288,7 +288,7 @@ PHP_FUNCTION(velocis_exec) /* Success query */ stat = SQLNumResultCols(res->hstmt,&cols); if ( stat != SQL_SUCCESS ) { - php3_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat); + php_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat); SQLFreeStmt(res->hstmt,SQL_DROP); efree(res); RETURN_FALSE; @@ -296,7 +296,7 @@ PHP_FUNCTION(velocis_exec) if ( !cols ) { /* Was INSERT, UPDATE, DELETE, etc. query */ stat = SQLRowCount(res->hstmt,&rows); if ( stat != SQL_SUCCESS ) { - php3_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat); + php_error(E_WARNING,"Velocis: SQLNumResultCols return %d",stat); SQLFreeStmt(res->hstmt,SQL_DROP); efree(res); RETURN_FALSE; @@ -307,7 +307,7 @@ PHP_FUNCTION(velocis_exec) } else { /* Was SELECT query */ res->values = (VResVal *)emalloc(sizeof(VResVal)*cols); if ( res->values == NULL ) { - php3_error(E_WARNING,"Velocis: Out of memory for result columns"); + php_error(E_WARNING,"Velocis: Out of memory for result columns"); SQLFreeStmt(res->hstmt,SQL_DROP); efree(res); RETURN_FALSE; @@ -356,7 +356,7 @@ PHP_FUNCTION(velocis_fetch) convert_to_long(ind); res = velocis_find_result(list,ind->value.lval); if ( !res ) { - php3_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval); + php_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval); RETURN_FALSE; } stat = SQLExtendedFetch(res->hstmt,SQL_FETCH_NEXT,1,&row,RowStat); @@ -366,7 +366,7 @@ PHP_FUNCTION(velocis_fetch) RETURN_FALSE; } if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: SQLFetch return error"); + php_error(E_WARNING,"Velocis: SQLFetch return error"); SQLFreeStmt(res->hstmt,SQL_DROP); velocis_del_result(list,ind->value.lval); RETURN_FALSE; @@ -392,7 +392,7 @@ PHP_FUNCTION(velocis_result) convert_to_long(ind); res = velocis_find_result(list,ind->value.lval); if ( !res ) { - php3_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); + php_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); RETURN_FALSE; } if ( col->type == IS_STRING ) { @@ -409,12 +409,12 @@ PHP_FUNCTION(velocis_result) } } if ( indx < 0 ) { - php3_error(E_WARNING, "Field %s not found",field); + php_error(E_WARNING, "Field %s not found",field); RETURN_FALSE; } } else { if ( indx < 0 || indx >= res->numcols ) { - php3_error(E_WARNING,"Velocis: Field index not in range"); + php_error(E_WARNING,"Velocis: Field index not in range"); RETURN_FALSE; } } @@ -426,7 +426,7 @@ PHP_FUNCTION(velocis_result) RETURN_FALSE; } if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: SQLFetch return error"); + php_error(E_WARNING,"Velocis: SQLFetch return error"); SQLFreeStmt(res->hstmt,SQL_DROP); velocis_del_result(list,ind->value.lval); RETURN_FALSE; @@ -443,7 +443,7 @@ l1: if ( !res->values[indx].value ) { res->values[indx].value = emalloc(4096); if ( !res->values[indx].value ) { - php3_error(E_WARNING,"Out of memory"); + php_error(E_WARNING,"Out of memory"); RETURN_FALSE; } } @@ -455,7 +455,7 @@ l1: RETURN_FALSE; } if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: SQLGetData return error"); + php_error(E_WARNING,"Velocis: SQLGetData return error"); SQLFreeStmt(res->hstmt,SQL_DROP); velocis_del_result(list,ind->value.lval); RETURN_FALSE; @@ -483,7 +483,7 @@ PHP_FUNCTION(velocis_freeresult) convert_to_long(ind); res = velocis_find_result(list,ind->value.lval); if ( !res ) { - php3_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval); + php_error(E_WARNING,"Velocis: Not result index (%d)",ind->value.lval); RETURN_FALSE; } SQLFreeStmt(res->hstmt,SQL_DROP); @@ -503,12 +503,12 @@ PHP_FUNCTION(velocis_autocommit) convert_to_long(id); conn = velocis_find_conn(list,id->value.lval); if ( !conn ) { - php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); + php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); RETURN_FALSE; } stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_ON); if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: Set autocommit_on option failure"); + php_error(E_WARNING,"Velocis: Set autocommit_on option failure"); RETURN_FALSE; } RETURN_TRUE; @@ -526,12 +526,12 @@ PHP_FUNCTION(velocis_off_autocommit) convert_to_long(id); conn = velocis_find_conn(list,id->value.lval); if ( !conn ) { - php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); + php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); RETURN_FALSE; } stat = SQLSetConnectOption(conn->hdbc,SQL_AUTOCOMMIT,SQL_AUTOCOMMIT_OFF); if ( stat != SQL_SUCCESS && stat != SQL_SUCCESS_WITH_INFO ) { - php3_error(E_WARNING,"Velocis: Set autocommit_off option failure"); + php_error(E_WARNING,"Velocis: Set autocommit_off option failure"); RETURN_FALSE; } RETURN_TRUE; @@ -549,12 +549,12 @@ PHP_FUNCTION(velocis_commit) convert_to_long(id); conn = velocis_find_conn(list,id->value.lval); if ( !conn ) { - php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); + php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); RETURN_FALSE; } stat = SQLTransact(NULL,conn->hdbc,SQL_COMMIT); if ( stat != SQL_SUCCESS ) { - php3_error(E_WARNING,"Velocis: Commit failure"); + php_error(E_WARNING,"Velocis: Commit failure"); RETURN_FALSE; } RETURN_TRUE; @@ -572,12 +572,12 @@ PHP_FUNCTION(velocis_rollback) convert_to_long(id); conn = velocis_find_conn(list,id->value.lval); if ( !conn ) { - php3_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); + php_error(E_WARNING,"Velocis: Not connection index (%d)",id->value.lval); RETURN_FALSE; } stat = SQLTransact(NULL,conn->hdbc,SQL_ROLLBACK); if ( stat != SQL_SUCCESS ) { - php3_error(E_WARNING,"Velocis: Rollback failure"); + php_error(E_WARNING,"Velocis: Rollback failure"); RETURN_FALSE; } RETURN_TRUE; @@ -595,13 +595,13 @@ PHP_FUNCTION(velocis_fieldname) convert_to_long(ind); res = velocis_find_result(list,ind->value.lval); if ( !res ) { - php3_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); + php_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); RETURN_FALSE; } convert_to_long(col); indx = col->value.lval; if ( indx < 0 || indx >= res->numcols ) { - php3_error(E_WARNING,"Velocis: Field index not in range"); + php_error(E_WARNING,"Velocis: Field index not in range"); RETURN_FALSE; } RETURN_STRING(res->values[indx].name,TRUE); @@ -618,7 +618,7 @@ PHP_FUNCTION(velocis_fieldnum) convert_to_long(ind); res = velocis_find_result(list,ind->value.lval); if ( !res ) { - php3_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); + php_error(E_WARNING,"Velocis: Not result index (%d),ind->value.lval"); RETURN_FALSE; } RETURN_LONG(res->numcols); |