diff options
-rw-r--r-- | ext/informix/ifx.ec | 396 | ||||
-rw-r--r-- | ext/interbase/interbase.c | 52 | ||||
-rw-r--r-- | ext/sybase/php_sybase_db.c | 386 | ||||
-rw-r--r-- | ext/sybase_ct/php_sybase_ct.c | 246 |
4 files changed, 531 insertions, 549 deletions
diff --git a/ext/informix/ifx.ec b/ext/informix/ifx.ec index 47b2eaab51..4e240479c7 100644 --- a/ext/informix/ifx.ec +++ b/ext/informix/ifx.ec @@ -116,7 +116,7 @@ typedef char IFX[128]; { \ if (ifx_check() < 0) { \ IFXG(sv_sqlcode) = SQLCODE; \ - php_error(E_WARNING, "%s(): Set connection %s fails (%s)", get_active_function_name(TSRMLS_C), ifx, ifx_error(ifx)); \ + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Set connection %s fails (%s)", ifx, ifx_error(ifx)); \ RETURN_FALSE; \ } \ } @@ -422,7 +422,7 @@ EXEC SQL END DECLARE SECTION; if (PG(sql_safe_mode)) { if (ZEND_NUM_ARGS()>0) { - php_error(E_NOTICE, "%s(): SQL safe mode in effect - ignoring host/user/password information", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information"); } host = passwd = NULL; user = php_get_current_user(); @@ -494,12 +494,12 @@ EXEC SQL END DECLARE SECTION; list_entry new_le; if (IFXG(max_links)!=-1 && IFXG(num_links) >= IFXG(max_links)) { - php_error(E_WARNING, "%s(): Too many open links (%d)", get_active_function_name(TSRMLS_C), IFXG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", IFXG(num_links)); efree(hashed_details); RETURN_FALSE; } if (IFXG(max_persistent)!=-1 && IFXG(num_persistent) >= IFXG(max_persistent)) { - php_error(E_WARNING, "%s(): Too many open persistent links (%d)", get_active_function_name(TSRMLS_C), IFXG(num_persistent)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open persistent links (%d)", IFXG(num_persistent)); efree(hashed_details); RETURN_FALSE; } @@ -513,7 +513,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() == IFX_ERROR) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_error(ifx)); free(ifx); efree(hashed_details); RETURN_FALSE; @@ -543,7 +543,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() == IFX_ERROR) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Link to server lost, unable to reconnect (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Link to server lost, unable to reconnect (%s)", ifx_error(ifx)); zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); RETURN_FALSE; @@ -581,7 +581,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() == IFX_ERROR) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Unable to connect (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect (%s)", ifx_error(ifx)); zend_hash_del(&EG(regular_list), hashed_details, hashed_details_length+1); efree(hashed_details); RETURN_FALSE; @@ -598,7 +598,7 @@ EXEC SQL END DECLARE SECTION; } } if (IFXG(max_links) != -1 && IFXG(num_links) >= IFXG(max_links)) { - php_error(E_WARNING, "%s(): Too many open links (%d)", get_active_function_name(TSRMLS_C), IFXG(num_links)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too many open links (%d)", IFXG(num_links)); efree(hashed_details); RETURN_FALSE; } @@ -611,7 +611,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() == IFX_ERROR) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING,"%s(): %s", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ifx_error(ifx)); efree(hashed_details); efree(ifx); RETURN_FALSE; @@ -785,7 +785,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL PREPARE :statemid FROM :statement; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Prepare fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails (%s)", ifx_error(ifx)); RETURN_FALSE; } @@ -795,7 +795,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX 384; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Allocate desciptor <%s> fails (%s)", get_active_function_name(TSRMLS_C), descrpid, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_error(ifx)); EXEC SQL free :statemid; RETURN_FALSE; } @@ -803,7 +803,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DESCRIBE :statemid USING SQL DESCRIPTOR :descrpid; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Describe fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_error(ifx)); EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; RETURN_FALSE; @@ -813,7 +813,7 @@ EXEC SQL END DECLARE SECTION; Ifx_Result = (IFX_RES *) emalloc(sizeof(IFX_RES)); if (Ifx_Result == NULL) { - php_error(E_WARNING, "%s(): Out of memory allocating IFX_RES", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory allocating IFX_RES"); EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; RETURN_FALSE; @@ -861,7 +861,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Can't get blob array param", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get blob array param"); RETURN_FALSE; } if (Z_TYPE_PP(pblobidarr) != IS_ARRAY) { @@ -869,7 +869,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Blob-parameter is not an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Blob-parameter is not an array"); RETURN_FALSE; } @@ -891,7 +891,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING,"%s(): %d is not an Informix blob-result index", get_active_function_name(TSRMLS_C), (int)((*tmp)->value.lval)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an Informix blob-result index", (int)((*tmp)->value.lval)); RETURN_FALSE; } if(locator->loc_loctype==LOCFNAME) { @@ -929,7 +929,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Execute immediate fails : %s (%s)", get_active_function_name(TSRMLS_C), statement, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails : %s (%s)", statement, ifx_error(ifx)); RETURN_FALSE; } Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */ @@ -966,7 +966,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Can not get descriptor %s (%s)", get_active_function_name(TSRMLS_C), descrpid, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, ifx_error(ifx)); RETURN_FALSE; } @@ -999,7 +999,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Declare cursor fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_error(ifx)); RETURN_FALSE; } @@ -1010,7 +1010,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL free :statemid; EXEC SQL free :cursorid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Open cursor fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_error(ifx)); RETURN_FALSE; } strcpy(Ifx_Result->cursorid, cursorid); @@ -1135,7 +1135,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL PREPARE :statemid FROM :statement; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Prepare fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Prepare fails (%s)", ifx_error(ifx)); RETURN_FALSE; } @@ -1145,7 +1145,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX 384; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Allocate desciptor <%s> fails (%s)", get_active_function_name(TSRMLS_C), descrpid, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Allocate desciptor <%s> fails (%s)", descrpid, ifx_error(ifx)); EXEC SQL free :statemid; RETURN_FALSE; } @@ -1153,7 +1153,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DESCRIBE :statemid USING SQL DESCRIPTOR :descrpid; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Describe fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Describe fails (%s)", ifx_error(ifx)); EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; RETURN_FALSE; @@ -1164,7 +1164,7 @@ EXEC SQL END DECLARE SECTION; Ifx_Result = (IFX_RES *) emalloc(sizeof(IFX_RES)); if (Ifx_Result == NULL) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Out of memory allocating IFX_RES", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory allocating IFX_RES"); EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; RETURN_FALSE; @@ -1213,7 +1213,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING,"%s(): Can't get blob array param", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get blob array param"); RETURN_FALSE; } @@ -1222,7 +1222,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Blob-parameter not an array", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Blob-parameter not an array"); RETURN_FALSE; } @@ -1244,7 +1244,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), (int)((*tmp)->value.lval)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", (int)((*tmp)->value.lval)); RETURN_FALSE; } if(locator->loc_loctype==LOCFNAME) { @@ -1310,7 +1310,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL DEALLOCATE DESCRIPTOR :descrpid; EXEC SQL free :statemid; efree(Ifx_Result); - php_error(E_WARNING, "%s(): Can not get descriptor %s (%s)", get_active_function_name(TSRMLS_C), descrpid, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not get descriptor %s (%s)", descrpid, ifx_error(ifx)); RETURN_FALSE; } Ifx_Result->numcols = fieldcount; @@ -1383,7 +1383,7 @@ EXEC SQL END DECLARE SECTION; PHP_IFX_CHECK_CONNECTION(ifx); if (Ifx_Result->iscursory < 0) { - php_error(E_WARNING, "%s(): Resultindex %d is not a prepared query", get_active_function_name(TSRMLS_C), Z_LVAL_PP(result)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Resultindex %d is not a prepared query", Z_LVAL_PP(result)); RETURN_FALSE; } @@ -1395,7 +1395,7 @@ EXEC SQL END DECLARE SECTION; } if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Execute immediate fails: %s", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Execute immediate fails: %s", ifx_error(ifx)); RETURN_FALSE; } Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */ @@ -1417,14 +1417,14 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Declare cursor fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Declare cursor fails (%s)", ifx_error(ifx)); RETURN_FALSE; } EXEC SQL OPEN :cursorid; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Open cursor fails (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Open cursor fails (%s)", ifx_error(ifx)); RETURN_FALSE; } @@ -1686,7 +1686,7 @@ EXEC SQL END DECLARE SECTION; IFXG(sv_sqlcode) = 0; if (strcmp(Ifx_Result->cursorid,"") == 0) { - php_error(E_WARNING, "%s(): Not a select cursor!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); RETURN_FALSE; } @@ -1720,7 +1720,7 @@ EXEC SQL END DECLARE SECTION; } else if (!strcasecmp(fetch_pos,"CURRENT")) { EXEC SQL FETCH CURRENT :cursorid USING SQL DESCRIPTOR :descrpid; } else { - php_error(E_WARNING, "%s(): Invalid positioning arg on fetch", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid positioning arg on fetch"); } } } @@ -1729,7 +1729,7 @@ EXEC SQL END DECLARE SECTION; switch (ifx_check()) { case IFX_ERROR: IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Can not fetch row on cursor %s (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx), cursorid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch row on cursor %s (%s)", ifx_error(ifx), cursorid); RETURN_FALSE; break; case IFX_NODATA: @@ -1756,7 +1756,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Get descriptor (field # %d) fails (%s)", get_active_function_name(TSRMLS_C), i, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx)); RETURN_FALSE; } @@ -1854,7 +1854,7 @@ $ifdef HAVE_IFX_IUS; fieldleng=ifx_var_getlen(&lvar_tmp); if (fieldleng > 2) fieldleng -= 2; /* fix by Alex Shepherd */ if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error(E_WARNING, "%s(): Out of memory", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); RETURN_FALSE; } memcpy(char_data,ifx_var_getdata(&lvar_tmp),fieldleng); @@ -1868,7 +1868,7 @@ $endif; case SQLCHAR : case SQLNCHAR : if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error(E_WARNING, "%s(): Out of memory", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); RETURN_FALSE; } EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :char_data = DATA; @@ -1923,7 +1923,7 @@ $endif; } if (locator_b->loc_status < 0) { /* blob too large */ - php_error(E_WARNING, "%s(): No memory (%d bytes) for blob", get_active_function_name(TSRMLS_C), locator_b->loc_bufsize); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "No memory (%d bytes) for blob", locator_b->loc_bufsize); RETURN_FALSE; } @@ -2052,7 +2052,7 @@ EXEC SQL END DECLARE SECTION; ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); if (strcmp(Ifx_Result->cursorid,"") == 0) { - php_error(E_WARNING, "%s(): Not a select cursor!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); RETURN_FALSE; } @@ -2070,7 +2070,7 @@ EXEC SQL END DECLARE SECTION; switch (ifx_check()) { case IFX_ERROR: IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Can not fetch next row on cursor %s (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx), cursorid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_error(ifx), cursorid); RETURN_FALSE; break; case IFX_NODATA: @@ -2100,7 +2100,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Get descriptor (field # %d) fails (%s)", get_active_function_name(TSRMLS_C), i, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx)); RETURN_FALSE; } @@ -2127,7 +2127,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Get descriptor (field # %d) fails (%s)", get_active_function_name(TSRMLS_C), i, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx)); RETURN_FALSE; } @@ -2206,7 +2206,7 @@ $ifdef HAVE_IFX_IUS; if (fieldleng > 2) fieldleng -= 2; /* fix by Alex Shepherd */ if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error(E_WARNING, "%s(): Out of memory", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); RETURN_FALSE; } memcpy(char_data,ifx_var_getdata(&lvar_tmp),fieldleng); @@ -2220,7 +2220,7 @@ $endif; case SQLNCHAR : case SQLNVCHAR : if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { - php_error(E_WARNING, "%s(): Out of memory", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory"); RETURN_FALSE; } EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :char_data = DATA; @@ -2256,7 +2256,7 @@ $endif; } } if (locator_b->loc_status < 0) { /* blob too large */ - php_error(E_WARNING, "%s(): Not enough memory (%d bytes) for blob", get_active_function_name(TSRMLS_C), locator_b->loc_bufsize); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not enough memory (%d bytes) for blob", locator_b->loc_bufsize); RETURN_FALSE; } @@ -2269,7 +2269,7 @@ $endif; /* need an extra byte for string terminator */ copy_content = malloc(lg + 1); if (copy_content == NULL) { - php_error(E_WARNING, "%s(): Not enough memory for TEXT column", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not enough memory for TEXT column"); RETURN_FALSE; } memcpy(copy_content, content, lg); @@ -2296,7 +2296,7 @@ $endif; switch (ifx_check()) { case IFX_ERROR: IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Can not fetch next row on cursor %s (%s)", get_active_function_name(TSRMLS_C), ifx_error(ifx), cursorid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can not fetch next row on cursor %s (%s)", ifx_error(ifx), cursorid); RETURN_FALSE; break; case IFX_NODATA: @@ -2352,7 +2352,7 @@ EXEC SQL END DECLARE SECTION; ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); if (strcmp(Ifx_Result->cursorid,"") == 0) { - php_error(E_WARNING, "%s(): Not a select cursor!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); RETURN_FALSE; } @@ -2373,7 +2373,7 @@ EXEC SQL END DECLARE SECTION; EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldname = NAME, :fieldtype = TYPE; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Get descriptor (field # %d) fails (%s)", get_active_function_name(TSRMLS_C), i, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx)); RETURN_FALSE; } @@ -2510,7 +2510,7 @@ EXEC SQL END DECLARE SECTION; ZEND_FETCH_RESOURCE(Ifx_Result, IFX_RES *, result, -1, "Informix Result", le_result); if (strcmp(Ifx_Result->cursorid,"") == 0) { - php_error(E_WARNING, "%s(): Not a select cursor!", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not a select cursor!"); RETURN_FALSE; } @@ -2538,7 +2538,7 @@ EXEC SQL END DECLARE SECTION; if (ifx_check() < 0) { IFXG(sv_sqlcode) = SQLCODE; - php_error(E_WARNING, "%s(): Get descriptor (field # %d) fails (%s)", get_active_function_name(TSRMLS_C), i, ifx_error(ifx)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Get descriptor (field # %d) fails (%s)", i, ifx_error(ifx)); RETURN_FALSE; } @@ -2801,7 +2801,7 @@ static long php_intifx_getType(long id, HashTable *list TSRMLS_DC) Ifx_res = (IFX_IDRES *) zend_list_find(id,&type); if (type!=le_idresult) { - php_error(E_WARNING, "%s(): %d is not a Informix id-result index", get_active_function_name(TSRMLS_C), id); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix id-result index", id); return -1; } return Ifx_res->type; @@ -2823,29 +2823,29 @@ static long php_intifx_getType(long id, HashTable *list TSRMLS_DC) Creates a blob-object */ PHP_FUNCTION(ifx_create_blob) { - zval *pmode, *pparam,*ptype; + zval **pmode, **pparam,*ptype; long id; long mode,type; - if (ZEND_NUM_ARGS()!=3 || getParameters(ht, 3, &ptype,&pmode,&pparam)==FAILURE) { + if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &ptype,&pmode,&pparam) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); - convert_to_string(pparam); - convert_to_long(ptype); + convert_to_long_ex(pmode); + convert_to_string_ex(pparam); + convert_to_long_ex(ptype); - type=Z_LVAL_P(ptype); + type = Z_LVAL_PP(ptype); if(type != 0) { - type=TYPE_BLTEXT; + type = TYPE_BLTEXT; } - mode=Z_LVAL_P(pmode); + mode = Z_LVAL_PP(pmode); if(mode != 0) { mode=BLMODE_INFILE; } - id=php_intifx_create_blob(type,mode,Z_STRVAL_P(pparam),Z_STRLEN_P(pparam),&EG(regular_list) TSRMLS_CC); + id=php_intifx_create_blob(type,mode,Z_STRVAL_PP(pparam),Z_STRLEN_PP(pparam),&EG(regular_list) TSRMLS_CC); if(id < 0) { RETURN_FALSE; @@ -2874,7 +2874,7 @@ static long php_intifx_create_blob(long type, long mode, char* param, long len, Ifx_blob=emalloc(sizeof(IFX_IDRES)); if(Ifx_blob==NULL) { - php_error(E_WARNING, "%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } @@ -2891,7 +2891,7 @@ static long php_intifx_create_blob(long type, long mode, char* param, long len, if(len>=0) { char *content=emalloc(len); if(content==NULL) { - php_error(E_WARNING, "%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } memcpy(content,param,len); @@ -2912,7 +2912,7 @@ static long php_intifx_create_blob(long type, long mode, char* param, long len, } else { /* mode = BLMODE_INFILE */ char *filename=emalloc(len+1); if(filename==NULL) { - php_error(E_WARNING, "%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } memcpy(filename,param,len); @@ -2939,15 +2939,15 @@ static long php_intifx_create_blob(long type, long mode, char* param, long len, Duplicates the given blob-object */ PHP_FUNCTION(ifx_copy_blob) { - zval *pbid; + zval **pbid; long newid; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pbid)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &pbid)==FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); + convert_to_long_ex(pbid); - newid=php_intifx_copy_blob(Z_LVAL_P(pbid),&EG(regular_list) TSRMLS_CC); + newid=php_intifx_copy_blob(Z_LVAL_PP(pbid),&EG(regular_list) TSRMLS_CC); if(newid<0) { RETURN_FALSE; } @@ -2974,13 +2974,13 @@ static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC) Ifx_blob_orig = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || !(Ifx_blob_orig->type==TYPE_BLBYTE || Ifx_blob_orig->type==TYPE_BLTEXT)) { - php_error(E_WARNING,"%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); return -1; } Ifx_blob=emalloc(sizeof(IFX_IDRES)); if(Ifx_blob==NULL) { - php_error(E_WARNING,"%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } @@ -2996,7 +2996,7 @@ static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC) char *content; if(locator_orig->loc_size>=0 && locator_orig->loc_buffer!=NULL) { if((content=emalloc(locator_orig->loc_size))==NULL) { - php_error(E_WARNING,"%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } memcpy(content,locator_orig->loc_buffer, locator_orig->loc_size); @@ -3015,7 +3015,7 @@ static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC) char *filename; if((filename=emalloc(strlen(locator_orig->loc_fname)+1))==NULL) { - php_error(E_WARNING, "%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } @@ -3041,15 +3041,15 @@ static long php_intifx_copy_blob(long bid, HashTable *list TSRMLS_DC) Deletes the blob-object */ PHP_FUNCTION(ifx_free_blob) { - zval *pid; + zval **pid; long ret; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pid)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pid); + convert_to_long_ex(pid); - ret=php_intifx_free_blob(pid->value.lval,&EG(regular_list) TSRMLS_CC); + ret=php_intifx_free_blob(Z_LVAL_PP(pid),&EG(regular_list) TSRMLS_CC); if(ret<0) { RETURN_FALSE; } @@ -3076,7 +3076,7 @@ static long php_intifx_free_blob(long bid, HashTable *list TSRMLS_DC) Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) { - php_error(E_WARNING, "%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); return -1; } @@ -3114,7 +3114,7 @@ static long php_intifx2_free_blob(long bid, HashTable *list TSRMLS_DC) Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) { - php_error(E_WARNING, "%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); return -1; } @@ -3151,16 +3151,16 @@ static long php_intifx2_free_blob(long bid, HashTable *list TSRMLS_DC) Returns the content of the blob-object */ PHP_FUNCTION(ifx_get_blob) { - zval *pbid; + zval **pbid; char *content; long len; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pbid)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); + convert_to_long_ex(pbid); - len=php_intifx_get_blob(pbid->value.lval,&EG(regular_list),&content TSRMLS_CC); + len=php_intifx_get_blob(Z_LVAL_PP(pbid),&EG(regular_list),&content TSRMLS_CC); if(content==NULL || len<0) { RETURN_STRING(php_intifx_null(TSRMLS_C),1); } @@ -3187,7 +3187,7 @@ static long php_intifx_get_blob(long bid, HashTable *list, char** content TSRMLS Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) { - php_error(E_WARNING, "%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); return -1; } @@ -3216,7 +3216,7 @@ static loc_t *php_intifx_get_blobloc(long bid, HashTable *list TSRMLS_DC) Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) { - php_error(E_WARNING, "%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); return NULL; } return &(Ifx_blob->BLOB.blob_data); @@ -3238,15 +3238,15 @@ static loc_t *php_intifx_get_blobloc(long bid, HashTable *list TSRMLS_DC) Updates the content of the blob-object */ PHP_FUNCTION(ifx_update_blob) { - zval *pbid, *pparam; + zval **pbid, **pparam; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &pbid,&pparam)==FAILURE) { + if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &pbid,&pparam) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); - convert_to_string(pparam); + convert_to_long_ex(pbid); + convert_to_string_ex(pparam); - if(php_intifx_update_blob(Z_LVAL_P(pbid),Z_STRVAL_P(pparam),Z_STRLEN_P(pparam), &EG(regular_list) TSRMLS_CC) < 0) { + if(php_intifx_update_blob(Z_LVAL_PP(pbid),Z_STRVAL_PP(pparam),Z_STRLEN_PP(pparam), &EG(regular_list) TSRMLS_CC) < 0) { RETURN_FALSE; } RETURN_TRUE; @@ -3272,7 +3272,7 @@ static long php_intifx_update_blob(long bid, char* param, long len, HashTable *l Ifx_blob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_blob->type==TYPE_BLTEXT || Ifx_blob->type==TYPE_BLBYTE)) { - php_error(E_WARNING,"%s(): %d is not a Informix blob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix blob-result index", bid); return -1; } @@ -3284,7 +3284,7 @@ static long php_intifx_update_blob(long bid, char* param, long len, HashTable *l } if(len >= 0) { if((content=emalloc(len))==NULL) { - php_error(E_WARNING, "%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } memcpy(content,param, len); @@ -3305,7 +3305,7 @@ static long php_intifx_update_blob(long bid, char* param, long len, HashTable *l efree(Ifx_blob->BLOB.blob_data.loc_fname); } if((filename=emalloc(len+1))==NULL) { - php_error(E_WARNING, "%s(): Can't create blob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create blob-resource"); return -1; } memcpy(filename,param, len); @@ -3359,14 +3359,14 @@ static char* php_intifx_create_tmpfile(long bid TSRMLS_DC) Sets the default blob-mode for all select-queries */ PHP_FUNCTION(ifx_blobinfile_mode) { - zval *pmode; + zval **pmode; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pmode)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); + convert_to_long_ex(pmode); - IFXG(blobinfile)=Z_LVAL_P(pmode); + IFXG(blobinfile)=Z_LVAL_PP(pmode); RETURN_TRUE; } /* }}} */ @@ -3385,14 +3385,14 @@ PHP_FUNCTION(ifx_blobinfile_mode) Sets the default text-mode for all select-queries */ PHP_FUNCTION(ifx_textasvarchar) { - zval *pmode; + zval **pmode; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pmode)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); + convert_to_long_ex(pmode); - IFXG(textasvarchar)=Z_LVAL_P(pmode); + IFXG(textasvarchar)=Z_LVAL_PP(pmode); RETURN_TRUE; } /* }}} */ @@ -3411,14 +3411,14 @@ PHP_FUNCTION(ifx_textasvarchar) Sets the default byte-mode for all select-queries */ PHP_FUNCTION(ifx_byteasvarchar) { - zval *pmode; + zval **pmode; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pmode)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); + convert_to_long_ex(pmode); - IFXG(byteasvarchar)=Z_LVAL_P(pmode); + IFXG(byteasvarchar)=Z_LVAL_PP(pmode); RETURN_TRUE; } @@ -3436,14 +3436,14 @@ PHP_FUNCTION(ifx_byteasvarchar) Sets the default return value of a NULL-value on a fetch-row */ PHP_FUNCTION(ifx_nullformat) { - zval *pmode; + zval **pmode; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pmode)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pmode) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); + convert_to_long_ex(pmode); - IFXG(nullformat)=Z_LVAL_P(pmode); + IFXG(nullformat)=Z_LVAL_PP(pmode); RETURN_TRUE; } /* }}} */ @@ -3481,15 +3481,15 @@ static char* php_intifx_null(TSRMLS_D) Creates a char-object */ PHP_FUNCTION(ifx_create_char) { - zval *pparam; + zval **pparam; long id; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pparam)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pparam) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_string(pparam); + convert_to_string_ex(pparam); - id=php_intifx_create_char(Z_STRVAL_P(pparam),Z_STRLEN_P(pparam),&EG(regular_list) TSRMLS_CC); + id=php_intifx_create_char(Z_STRVAL_PP(pparam),Z_STRLEN_PP(pparam),&EG(regular_list) TSRMLS_CC); if(id < 0) { RETURN_FALSE; @@ -3515,7 +3515,7 @@ static long php_intifx_create_char(char* param, long len, HashTable *list TSRMLS Ifx_char=emalloc(sizeof(IFX_IDRES)); if(Ifx_char==NULL) { - php_error(E_WARNING, "%s(): Can't create char-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create char-resource"); return -1; } @@ -3528,7 +3528,7 @@ static long php_intifx_create_char(char* param, long len, HashTable *list TSRMLS Ifx_char->CHAR.char_data=emalloc(len+1); if(Ifx_char->CHAR.char_data==NULL) { efree(Ifx_char); - php_error(E_WARNING, "%s(): Can't create char-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create char-resource"); return -1; } memcpy(Ifx_char->CHAR.char_data,param,len); @@ -3551,16 +3551,16 @@ static long php_intifx_create_char(char* param, long len, HashTable *list TSRMLS Returns the content of the char-object */ PHP_FUNCTION(ifx_get_char) { - zval *pbid; + zval **pbid; char *content; long len; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pbid)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); + convert_to_long_ex(pbid); - len=php_intifx_get_char(Z_LVAL_P(pbid),&EG(regular_list),&content TSRMLS_CC); + len=php_intifx_get_char(Z_LVAL_PP(pbid),&EG(regular_list),&content TSRMLS_CC); if(content==NULL || len < 0) { RETURN_STRING("",1); } @@ -3587,7 +3587,7 @@ static long php_intifx_get_char(long bid, HashTable *list, char** content TSRMLS Ifx_char = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_char->type==TYPE_CHAR)) { - php_error(E_WARNING, "%s(): %d is not a Informix char-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix char-result index", bid); return -1; } @@ -3608,14 +3608,14 @@ static long php_intifx_get_char(long bid, HashTable *list, char** content TSRMLS Deletes the char-object */ PHP_FUNCTION(ifx_free_char) { - zval *pid; + zval **pid; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pid)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pid); + convert_to_long_ex(pid); - if(php_intifx_free_char(Z_LVAL_P(pid),&EG(regular_list) TSRMLS_CC) < 0) { + if(php_intifx_free_char(Z_LVAL_PP(pid),&EG(regular_list) TSRMLS_CC) < 0) { RETURN_FALSE; } RETURN_TRUE; @@ -3640,7 +3640,7 @@ static long php_intifx_free_char(long bid, HashTable *list TSRMLS_DC) Ifx_char = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_char->type==TYPE_CHAR)) { - php_error(E_WARNING, "%s(): %d is not a Informix char-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix char-result index", bid); return -1; } @@ -3666,15 +3666,15 @@ static long php_intifx_free_char(long bid, HashTable *list TSRMLS_DC) Updates the content of the char-object */ PHP_FUNCTION(ifx_update_char) { - zval *pbid,*pparam; + zval **pbid, **pparam; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &pbid,&pparam)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &pbid,&pparam) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); - convert_to_string(pparam); + convert_to_long_ex(pbid); + convert_to_string_ex(pparam); - if(php_intifx_update_char(Z_LVAL_P(pbid),Z_STRVAL_P(pparam),Z_STRLEN_P(pparam),&EG(regular_list) TSRMLS_CC) < 0) { + if(php_intifx_update_char(Z_LVAL_PP(pbid),Z_STRVAL_PP(pparam),Z_STRLEN_PP(pparam),&EG(regular_list) TSRMLS_CC) < 0) { RETURN_FALSE; } RETURN_TRUE; @@ -3700,7 +3700,7 @@ static long php_intifx_update_char(long bid, char* param, long len, HashTable *l Ifx_char = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult && !(Ifx_char->type==TYPE_CHAR)) { - php_error(E_WARNING, "%s(): %d is not a Informix char-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix char-result index", bid); return -1; } @@ -3716,7 +3716,7 @@ static long php_intifx_update_char(long bid, char* param, long len, HashTable *l } else { Ifx_char->CHAR.char_data=emalloc(len+1); if(Ifx_char->CHAR.char_data==NULL) { - php_error(E_WARNING, "%s(): Can't create char-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create char-resource"); return -1; } memcpy(Ifx_char->CHAR.char_data,param,len); @@ -3741,15 +3741,15 @@ $ifdef HAVE_IFX_IUS; Creates a slob-object and opens it */ PHP_FUNCTION(ifxus_create_slob) { - zval *pmode; + zval **pmode; long id; long mode,create_mode; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pmode)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &pmode)==FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); - mode=Z_LVAL_P(pmode); + convert_to_long_ex(pmode); + mode=Z_LVAL_PP(pmode); create_mode=0; if((mode&1) !=0) @@ -3791,20 +3791,20 @@ static long php_intifxus_create_slob(long create_mode, HashTable *list TSRMLS_DC Ifx_slob=emalloc(sizeof(IFX_IDRES)); if(Ifx_slob==NULL) { - php_error(E_WARNING, "%s(): Can't create slob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource"); return -1; } errcode=ifx_lo_def_create_spec(&(Ifx_slob->SLOB.createspec)); if(errcode<0) { - php_error(E_WARNING, "%s(): Can't create slob-resource: %d", get_active_function_name(TSRMLS_C), errcode); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource: %d", errcode); return -1; } Ifx_slob->type=TYPE_SLOB; Ifx_slob->SLOB.lofd=ifx_lo_create(Ifx_slob->SLOB.createspec,create_mode,&(Ifx_slob->SLOB.slob_data),&errcode); if(errcode<0 || Ifx_slob->SLOB.lofd<0) { - php_error(E_WARNING, "%s(): Can't create slob-resource: %d", get_active_function_name(TSRMLS_C), errcode); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource: %d", errcode); return -1; } return zend_list_insert(Ifx_slob,le_idresult); @@ -3823,14 +3823,14 @@ static long php_intifxus_create_slob(long create_mode, HashTable *list TSRMLS_DC Deletes the slob-object */ PHP_FUNCTION(ifxus_free_slob) { - zval *pid; + zval **pid; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pid)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &pid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pid); + convert_to_long_ex(pid); - if(php_intifxus_free_slob(Z_LVAL_P(pid),&EG(regular_list) TSRMLS_CC) < 0) { + if(php_intifxus_free_slob(Z_LVAL_PP(pid),&EG(regular_list) TSRMLS_CC) < 0) { RETURN_FALSE; } RETURN_TRUE; @@ -3855,7 +3855,7 @@ static long php_intifxus_free_slob(long bid, HashTable *list TSRMLS_DC) Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); return -1; } @@ -3885,13 +3885,13 @@ static long php_intifxus_free_slob(long bid, HashTable *list TSRMLS_DC) Deletes the slob-object */ PHP_FUNCTION(ifxus_close_slob) { - zval *pid; + zval **pid; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pid)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &pid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pid); - if(php_intifxus_close_slob(Z_LVAL_P(pid),&EG(regular_list) TSRMLS_CC) < 0) { + convert_to_long_ex(pid); + if(php_intifxus_close_slob(Z_LVAL_PP(pid),&EG(regular_list) TSRMLS_CC) < 0) { RETURN_FALSE; } RETURN_TRUE; @@ -3916,17 +3916,17 @@ static long php_intifxus_close_slob(long bid, HashTable *list TSRMLS_DC) Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); return -1; } if(Ifx_slob->SLOB.lofd<0) { - php_error(E_WARNING, "%s(): Slob-resource already closed", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Slob-resource already closed"); return -1; } if(ifx_lo_close(Ifx_slob->SLOB.lofd)<0) { - php_error(E_WARNING, "%s(): Can't close slob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't close slob-resource"); return -1; } Ifx_slob->SLOB.lofd=-1; @@ -3947,15 +3947,15 @@ static long php_intifxus_close_slob(long bid, HashTable *list TSRMLS_DC) Opens an slob-object */ PHP_FUNCTION(ifxus_open_slob) { - zval *pbid,*pmode; + zval **pbid, **pmode; long mode,create_mode; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 1, &pbid,&pmode)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(1, &pbid, &pmode) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pmode); - convert_to_long(pbid); - mode=Z_LVAL_P(pmode); + convert_to_long_ex(pmode); + convert_to_long_ex(pbid); + mode=Z_LVAL_PP(pmode); create_mode=0; if((mode&1) !=0) @@ -3994,18 +3994,18 @@ static long php_intifxus_open_slob(long bid, long create_mode, HashTable *list T Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); return -1; } if(Ifx_slob->SLOB.lofd>0) { - php_error(E_WARNING, "%s(): Slob-resource already open", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Slob-resource already open"); return -1; } Ifx_slob->SLOB.lofd=ifx_lo_open(&(Ifx_slob->SLOB.slob_data),create_mode,&errcode); if(errcode < 0 || Ifx_slob->SLOB.lofd < 0) { - php_error(E_WARNING, "%s(): Can't open slob-resource: %d", get_active_function_name(TSRMLS_C), errcode); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open slob-resource: %d", errcode); return -1; } return 0; @@ -4026,7 +4026,7 @@ static long php_intifxus_new_slob(HashTable *list) Ifx_slob=emalloc(sizeof(IFX_IDRES)); if(Ifx_slob==NULL) { - php_error(E_WARNING, "%s(): Can't create slob-resource", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create slob-resource"); return -1; } @@ -4052,7 +4052,7 @@ static ifx_lo_t *php_intifxus_get_slobloc(long bid, HashTable *list TSRMLS_DC) Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); return NULL; } return &(Ifx_slob->SLOB.slob_data); @@ -4071,32 +4071,32 @@ static ifx_lo_t *php_intifxus_get_slobloc(long bid, HashTable *list TSRMLS_DC) Returns the current file or seek position of an open slob-object */ PHP_FUNCTION(ifxus_tell_slob) { - zval *pbid; + zval **pbid; long bid; IFX_IDRES *Ifx_slob; ifx_int8_t akt_seek_pos; int type; long lakt_seek_pos; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &pbid)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &pbid) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); - bid=Z_LVAL_P(pbid); + convert_to_long_ex(pbid); + bid=Z_LVAL_PP(pbid); Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING,"%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); RETURN_FALSE; } if(ifx_lo_tell(Ifx_slob->SLOB.lofd,&akt_seek_pos)<0) { - php_error(E_WARNING,"%s(): Can't perform tell-operation", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't perform tell-operation"); RETURN_FALSE; } if(ifx_int8tolong(&akt_seek_pos,&lakt_seek_pos)<0) { - php_error(E_WARNING, "%s(): Seek-position to large for long", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Seek-position to large for long"); RETURN_FALSE; } RETURN_LONG(lakt_seek_pos); @@ -4118,42 +4118,42 @@ PHP_FUNCTION(ifxus_tell_slob) Sets the current file or seek position of an open slob-object */ PHP_FUNCTION(ifxus_seek_slob) { - zval *pbid, *pmode, *poffset; + zval **pbid, **pmode, **poffset; long bid,lakt_seek_pos; IFX_IDRES *Ifx_slob; ifx_int8_t akt_seek_pos,offset; int type,mode; - if (ZEND_NUM_ARGS()!=3 || getParameters(ht, 3, &pbid, &pmode, &poffset)==FAILURE) { + if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &pbid, &pmode, &poffset) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); - convert_to_long(pmode); - convert_to_long(poffset); + convert_to_long_ex(pbid); + convert_to_long_ex(pmode); + convert_to_long_ex(poffset); - bid=Z_LVAL_P(pbid); + bid=Z_LVAL_PP(pbid); Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); RETURN_FALSE; } mode=LO_SEEK_SET; - if(Z_LVAL_P(pmode)==1) { + if(Z_LVAL_PP(pmode)==1) { mode=LO_SEEK_CUR; } - if(Z_LVAL_P(pmode)==2) { + if(Z_LVAL_PP(pmode)==2) { mode=LO_SEEK_END; } - ifx_int8cvlong(Z_LVAL_P(poffset),&offset); + ifx_int8cvlong(Z_LVAL_PP(poffset),&offset); if(ifx_lo_seek(Ifx_slob->SLOB.lofd,&offset,mode,&akt_seek_pos)<0) { - php_error(E_WARNING, "%s(): Can't perform seek-operation", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't perform seek-operation"); RETURN_FALSE; } if(ifx_int8tolong(&akt_seek_pos,&lakt_seek_pos)<0) { - php_error(E_WARNING, "%s(): Seek-position to large for long", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Seek-position to large for long"); RETURN_FALSE; } RETURN_LONG(lakt_seek_pos); @@ -4174,30 +4174,30 @@ PHP_FUNCTION(ifxus_seek_slob) Reads nbytes of the slob-object */ PHP_FUNCTION(ifxus_read_slob) { - zval *pbid, *pnbytes; + zval **pbid, **pnbytes; long bid, nbytes; IFX_IDRES *Ifx_slob; int errcode,type; char *buffer; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &pbid, &pnbytes)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &pbid, &pnbytes) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); - convert_to_long(pnbytes); + convert_to_long_ex(pbid); + convert_to_long_ex(pnbytes); - bid=Z_LVAL_P(pbid); + bid=Z_LVAL_PP(pbid); Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); RETURN_FALSE; } - nbytes=Z_LVAL_P(pnbytes); + nbytes=Z_LVAL_PP(pnbytes); buffer=emalloc(nbytes); if(ifx_lo_read(Ifx_slob->SLOB.lofd,buffer,nbytes,&errcode)<0) { efree(buffer); - php_error(E_WARNING, "%s(): Error reading slob: %d", get_active_function_name(TSRMLS_C), errcode); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error reading slob: %d", errcode); RETURN_FALSE; } RETURN_STRINGL(buffer,nbytes,0); @@ -4218,35 +4218,35 @@ PHP_FUNCTION(ifxus_read_slob) Writes a string into the slob-object */ PHP_FUNCTION(ifxus_write_slob) { - zval *pbid, *pcontent; + zval **pbid, **pcontent; long bid, nbytes; IFX_IDRES *Ifx_slob; int errcode,type; char *buffer; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &pbid, &pcontent)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &pbid, &pcontent) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(pbid); - convert_to_string(pcontent); + convert_to_long_ex(pbid); + convert_to_string_ex(pcontent); - bid=Z_LVAL_P(pbid); + bid=Z_LVAL_PP(pbid); Ifx_slob = (IFX_IDRES *) zend_list_find(bid,&type); if (type!=le_idresult || Ifx_slob->type!=TYPE_SLOB) { - php_error(E_WARNING, "%s(): %d is not a Informix slob-result index", get_active_function_name(TSRMLS_C), bid); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a Informix slob-result index", bid); RETURN_FALSE; } - buffer=Z_STRVAL_P(pcontent); - nbytes=Z_STRLEN_P(pcontent); + buffer=Z_STRVAL_PP(pcontent); + nbytes=Z_STRLEN_PP(pcontent); if(nbytes<=0) { - php_error(E_WARNING, "%s(): String has no content", get_active_function_name(TSRMLS_C)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "String has no content"); RETURN_FALSE; } if((nbytes=ifx_lo_write(Ifx_slob->SLOB.lofd,buffer,nbytes,&errcode))<0) { - php_error(E_WARNING, "%s(): Error writing slob: %d", get_active_function_name(TSRMLS_C), errcode); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error writing slob: %d", errcode); RETURN_FALSE; } diff --git a/ext/interbase/interbase.c b/ext/interbase/interbase.c index 149e41885e..327dd78189 100644 --- a/ext/interbase/interbase.c +++ b/ext/interbase/interbase.c @@ -277,7 +277,7 @@ static void _php_ibase_error(TSRMLS_D) strcat(IBG(errmsg), " "); s = IBG(errmsg) + strlen(IBG(errmsg)); } - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), IBG(errmsg)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg)); } /* }}} */ @@ -293,7 +293,7 @@ static void _php_ibase_module_error(char *msg, ...) vsnprintf(IBG(errmsg), MAX_ERRMSG, msg, ap); va_end(ap); - php_error(E_WARNING, "%s(): %s", get_active_function_name(TSRMLS_C), IBG(errmsg)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", IBG(errmsg)); } /* }}} */ @@ -467,7 +467,7 @@ static void _php_ibase_free_blob(zend_rsrc_list_entry *rsrc TSRMLS_DC) if (ib_blob->bl_handle != NULL) { /* blob open*/ if (isc_cancel_blob(IB_STATUS, &ib_blob->bl_handle)) { - php_error(E_ERROR, "You can lose data. Close any blob after reading of writing it. Use ibase_blob_close() before calling ibase_close()"); + php_error_docref(NULL TSRMLS_CC, E_ERROR, "You can lose data. Close any blob after reading of writing it. Use ibase_blob_close() before calling ibase_close()"); } } efree(ib_blob); @@ -1616,7 +1616,7 @@ static void _php_ibase_trans_end(INTERNAL_FUNCTION_PARAMETERS, int commit) } if (ib_link->trans[trans_n] == NULL) { - php_error(E_WARNING, "Trying to commit or rollback an already handled transaction"); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to commit or rollback an already handled transaction"); RETURN_FALSE; } @@ -2585,18 +2585,18 @@ PHP_FUNCTION(ibase_blob_create) Open blob for retriving data parts */ PHP_FUNCTION(ibase_blob_open) { - pval *blob_arg; + zval **blob_arg; ibase_blob_handle *ib_blob, *ib_blob_id; RESET_ERRMSG; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &blob_arg)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &blob_arg) == FAILURE) { WRONG_PARAM_COUNT; } ib_blob = (ibase_blob_handle *) emalloc(sizeof(ibase_blob_handle)); - GET_BLOB_ID_ARG(blob_arg, ib_blob_id); + GET_BLOB_ID_ARG(*blob_arg, ib_blob_id); if (ib_blob_id == NULL) { /* blob IS NULL or argument unset */ RETURN_FALSE; @@ -2621,20 +2621,20 @@ PHP_FUNCTION(ibase_blob_open) Add data into created blob */ PHP_FUNCTION(ibase_blob_add) { - pval *blob_arg, *string_arg; + zval **blob_arg, **string_arg; ibase_blob_handle *ib_blob; RESET_ERRMSG; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &blob_arg, &string_arg)==FAILURE) { + if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &blob_arg, &string_arg) == FAILURE) { WRONG_PARAM_COUNT; } - GET_BLOB_HANDLE_ARG(blob_arg, ib_blob); + GET_BLOB_HANDLE_ARG(*blob_arg, ib_blob); - convert_to_string(string_arg); + convert_to_string_ex(string_arg); - if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_P(string_arg), Z_STRVAL_P(string_arg))) { + if (isc_put_segment(IB_STATUS, &ib_blob->bl_handle, (unsigned short) Z_STRLEN_PP(string_arg), Z_STRVAL_PP(string_arg))) { _php_ibase_error(TSRMLS_C); RETURN_FALSE; } @@ -2646,7 +2646,7 @@ PHP_FUNCTION(ibase_blob_add) Get len bytes data from open blob */ PHP_FUNCTION(ibase_blob_get) { - pval *blob_arg, *len_arg; + zval **blob_arg, **len_arg; int stat; char *bl_data; unsigned short max_len = 0, cur_len, seg_len; @@ -2654,14 +2654,14 @@ PHP_FUNCTION(ibase_blob_get) RESET_ERRMSG; - if (ZEND_NUM_ARGS() != 2 || getParameters(ht, 2, &blob_arg, &len_arg) == FAILURE) { + if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &blob_arg, &len_arg) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(len_arg); - max_len = (unsigned short) Z_LVAL_P(len_arg); + convert_to_long_ex(len_arg); + max_len = (unsigned short) Z_LVAL_PP(len_arg); - GET_BLOB_HANDLE_ARG(blob_arg, ib_blob); + GET_BLOB_HANDLE_ARG(*blob_arg, ib_blob); if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/ @@ -2697,16 +2697,16 @@ PHP_FUNCTION(ibase_blob_get) /* Close or Cancel created or Close open blob */ static void _php_ibase_blob_end(INTERNAL_FUNCTION_PARAMETERS, int bl_end) { - pval *blob_arg; + zval *blob_arg; ibase_blob_handle *ib_blob; RESET_ERRMSG; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &blob_arg)==FAILURE) { + if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, &blob_arg) == FAILURE) { WRONG_PARAM_COUNT; } - GET_BLOB_HANDLE_ARG(blob_arg, ib_blob); + GET_BLOB_HANDLE_ARG(*blob_arg, ib_blob); if (bl_end == BLOB_CLOSE) { /* return id here */ if (ib_blob->bl_qd.gds_quad_high || ib_blob->bl_qd.gds_quad_low) { /*not null ?*/ @@ -2750,17 +2750,17 @@ PHP_FUNCTION(ibase_blob_cancel) Return blob length and other useful info */ PHP_FUNCTION(ibase_blob_info) { - pval *blob_arg, *result_var; + zval **blob_arg, **result_var; ibase_blob_handle *ib_blob_id; IBASE_BLOBINFO bl_info; RESET_ERRMSG; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &blob_arg)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &blob_arg) == FAILURE) { WRONG_PARAM_COUNT; } - GET_BLOB_ID_ARG(blob_arg, ib_blob_id); + GET_BLOB_ID_ARG(*blob_arg, ib_blob_id); if (array_init(return_value)==FAILURE){ RETURN_FALSE; @@ -2823,18 +2823,18 @@ PHP_FUNCTION(ibase_blob_info) Output blob contents to browser */ PHP_FUNCTION(ibase_blob_echo) { - pval *blob_arg; + zval *blob_arg; char bl_data[IBASE_BLOB_SEG]; unsigned short seg_len; ibase_blob_handle *ib_blob_id; RESET_ERRMSG; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &blob_arg)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &blob_arg) == FAILURE) { WRONG_PARAM_COUNT; } - GET_BLOB_ID_ARG(blob_arg, ib_blob_id); + GET_BLOB_ID_ARG(*blob_arg, ib_blob_id); if (ib_blob_id) { /*not null ?*/ diff --git a/ext/sybase/php_sybase_db.c b/ext/sybase/php_sybase_db.c index f2f9be9601..ef8b5e3d0f 100644 --- a/ext/sybase/php_sybase_db.c +++ b/ext/sybase/php_sybase_db.c @@ -134,7 +134,7 @@ ZEND_GET_MODULE(sybase) THREAD_LS sybase_module php_sybase_module; -#define CHECK_LINK(link) { if (link==-1) { php_error(E_WARNING,"Sybase: A link to the server could not be established"); RETURN_FALSE; } } +#define CHECK_LINK(link) { if (link==-1) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: A link to the server could not be established"); RETURN_FALSE; } } static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pval **result_ptr, int column_type); @@ -144,7 +144,7 @@ static int php_sybase_error_handler(DBPROCESS *dbproc,int severity,int dberr, int oserr,char *dberrstr,char *oserrstr) { if (severity >= php_sybase_module.min_error_severity) { - php_error(E_WARNING,"Sybase error: %s (severity %d)",dberrstr,severity); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase error: %s (severity %d)",dberrstr,severity); } return INT_CANCEL; } @@ -155,7 +155,7 @@ static int php_sybase_message_handler(DBPROCESS *dbproc,DBINT msgno,int msgstate char *procname,DBUSMALLINT line) { if (severity >= php_sybase_module.min_message_severity) { - php_error(E_WARNING,"Sybase message: %s (severity %d)",msgtext,severity); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase message: %s (severity %d)",msgtext,severity); } STR_FREE(php_sybase_module.server_message); php_sybase_module.server_message = estrdup(msgtext); @@ -313,88 +313,88 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) strcpy(hashed_details,"sybase___"); break; case 1: { - pval *yyhost; + zval **yyhost; - if (getParameters(ht, 1, &yyhost)==FAILURE) { + if (zend_get_parameters_ex(1, &yyhost) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - host = Z_STRVAL_P(yyhost); - hashed_details_length = Z_STRLEN_P(yyhost)+6+5; + convert_to_string_ex(yyhost); + host = Z_STRVAL_PP(yyhost); + hashed_details_length = Z_STRLEN_PP(yyhost)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s____",Z_STRVAL_P(yyhost)); + sprintf(hashed_details,"sybase_%s____", Z_STRVAL_PP(yyhost)); } break; case 2: { - pval *yyhost,*yyuser; + zval **yyhost, **yyuser; - if (getParameters(ht, 2, &yyhost, &yyuser)==FAILURE) { + if (zend_get_parameters_ex(ht, 2, &yyhost, &yyuser) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+6+5; + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s___",Z_STRVAL_P(yyhost),Z_STRVAL_P(yyuser)); + sprintf(hashed_details,"sybase_%s_%s___",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser)); } break; case 3: { - pval *yyhost,*yyuser,*yypasswd; + zval **yyhost, **yyuser,**yypasswd; - if (getParameters(ht, 3, &yyhost, &yyuser, &yypasswd) == FAILURE) { + if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - convert_to_string(yypasswd); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - passwd = Z_STRVAL_P(yypasswd); - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+Z_STRLEN_P(yypasswd)+6+5; + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + convert_to_string_ex(yypasswd); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + passwd = Z_STRVAL_PP(yypasswd); + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s_%s__",Z_STRVAL_P(yyhost),Z_STRVAL_P(yyuser),Z_STRVAL_P(yypasswd)); /* SAFE */ + sprintf(hashed_details,"sybase_%s_%s_%s__",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd)); /* SAFE */ } break; case 4: { - pval *yyhost,*yyuser,*yypasswd,*yycharset; + zval **yyhost, **yyuser, **yypasswd, **yycharset; - if (getParameters(ht, 4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { + if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - convert_to_string(yypasswd); - convert_to_string(yycharset); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - passwd = Z_STRVAL_P(yypasswd); - charset = Z_STRVAL_P(yycharset); - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+Z_STRLEN_P(yypasswd)+Z_STRLEN_P(yycharset)+6+5; + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + convert_to_string_ex(yypasswd); + convert_to_string_ex(yycharset); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + passwd = Z_STRVAL_PP(yypasswd); + charset = Z_STRVAL_PP(yycharset); + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s_%s_%s_",Z_STRVAL_P(yyhost),Z_STRVAL_P(yyuser),Z_STRVAL_P(yypasswd),Z_STRVAL_P(yycharset)); /* SAFE */ + sprintf(hashed_details,"sybase_%s_%s_%s_%s_",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd),Z_STRVAL_PP(yycharset)); /* SAFE */ } break; case 5: { - pval *yyhost,*yyuser,*yypasswd,*yycharset, *yyappname; + zval **yyhost, **yyuser, **yypasswd, **yycharset, **yyappname; - if (getParameters(ht, 5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { + if (zend_get_parameters_ex(5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - convert_to_string(yypasswd); - convert_to_string(yycharset); - convert_to_string(yyappname); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - passwd = Z_STRVAL_P(yypasswd); - charset = Z_STRVAL_P(yycharset); - appname = Z_STRVAL_P(yyappname); - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+Z_STRLEN_P(yypasswd)+Z_STRLEN_P(yycharset)+Z_STRLEN_P(yyappname)+6+5; + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + convert_to_string_ex(yypasswd); + convert_to_string_ex(yycharset); + convert_to_string_ex(yyappname); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + passwd = Z_STRVAL_PP(yypasswd); + charset = Z_STRVAL_PP(yycharset); + appname = Z_STRVAL_PP(yyappname); + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_P(yycharset)+Z_STRLEN_PP(yyappname)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details,"sybase_%s_%s_%s_%s_%s",Z_STRVAL_P(yyhost),Z_STRVAL_P(yyuser),Z_STRVAL_P(yypasswd),Z_STRVAL_P(yycharset),Z_STRVAL_P(yyappname)); /* SAFE */ + sprintf(hashed_details,"sybase_%s_%s_%s_%s_%s",Z_STRVAL_PP(yyhost),Z_STRVAL_PP(yyuser),Z_STRVAL_PP(yypasswd),Z_STRVAL_PP(yycharset),Z_STRVAL_PP(yyappname)); /* SAFE */ } break; default: @@ -405,7 +405,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) /* set a DBLOGIN record */ if ((sybase.login=dblogin())==NULL) { - php_error(E_WARNING,"Sybase: Unable to allocate login record"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to allocate login record"); efree(hashed_details); RETURN_FALSE; } @@ -438,20 +438,20 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) list_entry new_le; if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { - php_error(E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); efree(hashed_details); dbloginfree(sybase.login); RETURN_FALSE; } if (php_sybase_module.max_persistent!=-1 && php_sybase_module.num_persistent>=php_sybase_module.max_persistent) { - php_error(E_WARNING,"Sybase: Too many open persistent links (%d)",php_sybase_module.num_persistent); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open persistent links (%d)",php_sybase_module.num_persistent); efree(hashed_details); dbloginfree(sybase.login); RETURN_FALSE; } /* create the link */ if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==FAIL) { - /*php_error(E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ + /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ efree(hashed_details); dbloginfree(sybase.login); RETURN_FALSE; @@ -479,7 +479,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) php_sybase_module.num_links++; } else { /* we do */ if (Z_TYPE_P(le) != php_sybase_module.le_plink) { - php_error(E_WARNING,"Sybase: Hashed persistent link is not a Sybase link!"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Hashed persistent link is not a Sybase link!"); efree(hashed_details); RETURN_FALSE; } @@ -488,7 +488,7 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) /* test that the link hasn't died */ if (DBDEAD(sybase_ptr->link)==TRUE) { if ((sybase_ptr->link=PHP_SYBASE_DBOPEN(sybase_ptr->login,host))==FAIL) { - /*php_error(E_WARNING,"Sybase: Link to server lost, unable to reconnect");*/ + /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Link to server lost, unable to reconnect");*/ zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1); efree(hashed_details); RETURN_FALSE; @@ -530,13 +530,13 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent) } } if (php_sybase_module.max_links!=-1 && php_sybase_module.num_links>=php_sybase_module.max_links) { - php_error(E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Too many open links (%d)",php_sybase_module.num_links); efree(hashed_details); RETURN_FALSE; } if ((sybase.link=PHP_SYBASE_DBOPEN(sybase.login,host))==NULL) { - /*php_error(E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ + /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to connect to server: %s",sybase_error(sybase));*/ efree(hashed_details); RETURN_FALSE; } @@ -598,7 +598,7 @@ PHP_FUNCTION(sybase_pconnect) Close Sybase connection */ PHP_FUNCTION(sybase_close) { - pval *sybase_link_index; + zval **sybase_link_index; int id,type; switch (ZEND_NUM_ARGS()) { @@ -606,11 +606,11 @@ PHP_FUNCTION(sybase_close) id = php_sybase_module.default_link; break; case 1: - if (getParameters(ht, 1, &sybase_link_index)==FAILURE) { + if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { RETURN_FALSE; } - convert_to_long(sybase_link_index); - id = Z_LVAL_P(sybase_link_index); + convert_to_long_ex(sybase_link_index); + id = Z_LVAL_PP(sybase_link_index); break; default: WRONG_PARAM_COUNT; @@ -619,7 +619,7 @@ PHP_FUNCTION(sybase_close) zend_list_find(id,&type); if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error(E_WARNING,"%d is not a Sybase link index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); RETURN_FALSE; } @@ -633,23 +633,23 @@ PHP_FUNCTION(sybase_close) Select Sybase database */ PHP_FUNCTION(sybase_select_db) { - pval *db,*sybase_link_index; + zval *db, **sybase_link_index; int id,type; sybase_link *sybase_ptr; switch(ZEND_NUM_ARGS()) { case 1: - if (getParameters(ht, 1, &db)==FAILURE) { + if (zend_get_parameters_ex(1, &db) == FAILURE) { RETURN_FALSE; } id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); break; case 2: - if (getParameters(ht, 2, &db, &sybase_link_index)==FAILURE) { + if (zend_get_parameters_ex(2, &db, &sybase_link_index) == FAILURE) { RETURN_FALSE; } - convert_to_long(sybase_link_index); - id = Z_LVAL_P(sybase_link_index); + convert_to_long_ex(sybase_link_index); + id = Z_LVAL_PP(sybase_link_index); break; default: WRONG_PARAM_COUNT; @@ -660,14 +660,14 @@ PHP_FUNCTION(sybase_select_db) sybase_ptr = (sybase_link *) zend_list_find(id,&type); if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error(E_WARNING,"%d is not a Sybase link index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); RETURN_FALSE; } convert_to_string(db); - if (dbuse(sybase_ptr->link,Z_STRVAL_P(db))==FAIL) { - /*php_error(E_WARNING,"Sybase: Unable to select database: %s",sybase_error(sybase));*/ + if (dbuse(sybase_ptr->link,Z_STRVAL_PP(db))==FAIL) { + /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to select database: %s",sybase_error(sybase));*/ RETURN_FALSE; } else { RETURN_TRUE; @@ -758,7 +758,7 @@ static void php_sybase_get_column_content(sybase_link *sybase_ptr,int offset,pva Z_STRVAL_P(result) = res_buf; Z_TYPE_P(result) = IS_STRING; } else { - php_error(E_WARNING,"Sybase: column %d has unknown data type (%d)", offset, coltype(offset)); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: column %d has unknown data type (%d)", offset, coltype(offset)); ZVAL_FALSE(result); } } @@ -781,17 +781,17 @@ PHP_FUNCTION(sybase_query) switch(ZEND_NUM_ARGS()) { case 1: - if (getParameters(ht, 1, &query)==FAILURE) { + if (zend_get_parameters_ex(1, &query) == FAILURE) { RETURN_FALSE; } id = php_sybase_module.default_link; break; case 2: - if (getParameters(ht, 2, &query, &sybase_link_index)==FAILURE) { + if (zend_get_parameters_ex(2, &query, &sybase_link_index) == FAILURE) { RETURN_FALSE; } - convert_to_long(sybase_link_index); - id = Z_LVAL_P(sybase_link_index); + convert_to_long_ex(sybase_link_index); + id = Z_LVAL_PP(sybase_link_index); break; default: WRONG_PARAM_COUNT; @@ -800,17 +800,17 @@ PHP_FUNCTION(sybase_query) sybase_ptr = (sybase_link *) zend_list_find(id,&type); if (type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) { - php_error(E_WARNING,"%d is not a Sybase link index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); RETURN_FALSE; } - convert_to_string(query); - if (dbcmd(sybase_ptr->link,Z_STRVAL_P(query))==FAIL) { - /*php_error(E_WARNING,"Sybase: Unable to set query");*/ + convert_to_string_ex(query); + if (dbcmd(sybase_ptr->link,Z_STRVAL_PP(query))==FAIL) { + /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Unable to set query");*/ RETURN_FALSE; } if (dbsqlexec(sybase_ptr->link)==FAIL || dbresults(sybase_ptr->link)==FAIL) { - /*php_error(E_WARNING,"Sybase: Query failed");*/ + /*php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Query failed");*/ RETURN_FALSE; } @@ -915,22 +915,22 @@ PHP_FUNCTION(sybase_query) Free result memory */ PHP_FUNCTION(sybase_free_result) { - pval *sybase_result_index; + zval **sybase_result_index; sybase_result *result; int type; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(sybase_result_index); - if (Z_LVAL_P(sybase_result_index)==0) { + convert_to_long_ex(sybase_result_index);~ + if (Z_LVAL_PP(sybase_result_index)==0) { RETURN_FALSE; } - result = (sybase_result *) zend_list_find(Z_LVAL_P(sybase_result_index),&type); + result = (sybase_result *) zend_list_find(Z_LVAL_PP(sybase_result_index),&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",Z_LVAL_P(sybase_result_index)); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",Z_LVAL_PP(sybase_result_index)); RETURN_FALSE; } zend_list_delete(Z_LVAL_P(sybase_result_index)); @@ -952,20 +952,20 @@ PHP_FUNCTION(sybase_get_last_message) Get number of rows in result */ PHP_FUNCTION(sybase_num_rows) { - pval *result_index; + zval **result_index; int type,id; sybase_result *result; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &result_index) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(result_index); - id = Z_LVAL_P(result_index); + convert_to_long_ex(result_index); + id = Z_LVAL_PP(result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } @@ -978,20 +978,20 @@ PHP_FUNCTION(sybase_num_rows) Get number of fields in result */ PHP_FUNCTION(sybase_num_fields) { - pval *result_index; + zval **result_index; int type,id; sybase_result *result; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &result_index) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(result_index); - id = Z_LVAL_P(result_index); + convert_to_long_ex(result_index); + id = Z_LVAL_PP(result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } @@ -1004,21 +1004,21 @@ PHP_FUNCTION(sybase_num_fields) Get row as enumerated array */ PHP_FUNCTION(sybase_fetch_row) { - pval *sybase_result_index; + zval **sybase_result_index; int type,i,id; sybase_result *result; pval *field_content; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index)==FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(sybase_result_index); - id = Z_LVAL_P(sybase_result_index); + convert_to_long_ex(sybase_result_index); + id = Z_LVAL_PP(sybase_result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } @@ -1038,20 +1038,20 @@ PHP_FUNCTION(sybase_fetch_row) static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) { - pval *sybase_result_index; + zval **sybase_result_index; sybase_result *result; int type; int i; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(sybase_result_index); - result = (sybase_result *) zend_list_find(Z_LVAL_P(sybase_result_index),&type); + convert_to_long_ex(sybase_result_index); + result = (sybase_result *) zend_list_find(Z_LVAL_PP(sybase_result_index),&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",Z_LVAL_P(sybase_result_index)); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",Z_LVAL_PP(sybase_result_index)); RETURN_FALSE; } @@ -1059,9 +1059,7 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS) RETURN_FALSE; } - if (array_init(return_value)==FAILURE) { - RETURN_FALSE; - } + array_init(return_value); for (i=0; i<result->num_fields; i++) { ZVAL_ADDREF(result->data[result->cur_row][i]); @@ -1098,30 +1096,30 @@ PHP_FUNCTION(sybase_fetch_array) Move internal row pointer */ PHP_FUNCTION(sybase_data_seek) { - pval *sybase_result_index,*offset; + zval **sybase_result_index, **offset; int type,id; sybase_result *result; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &sybase_result_index, &offset)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(sybase_result_index); - id = Z_LVAL_P(sybase_result_index); + convert_to_long_ex(sybase_result_index); + id = Z_LVAL_PP(sybase_result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } - convert_to_long(offset); - if (Z_LVAL_P(offset)<0 || Z_LVAL_P(offset)>=result->num_rows) { - php_error(E_WARNING,"Sybase: Bad row offset"); + convert_to_long_ex(offset); + if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad row offset"); RETURN_FALSE; } - result->cur_row = Z_LVAL_P(offset); + result->cur_row = Z_LVAL_PP(offset); RETURN_TRUE; } /* }}} */ @@ -1177,35 +1175,35 @@ static char *php_sybase_get_field_name(int type) Get field information */ PHP_FUNCTION(sybase_fetch_field) { - pval *sybase_result_index,*offset; + zval **sybase_result_index, **offset; int type,id,field_offset; sybase_result *result; switch (ZEND_NUM_ARGS()) { case 1: - if (getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { RETURN_FALSE; } field_offset=-1; break; case 2: - if (getParameters(ht, 2, &sybase_result_index, &offset)==FAILURE) { + if (zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { RETURN_FALSE; } - convert_to_long(offset); - field_offset = Z_LVAL_P(offset); + convert_to_long_ex(offset); + field_offset = Z_LVAL_PP(offset); break; default: WRONG_PARAM_COUNT; break; } - convert_to_long(sybase_result_index); - id = Z_LVAL_P(sybase_result_index); + convert_to_long_ex(sybase_result_index); + id = Z_LVAL_PP(sybase_result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } @@ -1216,7 +1214,7 @@ PHP_FUNCTION(sybase_fetch_field) if (field_offset<0 || field_offset >= result->num_fields) { if (ZEND_NUM_ARGS()==2) { /* field specified explicitly */ - php_error(E_WARNING,"Sybase: Bad column offset"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset"); } RETURN_FALSE; } @@ -1236,28 +1234,28 @@ PHP_FUNCTION(sybase_fetch_field) Set field offset */ PHP_FUNCTION(sybase_field_seek) { - pval *sybase_result_index,*offset; + zval **sybase_result_index, **offset; int type,id,field_offset; sybase_result *result; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &sybase_result_index, &offset)==FAILURE) { + if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(sybase_result_index); - id = Z_LVAL_P(sybase_result_index); + convert_to_long_ex(sybase_result_index); + id = Z_LVAL_PP(sybase_result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } - convert_to_long(offset); - field_offset = Z_LVAL_P(offset); + convert_to_long_ex(offset); + field_offset = Z_LVAL_PP(offset); if (field_offset<0 || field_offset >= result->num_fields) { - php_error(E_WARNING,"Sybase: Bad column offset"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset"); RETURN_FALSE; } @@ -1270,31 +1268,31 @@ PHP_FUNCTION(sybase_field_seek) Get result data */ PHP_FUNCTION(sybase_result) { - pval *row, *field, *sybase_result_index; + zval **row, **field, **sybase_result_index; int id,type,field_offset=0; sybase_result *result; - if (ZEND_NUM_ARGS()!=3 || getParameters(ht, 3, &sybase_result_index, &row, &field)==FAILURE) { + if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &sybase_result_index, &row, &field) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(sybase_result_index); - id = Z_LVAL_P(sybase_result_index); + convert_to_long_ex(sybase_result_index); + id = Z_LVAL_PP(sybase_result_index); result = (sybase_result *) zend_list_find(id,&type); if (type!=php_sybase_module.le_result) { - php_error(E_WARNING,"%d is not a Sybase result index",id); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase result index",id); RETURN_FALSE; } - convert_to_long(row); - if (Z_LVAL_P(row)<0 || Z_LVAL_P(row)>=result->num_rows) { - php_error(E_WARNING,"Sybase: Bad row offset (%d)",Z_LVAL_P(row)); + convert_to_long_ex(row); + if (Z_LVAL_PP(row)<0 || Z_LVAL_PP(row)>=result->num_rows) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad row offset (%d)",Z_LVAL_PP(row)); RETURN_FALSE; } - switch(Z_TYPE_P(field)) { + switch(Z_TYPE_PP(field)) { case IS_STRING: { int i; @@ -1305,22 +1303,22 @@ PHP_FUNCTION(sybase_result) } } if (i>=result->num_fields) { /* no match found */ - php_error(E_WARNING,"Sybase: %s field not found in result",Z_STRVAL_P(field)); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: %s field not found in result",Z_STRVAL_PP(field)); RETURN_FALSE; } break; } default: - convert_to_long(field); - field_offset = Z_LVAL_P(field); + convert_to_long_ex(field); + field_offset = Z_LVAL_PP(field); if (field_offset<0 || field_offset>=result->num_fields) { - php_error(E_WARNING,"Sybase: Bad column offset specified"); + php_error_docref(NULL TSRMLS_CC, E_WARNING,"Sybase: Bad column offset specified"); RETURN_FALSE; } break; } - *return_value = *result->data[Z_LVAL_P(row)][field_offset]; + *return_value = *result->data[Z_LVAL_PP(row)][field_offset]; pval_copy_constructor(return_value); } /* }}} */ @@ -1330,48 +1328,36 @@ PHP_FUNCTION(sybase_result) Get number of affected rows in last query */ PHP_FUNCTION(sybase_affected_rows) { - pval *sybase_link_index = NULL; - sybase_link *sybase_ptr = NULL; - int id = 0; - int type = 0; - - switch(ZEND_NUM_ARGS()) - { - case 0: - { - id = php_sybase_module.default_link; - } - break; - - case 1: - { - if (getParameters(ht, 1, &sybase_link_index)==FAILURE) - { - RETURN_FALSE; - } - - convert_to_long(sybase_link_index); - id = Z_LVAL_P(sybase_link_index); - } - break; - - default: - { - WRONG_PARAM_COUNT; - } - break; - } + zval *sybase_link_index = NULL; + sybase_link *sybase_ptr = NULL; + int id = 0; + int type = 0; + + switch(ZEND_NUM_ARGS()) { + case 0: + id = php_sybase_module.default_link; + break; + case 1: + if (zend_get_parameters_ex(ht, 1, &sybase_link_index) == FAILURE) { + RETURN_FALSE; + } + convert_to_long_ex(sybase_link_index); + id = Z_LVAL_PP(sybase_link_index); + break; + default: + WRONG_PARAM_COUNT; + break; + } - sybase_ptr = (sybase_link *)zend_list_find(id, &type); + sybase_ptr = (sybase_link *)zend_list_find(id, &type); - if(type!=php_sybase_module.le_link && type!=php_sybase_module.le_plink) - { - php_error(E_WARNING,"%d is not a Sybase link index",id); - RETURN_FALSE; - } + if(type != php_sybase_module.le_link && type != php_sybase_module.le_plink) { + php_error_docref(NULL TSRMLS_CC, E_WARNING,"%d is not a Sybase link index",id); + RETURN_FALSE; + } - Z_LVAL_P(return_value) = DBCOUNT(sybase_ptr->link); - Z_TYPE_P(return_value) = IS_LONG; + Z_LVAL_P(return_value) = DBCOUNT(sybase_ptr->link); + Z_TYPE_P(return_value) = IS_LONG; } @@ -1409,13 +1395,13 @@ PHP_MINFO_FUNCTION(sybase) Sets the minimum error severity */ PHP_FUNCTION(sybase_min_error_severity) { - pval *severity; + zval **severity; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &severity)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(severity); - php_sybase_module.min_error_severity = Z_LVAL_P(severity); + convert_to_long_ex(severity); + php_sybase_module.min_error_severity = Z_LVAL_PP(severity); } /* }}} */ @@ -1423,13 +1409,13 @@ PHP_FUNCTION(sybase_min_error_severity) Sets the minimum message severity */ PHP_FUNCTION(sybase_min_message_severity) { - pval *severity; + zval **severity; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &severity)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(severity); - php_sybase_module.min_message_severity = Z_LVAL_P(severity); + convert_to_long_ex(severity); + php_sybase_module.min_message_severity = Z_LVAL_PP(severity); } /* }}} */ diff --git a/ext/sybase_ct/php_sybase_ct.c b/ext/sybase_ct/php_sybase_ct.c index bbb6c1a313..83fe5fbd2d 100644 --- a/ext/sybase_ct/php_sybase_ct.c +++ b/ext/sybase_ct/php_sybase_ct.c @@ -505,92 +505,92 @@ static void php_sybase_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) strcpy(hashed_details, "sybase_____"); break; case 1: { - zval *yyhost; + zval **yyhost; - if (getParameters(ht, 1, &yyhost)==FAILURE) { + if (zend_get_parameters_ex(1, &yyhost) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - host = Z_STRVAL_P(yyhost); + convert_to_string_ex(yyhost); + host = Z_STRVAL_PP(yyhost); user=passwd=charset=appname=NULL; - hashed_details_length = Z_STRLEN_P(yyhost)+6+5; + hashed_details_length = Z_STRLEN_PP(yyhost)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s____", Z_STRVAL_P(yyhost)); + sprintf(hashed_details, "sybase_%s____", Z_STRVAL_PP(yyhost)); } break; case 2: { - zval *yyhost, *yyuser; + zval **yyhost, **yyuser; - if (getParameters(ht, 2, &yyhost, &yyuser)==FAILURE) { + if (zend_get_parameters_ex(2, &yyhost, &yyuser) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); passwd=charset=appname=NULL; - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+6+5; + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s___", Z_STRVAL_P(yyhost), Z_STRVAL_P(yyuser)); + sprintf(hashed_details, "sybase_%s_%s___", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser)); } break; case 3: { - zval *yyhost, *yyuser, *yypasswd; + zval **yyhost, **yyuser, **yypasswd; - if (getParameters(ht, 3, &yyhost, &yyuser, &yypasswd) == FAILURE) { + if (zend_get_parameters_ex(3, &yyhost, &yyuser, &yypasswd) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - convert_to_string(yypasswd); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - passwd = Z_STRVAL_P(yypasswd); + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + convert_to_string_ex(yypasswd); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + passwd = Z_STRVAL_PP(yypasswd); charset=appname=NULL; - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+Z_STRLEN_P(yypasswd)+6+5; + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s_%s__", Z_STRVAL_P(yyhost), Z_STRVAL_P(yyuser), Z_STRVAL_P(yypasswd)); + sprintf(hashed_details, "sybase_%s_%s_%s__", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd)); } break; case 4: { - zval *yyhost, *yyuser, *yypasswd, *yycharset; + zval **yyhost, **yyuser, **yypasswd, **yycharset; - if (getParameters(ht, 4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { + if (zend_get_parameters_ex(4, &yyhost, &yyuser, &yypasswd, &yycharset) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - convert_to_string(yypasswd); - convert_to_string(yycharset); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - passwd = Z_STRVAL_P(yypasswd); - charset = Z_STRVAL_P(yycharset); + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + convert_to_string_ex(yypasswd); + convert_to_string_ex(yycharset); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + passwd = Z_STRVAL_PP(yypasswd); + charset = Z_STRVAL_PP(yycharset); appname=NULL; - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+Z_STRLEN_P(yypasswd)+Z_STRLEN_P(yycharset)+6+5; + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s_%s_%s_", Z_STRVAL_P(yyhost), Z_STRVAL_P(yyuser), Z_STRVAL_P(yypasswd), Z_STRVAL_P(yycharset)); + sprintf(hashed_details, "sybase_%s_%s_%s_%s_", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset)); } break; case 5: { - zval *yyhost, *yyuser, *yypasswd, *yycharset, *yyappname; + zval **yyhost, **yyuser, **yypasswd, **yycharset, **yyappname; - if (getParameters(ht, 5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { + if (zend_get_parameters_ex(5, &yyhost, &yyuser, &yypasswd, &yycharset, &yyappname) == FAILURE) { RETURN_FALSE; } - convert_to_string(yyhost); - convert_to_string(yyuser); - convert_to_string(yypasswd); - convert_to_string(yycharset); - convert_to_string(yyappname); - host = Z_STRVAL_P(yyhost); - user = Z_STRVAL_P(yyuser); - passwd = Z_STRVAL_P(yypasswd); - charset = Z_STRVAL_P(yycharset); - appname = Z_STRVAL_P(yyappname); - hashed_details_length = Z_STRLEN_P(yyhost)+Z_STRLEN_P(yyuser)+Z_STRLEN_P(yypasswd)+Z_STRLEN_P(yycharset)+Z_STRLEN_P(yyappname)+6+5; + convert_to_string_ex(yyhost); + convert_to_string_ex(yyuser); + convert_to_string_ex(yypasswd); + convert_to_string_ex(yycharset); + convert_to_string_ex(yyappname); + host = Z_STRVAL_PP(yyhost); + user = Z_STRVAL_PP(yyuser); + passwd = Z_STRVAL_PP(yypasswd); + charset = Z_STRVAL_PP(yycharset); + appname = Z_STRVAL_PP(yyappname); + hashed_details_length = Z_STRLEN_PP(yyhost)+Z_STRLEN_PP(yyuser)+Z_STRLEN_PP(yypasswd)+Z_STRLEN_PP(yycharset)+Z_STRLEN_PP(yyappname)+6+5; hashed_details = (char *) emalloc(hashed_details_length+1); - sprintf(hashed_details, "sybase_%s_%s_%s_%s_%s", Z_STRVAL_P(yyhost), Z_STRVAL_P(yyuser), Z_STRVAL_P(yypasswd), Z_STRVAL_P(yycharset), Z_STRVAL_P(yyappname)); + sprintf(hashed_details, "sybase_%s_%s_%s_%s_%s", Z_STRVAL_PP(yyhost), Z_STRVAL_PP(yyuser), Z_STRVAL_PP(yypasswd), Z_STRVAL_PP(yycharset), Z_STRVAL_PP(yyappname)); } break; default: @@ -779,7 +779,7 @@ PHP_FUNCTION(sybase_pconnect) Close Sybase connection */ PHP_FUNCTION(sybase_close) { - zval *sybase_link_index = 0; + zval **sybase_link_index = 0; int id; sybase_link *sybase_ptr; @@ -788,7 +788,7 @@ PHP_FUNCTION(sybase_close) id = SybCtG(default_link); break; case 1: - if (getParameters(ht, 1, &sybase_link_index)==FAILURE) { + if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { RETURN_FALSE; } id = -1; @@ -800,12 +800,11 @@ PHP_FUNCTION(sybase_close) ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le_plink); - if (id==-1) { /* explicit resource number */ + if (id == -1) { /* explicit resource number */ zend_list_delete(Z_RESVAL_P(sybase_link_index)); } - if (id!=-1 - || (sybase_link_index && Z_RESVAL_P(sybase_link_index)==SybCtG(default_link))) { + if (id != -1 || (sybase_link_index && Z_RESVAL_PP(sybase_link_index)==SybCtG(default_link))) { zend_list_delete(SybCtG(default_link)); SybCtG(default_link) = -1; } @@ -895,21 +894,21 @@ static int exec_cmd(sybase_link *sybase_ptr, char *cmdbuf) Select Sybase database */ PHP_FUNCTION(sybase_select_db) { - zval *db, *sybase_link_index; + zval **db, **sybase_link_index; int id; char *cmdbuf; sybase_link *sybase_ptr; switch(ZEND_NUM_ARGS()) { case 1: - if (getParameters(ht, 1, &db)==FAILURE) { + if (zend_get_parameters_ex(1, &db) == FAILURE) { RETURN_FALSE; } id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); CHECK_LINK(id); break; case 2: - if (getParameters(ht, 2, &db, &sybase_link_index)==FAILURE) { + if (zend_get_parameters_ex(2, &db, &sybase_link_index) == FAILURE) { RETURN_FALSE; } id = -1; @@ -919,11 +918,11 @@ PHP_FUNCTION(sybase_select_db) break; } - ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, &sybase_link_index, id, "Sybase-Link", le_link, le_plink); + ZEND_FETCH_RESOURCE2(sybase_ptr, sybase_link *, sybase_link_index, id, "Sybase-Link", le_link, le_plink); - convert_to_string(db); - cmdbuf = (char *) emalloc(sizeof("use ")+Z_STRLEN_P(db)+1); - sprintf(cmdbuf, "use %s", Z_STRVAL_P(db)); /* SAFE */ + convert_to_string_ex(db); + cmdbuf = (char *) emalloc(sizeof("use ")+Z_STRLEN_PP(db)+1); + sprintf(cmdbuf, "use %s", Z_STRVAL_PP(db)); /* SAFE */ if (exec_cmd(sybase_ptr, cmdbuf)==FAILURE) { efree(cmdbuf); @@ -1489,19 +1488,18 @@ PHP_FUNCTION(sybase_unbuffered_query) Free result memory */ PHP_FUNCTION(sybase_free_result) { - zval *sybase_result_index; + zval **sybase_result_index; sybase_result *result; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - if (Z_TYPE_P(sybase_result_index)==IS_RESOURCE - && Z_LVAL_P(sybase_result_index)==0) { + if (Z_TYPE_PP(sybase_result_index) == IS_RESOURCE && Z_LVAL_PP(sybase_result_index) == 0) { RETURN_FALSE; } - ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); + ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); /* Did we fetch up until the end? */ if (result->last_retcode != CS_END_DATA) { @@ -1510,7 +1508,7 @@ PHP_FUNCTION(sybase_free_result) php_sybase_finish_results(result); } - zend_list_delete(Z_LVAL_P(sybase_result_index)); + zend_list_delete(Z_LVAL_PP(sybase_result_index)); RETURN_TRUE; } @@ -1528,14 +1526,14 @@ PHP_FUNCTION(sybase_get_last_message) Get number of rows in result */ PHP_FUNCTION(sybase_num_rows) { - zval *sybase_result_index; + zval **sybase_result_index; sybase_result *result; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); + ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); Z_LVAL_P(return_value) = result->num_rows; Z_TYPE_P(return_value) = IS_LONG; @@ -1547,14 +1545,14 @@ PHP_FUNCTION(sybase_num_rows) Get number of fields in result */ PHP_FUNCTION(sybase_num_fields) { - zval *sybase_result_index; + zval **sybase_result_index; sybase_result *result; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); + ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); Z_LVAL_P(return_value) = result->num_fields; Z_TYPE_P(return_value) = IS_LONG; @@ -1566,16 +1564,16 @@ PHP_FUNCTION(sybase_num_fields) Get row as enumerated array */ PHP_FUNCTION(sybase_fetch_row) { - zval *sybase_result_index; + zval **sybase_result_index; int i; sybase_result *result; zval *field_content; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); + ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); /* Unbuffered? */ if (result->last_retcode != CS_END_DATA) { @@ -1602,17 +1600,17 @@ PHP_FUNCTION(sybase_fetch_row) static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics) { - zval *sybase_result_index; + zval **sybase_result_index; sybase_result *result; int i, j; zval *tmp; char name[32]; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { WRONG_PARAM_COUNT; } - ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); + ZEND_FETCH_RESOURCE(result, sybase_result *, sybase_result_index, -1, "Sybase result", le_result); /* Unbuffered ? Fetch next row */ if (result->last_retcode != CS_END_DATA) { @@ -1624,9 +1622,7 @@ static void php_sybase_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int numerics) RETURN_FALSE; } - if (array_init(return_value)==FAILURE) { - RETURN_FALSE; - } + array_init(return_value); j= 1; for (i=0; i<result->num_fields; i++) { @@ -1717,29 +1713,29 @@ PHP_FUNCTION(sybase_fetch_assoc) Move internal row pointer */ PHP_FUNCTION(sybase_data_seek) { - zval *sybase_result_index, *offset; + zval **sybase_result_index, **offset; sybase_result *result; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &sybase_result_index, &offset)==FAILURE) { + if (ZEND_NUM_ARGS()!=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset)==FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); - convert_to_long(offset); + convert_to_long_ex(offset); /* Unbuffered ? */ - if (result->last_retcode != CS_END_DATA && Z_LVAL_P(offset)>=result->num_rows) { - php_sybase_fetch_result_row(result, Z_LVAL_P(offset)); + if (result->last_retcode != CS_END_DATA && Z_LVAL_PP(offset)>=result->num_rows) { + php_sybase_fetch_result_row(result, Z_LVAL_PP(offset)); } - if (Z_LVAL_P(offset)<0 || Z_LVAL_P(offset)>=result->num_rows) { + if (Z_LVAL_PP(offset)<0 || Z_LVAL_PP(offset)>=result->num_rows) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset"); RETURN_FALSE; } - result->cur_row = Z_LVAL_P(offset); + result->cur_row = Z_LVAL_PP(offset); RETURN_TRUE; } /* }}} */ @@ -1798,17 +1794,17 @@ PHP_FUNCTION(sybase_fetch_field) switch (ZEND_NUM_ARGS()) { case 1: - if (getParameters(ht, 1, &sybase_result_index)==FAILURE) { + if (zend_get_parameters_ex(1, &sybase_result_index) == FAILURE) { RETURN_FALSE; } field_offset=-1; break; case 2: - if (getParameters(ht, 2, &sybase_result_index, &offset)==FAILURE) { + if (zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { RETURN_FALSE; } - convert_to_long(offset); - field_offset = Z_LVAL_P(offset); + convert_to_long_ex(offset); + field_offset = Z_LVAL_PP(offset); break; default: WRONG_PARAM_COUNT; @@ -1845,18 +1841,18 @@ PHP_FUNCTION(sybase_fetch_field) Set field offset */ PHP_FUNCTION(sybase_field_seek) { - zval *sybase_result_index, *offset; + zval **sybase_result_index, **offset; int field_offset; sybase_result *result; - if (ZEND_NUM_ARGS()!=2 || getParameters(ht, 2, &sybase_result_index, &offset)==FAILURE) { + if (ZEND_NUM_ARGS() !=2 || zend_get_parameters_ex(2, &sybase_result_index, &offset) == FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); - convert_to_long(offset); - field_offset = Z_LVAL_P(offset); + convert_to_long_ex(offset); + field_offset = Z_LVAL_PP(offset); /* Unbuffered ? */ if (result->last_retcode != CS_END_DATA && field_offset>=result->num_rows) { @@ -1878,48 +1874,48 @@ PHP_FUNCTION(sybase_field_seek) Get result data */ PHP_FUNCTION(sybase_result) { - zval *row, *field, *sybase_result_index; + zval **row, **field, **sybase_result_index; int field_offset=0; sybase_result *result; - if (ZEND_NUM_ARGS()!=3 || getParameters(ht, 3, &sybase_result_index, &row, &field)==FAILURE) { + if (ZEND_NUM_ARGS() !=3 || zend_get_parameters_ex(3, &sybase_result_index, &row, &field)==FAILURE) { WRONG_PARAM_COUNT; } ZEND_FETCH_RESOURCE(result, sybase_result *, &sybase_result_index, -1, "Sybase result", le_result); - convert_to_long(row); + convert_to_long_ex(row); /* Unbuffered ? */ - if (result->last_retcode != CS_END_DATA && Z_LVAL_P(row)>=result->num_rows) { - php_sybase_fetch_result_row(result, Z_LVAL_P(row)); + if (result->last_retcode != CS_END_DATA && Z_LVAL_PP(row) >= result->num_rows) { + php_sybase_fetch_result_row(result, Z_LVAL_PP(row)); } - if (Z_LVAL_P(row)<0 || Z_LVAL_P(row)>=result->num_rows) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset (%d)", Z_LVAL_P(row)); + if (Z_LVAL_PP(row) < 0 || Z_LVAL_PP(row) >= result->num_rows) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: Bad row offset (%d)", Z_LVAL_PP(row)); RETURN_FALSE; } - switch(Z_TYPE_P(field)) { + switch(Z_TYPE_PP(field)) { case IS_STRING: { int i; for (i=0; i<result->num_fields; i++) { - if (!strcasecmp(result->fields[i].name, Z_STRVAL_P(field))) { + if (!strcasecmp(result->fields[i].name, Z_STRVAL_PP(field))) { field_offset = i; break; } } if (i>=result->num_fields) { /* no match found */ - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_P(field)); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Sybase: %s field not found in result", Z_STRVAL_PP(field)); RETURN_FALSE; } break; } default: - convert_to_long(field); - field_offset = Z_LVAL_P(field); + 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, "Sybase: Bad column offset specified"); RETURN_FALSE; @@ -1927,7 +1923,7 @@ PHP_FUNCTION(sybase_result) break; } - *return_value = result->data[Z_LVAL_P(row)][field_offset]; + *return_value = result->data[Z_LVAL_PP(row)][field_offset]; zval_copy_ctor(return_value); } /* }}} */ @@ -1937,7 +1933,7 @@ PHP_FUNCTION(sybase_result) Get number of affected rows in last query */ PHP_FUNCTION(sybase_affected_rows) { - zval *sybase_link_index; + zval **sybase_link_index; sybase_link *sybase_ptr; int id; @@ -1946,7 +1942,7 @@ PHP_FUNCTION(sybase_affected_rows) id = php_sybase_get_default_link(INTERNAL_FUNCTION_PARAM_PASSTHRU); break; case 1: - if (getParameters(ht, 1, &sybase_link_index)==FAILURE) { + if (zend_get_parameters_ex(1, &sybase_link_index) == FAILURE) { RETURN_FALSE; } id = -1; @@ -1991,13 +1987,13 @@ PHP_MINFO_FUNCTION(sybase) Sets minimum client severity */ PHP_FUNCTION(sybase_min_client_severity) { - zval *severity; + zval **severity; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &severity)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(severity); - SybCtG(min_client_severity) = Z_LVAL_P(severity); + convert_to_long_ex(severity); + SybCtG(min_client_severity) = Z_LVAL_PP(severity); } /* }}} */ @@ -2006,13 +2002,13 @@ PHP_FUNCTION(sybase_min_client_severity) Sets minimum server severity */ PHP_FUNCTION(sybase_min_server_severity) { - zval *severity; + zval **severity; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &severity)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &severity) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(severity); - SybCtG(min_server_severity) = Z_LVAL_P(severity); + convert_to_long_ex(severity); + SybCtG(min_server_severity) = Z_LVAL_PP(severity); } /* }}} */ @@ -2020,13 +2016,13 @@ PHP_FUNCTION(sybase_min_server_severity) Sets deadlock retry count */ PHP_FUNCTION(sybase_deadlock_retry_count) { - zval *retry_count; + zval **retry_count; - if (ZEND_NUM_ARGS()!=1 || getParameters(ht, 1, &retry_count)==FAILURE) { + if (ZEND_NUM_ARGS() !=1 || zend_get_parameters_ex(1, &retry_count) == FAILURE) { WRONG_PARAM_COUNT; } - convert_to_long(retry_count); - SybCtG(deadlock_retry_count) = Z_LVAL_P(retry_count); + convert_to_long_ex(retry_count); + SybCtG(deadlock_retry_count) = Z_LVAL_PP(retry_count); } /* }}} */ |