diff options
author | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-12-13 23:06:14 +0100 |
commit | bdeb220f48825642f84cdbf3ff23a30613c92e86 (patch) | |
tree | 1a6cf34d20420e4815b4becb21311a4457d84103 /ext/mssql | |
parent | bb66f385d09e7e55390e9f57fcbca08f6b43ff91 (diff) | |
download | php-git-bdeb220f48825642f84cdbf3ff23a30613c92e86.tar.gz |
first shot remove TSRMLS_* things
Diffstat (limited to 'ext/mssql')
-rw-r--r-- | ext/mssql/php_mssql.c | 169 | ||||
-rw-r--r-- | ext/mssql/php_mssql.h | 2 |
2 files changed, 84 insertions, 87 deletions
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c index 1ba77ca8c4..f4dee9a0f1 100644 --- a/ext/mssql/php_mssql.c +++ b/ext/mssql/php_mssql.c @@ -42,8 +42,8 @@ static int le_result, le_link, le_plink, le_statement; -static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC); -static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC); +static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type); +static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type); static void _mssql_bind_hash_dtor(void *data); @@ -210,14 +210,13 @@ zend_module_entry mssql_module_entry = ZEND_GET_MODULE(mssql) #endif -#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } } +#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL, E_WARNING, "A link to the server could not be established"); RETURN_FALSE; } } /* {{{ PHP_INI_DISP */ static PHP_INI_DISP(display_text_size) { char *value; - TSRMLS_FETCH(); if (type == PHP_INI_DISPLAY_ORIG && ini_entry->modified) { value = ini_entry->orig_value; @@ -266,10 +265,9 @@ PHP_INI_END() /* error handler */ static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, int oserr, char *dberrstr, char *oserrstr) { - TSRMLS_FETCH(); if (severity >= MS_SQL_G(min_error_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (severity %d)", dberrstr, severity); + php_error_docref(NULL, E_WARNING, "%s (severity %d)", dberrstr, severity); } return INT_CANCEL; } @@ -279,10 +277,9 @@ static int php_mssql_error_handler(DBPROCESS *dbproc, int severity, int dberr, i /* message handler */ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate, int severity,char *msgtext,char *srvname, char *procname,DBUSMALLINT line) { - TSRMLS_FETCH(); if (severity >= MS_SQL_G(min_message_severity)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "message: %s (severity %d)", msgtext, severity); + php_error_docref(NULL, E_WARNING, "message: %s (severity %d)", msgtext, severity); } if (MS_SQL_G(server_message)) { zend_string_free(MS_SQL_G(server_message)); @@ -295,7 +292,7 @@ static int php_mssql_message_handler(DBPROCESS *dbproc, DBINT msgno,int msgstate /* {{{ _clean_invalid_results */ -static int _clean_invalid_results(zend_rsrc_list_entry *le TSRMLS_DC) +static int _clean_invalid_results(zend_rsrc_list_entry *le) { if (Z_TYPE_P(le) == le_result) { mssql_link *mssql_ptr = ((mssql_result *) le->ptr)->mssql_ptr; @@ -340,7 +337,7 @@ static void _free_result(mssql_result *result, int free_fields) /* {{{ _free_mssql_statement */ -static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _free_mssql_statement(zend_rsrc_list_entry *rsrc) { mssql_statement *statement = (mssql_statement *)rsrc->ptr; @@ -355,7 +352,7 @@ static void _free_mssql_statement(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ _free_mssql_result */ -static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _free_mssql_result(zend_rsrc_list_entry *rsrc) { mssql_result *result = (mssql_result *)rsrc->ptr; @@ -367,7 +364,7 @@ static void _free_mssql_result(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ php_mssql_set_defaullt_link */ -static void php_mssql_set_default_link(int id TSRMLS_DC) +static void php_mssql_set_default_link(int id) { if (MS_SQL_G(default_link)!=-1) { zend_list_delete(MS_SQL_G(default_link)); @@ -379,12 +376,12 @@ static void php_mssql_set_default_link(int id TSRMLS_DC) /* {{{ _close_mssql_link */ -static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _close_mssql_link(zend_rsrc_list_entry *rsrc) { mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr; mssql_ptr->valid = 0; - zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results TSRMLS_CC); + zend_hash_apply(&EG(regular_list),(apply_func_t) _clean_invalid_results); dbclose(mssql_ptr->link); dbfreelogin(mssql_ptr->login); efree(mssql_ptr); @@ -394,7 +391,7 @@ static void _close_mssql_link(zend_rsrc_list_entry *rsrc TSRMLS_DC) /* {{{ _close_mssql_plink */ -static void _close_mssql_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC) +static void _close_mssql_plink(zend_rsrc_list_entry *rsrc) { mssql_link *mssql_ptr = (mssql_link *)rsrc->ptr; @@ -551,7 +548,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) mssql_link mssql, *mssql_ptr; char buffer[40]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sssb", &host, &host_len, &user, &user_len, &passwd, &passwd_len, &new_link) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|sssb", &host, &host_len, &user, &user_len, &passwd, &passwd_len, &new_link) == FAILURE) { return; } @@ -587,7 +584,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } if (hashed_details == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); + php_error_docref(NULL, E_WARNING, "Out of memory"); RETURN_FALSE; } @@ -596,7 +593,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) /* set a DBLOGIN record */ if ((mssql.login = dblogin()) == NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to allocate login record"); + php_error_docref(NULL, E_WARNING, "Unable to allocate login record"); RETURN_FALSE; } @@ -644,20 +641,20 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) zend_rsrc_list_entry new_le; if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links)); + php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links)); efree(hashed_details); dbfreelogin(mssql.login); RETURN_FALSE; } if (MS_SQL_G(max_persistent) != -1 && MS_SQL_G(num_persistent) >= MS_SQL_G(max_persistent)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent)); + php_error_docref(NULL, E_WARNING, "Too many open persistent links (%ld)", MS_SQL_G(num_persistent)); efree(hashed_details); dbfreelogin(mssql.login); RETURN_FALSE; } /* create the link */ if ((mssql.link = dbopen(mssql.login, host)) == FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host)); + php_error_docref(NULL, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host)); efree(hashed_details); dbfreelogin(mssql.login); RETURN_FALSE; @@ -714,7 +711,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) #if BROKEN_MSSQL_PCONNECTS log_error("PHP/MS SQL: Hashed persistent link is not a MS SQL link!",php_rqst->server); #endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Hashed persistent link is not a MS SQL link!"); + php_error_docref(NULL, E_WARNING, "Hashed persistent link is not a MS SQL link!"); efree(hashed_details); RETURN_FALSE; } @@ -730,7 +727,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) #if BROKEN_MSSQL_PCONNECTS log_error("PHP/MS SQL: Unable to reconnect!",php_rqst->server); #endif - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect"); + php_error_docref(NULL, E_WARNING, "Link to server lost, unable to reconnect"); zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); dbfreelogin(mssql_ptr->login); @@ -774,7 +771,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) if (ptr && (type==le_link || type==le_plink)) { zend_list_addref(link); Z_LVAL_P(return_value) = link; - php_mssql_set_default_link(link TSRMLS_CC); + php_mssql_set_default_link(link); Z_TYPE_P(return_value) = IS_RESOURCE; dbfreelogin(mssql.login); efree(hashed_details); @@ -784,14 +781,14 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) } } if (MS_SQL_G(max_links) != -1 && MS_SQL_G(num_links) >= MS_SQL_G(max_links)) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links)); + php_error_docref(NULL, E_WARNING, "Too many open links (%ld)", MS_SQL_G(num_links)); efree(hashed_details); dbfreelogin(mssql.login); RETURN_FALSE; } if ((mssql.link=dbopen(mssql.login, host))==NULL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host)); + php_error_docref(NULL, E_WARNING, "Unable to connect to server: %s", (host == NULL ? "" : host)); efree(hashed_details); dbfreelogin(mssql.login); RETURN_FALSE; @@ -837,7 +834,7 @@ static void php_mssql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) MS_SQL_G(num_links)++; } efree(hashed_details); - php_mssql_set_default_link(Z_LVAL_P(return_value) TSRMLS_CC); + php_mssql_set_default_link(Z_LVAL_P(return_value)); } /* }}} */ @@ -877,7 +874,7 @@ PHP_FUNCTION(mssql_close) int id = -1; mssql_link *mssql_ptr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|r", &mssql_link_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "|r", &mssql_link_index) == FAILURE) { return; } @@ -908,7 +905,7 @@ PHP_FUNCTION(mssql_select_db) int id = -1; mssql_link *mssql_ptr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &db, &db_len, &mssql_link_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &db, &db_len, &mssql_link_index) == FAILURE) { return; } @@ -920,7 +917,7 @@ PHP_FUNCTION(mssql_select_db) ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink); if (dbuse(mssql_ptr->link, db)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to select database: %s", db); + php_error_docref(NULL, E_WARNING, "Unable to select database: %s", db); RETURN_FALSE; } else { RETURN_TRUE; @@ -930,7 +927,7 @@ PHP_FUNCTION(mssql_select_db) /* {{{ php_mssql_get_column_content_with_type */ -static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC) +static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type ) { if (dbdata(mssql_ptr->link,offset) == NULL && dbdatlen(mssql_ptr->link,offset) == 0) { ZVAL_NULL(result); @@ -1047,7 +1044,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off ZVAL_STRINGL(result, res_buf, res_length, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset)); + php_error_docref(NULL, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset)); ZVAL_FALSE(result); } } @@ -1057,7 +1054,7 @@ static void php_mssql_get_column_content_with_type(mssql_link *mssql_ptr,int off /* {{{ php_mssql_get_column_content_without_type */ -static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type TSRMLS_DC) +static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int offset,zval *result, int column_type) { if (dbdatlen(mssql_ptr->link,offset) == 0) { ZVAL_NULL(result); @@ -1127,7 +1124,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int ZVAL_STRINGL(result, res_buf, res_length, 0); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset)); + php_error_docref(NULL, E_WARNING, "column %d has unknown data type (%d)", offset, coltype(offset)); ZVAL_FALSE(result); } } @@ -1135,7 +1132,7 @@ static void php_mssql_get_column_content_without_type(mssql_link *mssql_ptr,int /* {{{ _mssql_get_sp_result */ -static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement TSRMLS_DC) +static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *statement) { int i, num_rets, type; char *parameter; @@ -1187,7 +1184,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme } } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "An output parameter variable was not provided"); + php_error_docref(NULL, E_WARNING, "An output parameter variable was not provided"); } } } @@ -1199,7 +1196,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme Z_LVAL_P(bind->zval)=dbretstatus(mssql_ptr->link); } else { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL"); + php_error_docref(NULL, E_WARNING, "stored procedure has no return value. Nothing was returned into RETVAL"); } } } @@ -1208,7 +1205,7 @@ static void _mssql_get_sp_result(mssql_link *mssql_ptr, mssql_statement *stateme /* {{{ _mssql_fetch_batch */ -static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue TSRMLS_DC) +static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int retvalue) { int i, j = 0; char computed_buf[16]; @@ -1274,7 +1271,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r result->data[i] = (zval *) safe_emalloc(sizeof(zval), result->num_fields, 0); for (j=0; j<result->num_fields; j++) { INIT_ZVAL(result->data[i][j]); - MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type TSRMLS_CC)); + MS_SQL_G(get_column_content(mssql_ptr, j+1, &result->data[i][j], result->fields[j].type)); } if (i<result->batchsize || result->batchsize==0) { i++; @@ -1286,7 +1283,7 @@ static int _mssql_fetch_batch(mssql_link *mssql_ptr, mssql_result *result, int r result->lastresult = retvalue; } if (result->statement && (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS)) { - _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC); + _mssql_get_sp_result(mssql_ptr, result->statement); } return i; } @@ -1300,7 +1297,7 @@ PHP_FUNCTION(mssql_fetch_batch) mssql_result *result; mssql_link *mssql_ptr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) { return; } @@ -1313,7 +1310,7 @@ PHP_FUNCTION(mssql_fetch_batch) mssql_ptr = result->mssql_ptr; _free_result(result, 0); result->cur_row=result->num_rows=0; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult TSRMLS_CC); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, result->lastresult); RETURN_LONG(result->num_rows); } @@ -1334,7 +1331,7 @@ PHP_FUNCTION(mssql_query) dbsettime(MS_SQL_G(timeout)); batchsize = MS_SQL_G(batchsize); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|rl", &query, &query_len, &mssql_link_index, &zbatchsize) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|rl", &query, &query_len, &mssql_link_index, &zbatchsize) == FAILURE) { return; } @@ -1351,11 +1348,11 @@ PHP_FUNCTION(mssql_query) ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink); if (dbcmd(mssql_ptr->link, query)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set query"); + php_error_docref(NULL, E_WARNING, "Unable to set query"); RETURN_FALSE; } if (dbsqlexec(mssql_ptr->link)==FAIL || (retvalue = dbresults(mssql_ptr->link))==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Query failed"); + php_error_docref(NULL, E_WARNING, "Query failed"); dbcancel(mssql_ptr->link); RETURN_FALSE; } @@ -1388,7 +1385,7 @@ PHP_FUNCTION(mssql_query) result->have_fields = 0; result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0); - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue); ZEND_REGISTER_RESOURCE(return_value, result, le_result); } @@ -1401,7 +1398,7 @@ PHP_FUNCTION(mssql_rows_affected) zval *mssql_link_index; mssql_link *mssql_ptr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_link_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_link_index) == FAILURE) { return; } @@ -1419,7 +1416,7 @@ PHP_FUNCTION(mssql_free_result) mssql_result *result; int retvalue; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) { return; } @@ -1462,7 +1459,7 @@ PHP_FUNCTION(mssql_num_rows) zval *mssql_result_index; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) { return; } @@ -1479,7 +1476,7 @@ PHP_FUNCTION(mssql_num_fields) zval *mssql_result_index; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) { return; } @@ -1501,12 +1498,12 @@ static void php_mssql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type) switch (result_type) { case MSSQL_NUM: case MSSQL_ASSOC: - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) { return; } break; case MSSQL_BOTH: - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &resulttype) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &resulttype) == FAILURE) { return; } result_type = (resulttype > 0 && (resulttype & MSSQL_BOTH)) ? resulttype : result_type; @@ -1615,14 +1612,14 @@ PHP_FUNCTION(mssql_data_seek) long offset; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &mssql_result_index, &offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &mssql_result_index, &offset) == FAILURE) { return; } ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result); if (offset < 0 || offset >= result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset"); + php_error_docref(NULL, E_WARNING, "Bad row offset"); RETURN_FALSE; } @@ -1698,7 +1695,7 @@ PHP_FUNCTION(mssql_fetch_field) long field_offset = -1; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) { return; } @@ -1711,7 +1708,7 @@ PHP_FUNCTION(mssql_fetch_field) if (field_offset<0 || field_offset >= result->num_fields) { if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); + php_error_docref(NULL, E_WARNING, "Bad column offset"); } RETURN_FALSE; } @@ -1734,7 +1731,7 @@ PHP_FUNCTION(mssql_field_length) long field_offset = -1; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) { return; } @@ -1747,7 +1744,7 @@ PHP_FUNCTION(mssql_field_length) if (field_offset<0 || field_offset >= result->num_fields) { if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); + php_error_docref(NULL, E_WARNING, "Bad column offset"); } RETURN_FALSE; } @@ -1764,7 +1761,7 @@ PHP_FUNCTION(mssql_field_name) long field_offset = -1; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) { return; } @@ -1777,7 +1774,7 @@ PHP_FUNCTION(mssql_field_name) if (field_offset<0 || field_offset >= result->num_fields) { if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); + php_error_docref(NULL, E_WARNING, "Bad column offset"); } RETURN_FALSE; } @@ -1794,7 +1791,7 @@ PHP_FUNCTION(mssql_field_type) long field_offset = -1; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &mssql_result_index, &field_offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|l", &mssql_result_index, &field_offset) == FAILURE) { return; } @@ -1807,7 +1804,7 @@ PHP_FUNCTION(mssql_field_type) if (field_offset<0 || field_offset >= result->num_fields) { if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); + php_error_docref(NULL, E_WARNING, "Bad column offset"); } RETURN_FALSE; } @@ -1824,14 +1821,14 @@ PHP_FUNCTION(mssql_field_seek) long field_offset; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rl", &mssql_result_index, &field_offset) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rl", &mssql_result_index, &field_offset) == FAILURE) { return; } ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result); if (field_offset<0 || field_offset >= result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset"); + php_error_docref(NULL, E_WARNING, "Bad column offset"); RETURN_FALSE; } @@ -1849,14 +1846,14 @@ PHP_FUNCTION(mssql_result) int field_offset=0; mssql_result *result; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rlZ", &mssql_result_index, &row, &field) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rlZ", &mssql_result_index, &row, &field) == FAILURE) { return; } ZEND_FETCH_RESOURCE(result, mssql_result *, &mssql_result_index, -1, "MS SQL-result", le_result); if (row < 0 || row >= result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad row offset (%ld)", row); + php_error_docref(NULL, E_WARNING, "Bad row offset (%ld)", row); RETURN_FALSE; } @@ -1871,7 +1868,7 @@ PHP_FUNCTION(mssql_result) } } if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field)); + php_error_docref(NULL, E_WARNING, "%s field not found in result", Z_STRVAL_PP(field)); RETURN_FALSE; } break; @@ -1880,7 +1877,7 @@ PHP_FUNCTION(mssql_result) convert_to_long_ex(field); field_offset = Z_LVAL_PP(field); if (field_offset<0 || field_offset>=result->num_fields) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Bad column offset specified"); + php_error_docref(NULL, E_WARNING, "Bad column offset specified"); RETURN_FALSE; } break; @@ -1900,7 +1897,7 @@ PHP_FUNCTION(mssql_next_result) mssql_result *result; mssql_link *mssql_ptr; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_result_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_result_index) == FAILURE) { return; } @@ -1918,7 +1915,7 @@ PHP_FUNCTION(mssql_next_result) } else if (retvalue == NO_MORE_RESULTS || retvalue == NO_MORE_RPC_RESULTS) { if (result->statement) { - _mssql_get_sp_result(mssql_ptr, result->statement TSRMLS_CC); + _mssql_get_sp_result(mssql_ptr, result->statement); } RETURN_FALSE; } @@ -1931,7 +1928,7 @@ PHP_FUNCTION(mssql_next_result) result->num_fields = dbnumcols(mssql_ptr->link); result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), result->num_fields, 0); result->have_fields = 0; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue); RETURN_TRUE; } @@ -1945,7 +1942,7 @@ PHP_FUNCTION(mssql_min_error_severity) { long severity; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) { return; } @@ -1960,7 +1957,7 @@ PHP_FUNCTION(mssql_min_message_severity) { long severity; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &severity) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &severity) == FAILURE) { return; } @@ -1979,7 +1976,7 @@ PHP_FUNCTION(mssql_init) mssql_statement *statement; int id = -1; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &sp_name, &sp_name_len, &mssql_link_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|r", &sp_name, &sp_name_len, &mssql_link_index) == FAILURE) { return; } @@ -1991,7 +1988,7 @@ PHP_FUNCTION(mssql_init) ZEND_FETCH_RESOURCE2(mssql_ptr, mssql_link *, &mssql_link_index, id, "MS SQL-Link", le_link, le_plink); if (dbrpcinit(mssql_ptr->link, sp_name,0)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to init stored procedure"); + php_error_docref(NULL, E_WARNING, "unable to init stored procedure"); RETURN_FALSE; } @@ -2000,7 +1997,7 @@ PHP_FUNCTION(mssql_init) statement->link = mssql_ptr; statement->executed=FALSE; - statement->id = zend_list_insert(statement,le_statement TSRMLS_CC); + statement->id = zend_list_insert(statement,le_statement); RETURN_RESOURCE(statement->id); } @@ -2021,7 +2018,7 @@ PHP_FUNCTION(mssql_bind) mssql_bind bind,*bindp; LPBYTE value = NULL; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rsZl|bbl", &stmt, ¶m_name, ¶m_name_len, &var, &type, &is_output, &is_null, &maxlen) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "rsZl|bbl", &stmt, ¶m_name, ¶m_name_len, &var, &type, &is_output, &is_null, &maxlen) == FAILURE) { return; } @@ -2072,7 +2069,7 @@ PHP_FUNCTION(mssql_bind) break; default: - php_error_docref(NULL TSRMLS_CC, E_WARNING, "unsupported type"); + php_error_docref(NULL, E_WARNING, "unsupported type"); RETURN_FALSE; break; } @@ -2101,7 +2098,7 @@ PHP_FUNCTION(mssql_bind) /* no call to dbrpcparam if RETVAL */ if ( strcmp("RETVAL", param_name)!=0 ) { if (dbrpcparam(mssql_ptr->link, param_name, (BYTE)status, type, maxlen, datalen, (LPBYTE)value)==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to set parameter"); + php_error_docref(NULL, E_WARNING, "Unable to set parameter"); RETURN_FALSE; } } @@ -2127,7 +2124,7 @@ PHP_FUNCTION(mssql_execute) batchsize = MS_SQL_G(batchsize); - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|b", &stmt, &skip_results) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r|b", &stmt, &skip_results) == FAILURE) { return; } @@ -2137,7 +2134,7 @@ PHP_FUNCTION(mssql_execute) exec_retval = dbrpcexec(mssql_ptr->link); if (exec_retval == FAIL || dbsqlok(mssql_ptr->link) == FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "stored procedure execution failed"); + php_error_docref(NULL, E_WARNING, "stored procedure execution failed"); if (exec_retval == FAIL) { dbcancel(mssql_ptr->link); @@ -2149,7 +2146,7 @@ PHP_FUNCTION(mssql_execute) retval_results=dbresults(mssql_ptr->link); if (retval_results==FAIL) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "could not retrieve results"); + php_error_docref(NULL, E_WARNING, "could not retrieve results"); dbcancel(mssql_ptr->link); RETURN_FALSE; } @@ -2183,12 +2180,12 @@ PHP_FUNCTION(mssql_execute) result->fields = (mssql_field *) safe_emalloc(sizeof(mssql_field), num_fields, 0); result->statement = statement; - result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue TSRMLS_CC); + result->num_rows = _mssql_fetch_batch(mssql_ptr, result, retvalue); } } } if (retval_results == NO_MORE_RESULTS || retval_results == NO_MORE_RPC_RESULTS) { - _mssql_get_sp_result(mssql_ptr, statement TSRMLS_CC); + _mssql_get_sp_result(mssql_ptr, statement); } if (result==NULL) { @@ -2208,7 +2205,7 @@ PHP_FUNCTION(mssql_free_statement) mssql_statement *statement; int retvalue; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &mssql_statement_index) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "r", &mssql_statement_index) == FAILURE) { return; } @@ -2238,7 +2235,7 @@ PHP_FUNCTION(mssql_guid_string) char buffer[32+1]; char buffer2[36+1]; - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &binary, &binary_len, &sf) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|b", &binary, &binary_len, &sf) == FAILURE) { return; } diff --git a/ext/mssql/php_mssql.h b/ext/mssql/php_mssql.h index b0313a160a..f0f793ed03 100644 --- a/ext/mssql/php_mssql.h +++ b/ext/mssql/php_mssql.h @@ -167,7 +167,7 @@ ZEND_BEGIN_MODULE_GLOBALS(mssql) long cfg_min_error_severity, cfg_min_message_severity; long connect_timeout, timeout; zend_bool compatibility_mode; - void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type TSRMLS_DC); + void (*get_column_content)(mssql_link *mssql_ptr,int offset,zval *result,int column_type ); long textsize, textlimit, batchsize; zend_bool datetimeconvert; HashTable *resource_list, *resource_plist; |