close informix connection */
PHP_FUNCTION(ifx_close)
{
- pval *ifx_link;
+ pval **ifx_link = NULL;
int id;
EXEC SQL BEGIN DECLARE SECTION;
id = IFXG(default_link);
break;
case 1:
- if (getParameters(ht, 1, &ifx_link)==FAILURE) {
+ if (getParametersEx(1, &ifx_link)==FAILURE) {
RETURN_FALSE;
}
break;
perform a query on a given connection */
PHP_FUNCTION(ifx_query)
{
- pval *query,*ifx_link, *cursortype, *dummy;
+ pval **query,**ifx_link, **cursortype, **dummy;
int id;
IFX_RES *Ifx_Result;
php4 insists on the correct number of arguments */
switch(ARG_COUNT(ht)) {
case 2:
- if (getParameters(ht, 2, &query, &ifx_link)==FAILURE)
+ if (getParametersEx(2, &query, &ifx_link)==FAILURE)
RETURN_FALSE;
break;
case 3:
- if (getParameters(ht, 3, &query, &ifx_link, &dummy)==FAILURE)
+ if (getParametersEx(3, &query, &ifx_link, &dummy)==FAILURE)
RETURN_FALSE;
break;
case 4:
- if (getParameters(ht, 4, &query, &ifx_link, &dummy, &dummy)==FAILURE)
+ if (getParametersEx(4, &query, &ifx_link, &dummy, &dummy)==FAILURE)
RETURN_FALSE;
break;
}
affected_rows = -1; /* invalid */
- convert_to_string(query);
+ convert_to_string_ex(query);
- statement = query->value.str.val;
+ statement = (*query)->value.str.val;
IFXG(cursorid)++;
sprintf(statemid, "statem%x", IFXG(cursorid));
sprintf(cursorid, "cursor%x", IFXG(cursorid));
## NONSELECT-STATEMENT
##
*/
- pval *pblobidarr, **tmp;
+ pval **pblobidarr, **tmp;
Ifx_Result->iscursory = 0;
}
if(ARG_COUNT(ht)==3) {
- if (getParameters(ht, 3, &dummy, &dummy, &pblobidarr) == FAILURE) {
+ if (getParametersEx(3, &dummy, &dummy, &pblobidarr) == FAILURE) {
php_error(E_WARNING,"Can't get blob array param");
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
RETURN_FALSE;
}
- if (pblobidarr->type != IS_ARRAY) {
+ if ((*pblobidarr)->type != IS_ARRAY) {
php_error(E_WARNING,"blob-parameter not an array");
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
RETURN_FALSE;
}
- zend_hash_internal_pointer_reset(pblobidarr->value.ht);
+ zend_hash_internal_pointer_reset((*pblobidarr)->value.ht);
i=1;
- while (zend_hash_get_current_data(pblobidarr->value.ht,
+ while (zend_hash_get_current_data((*pblobidarr)->value.ht,
(void **) &tmp) == SUCCESS) {
convert_to_long(*tmp);
if ((query_type == SQ_UPDATE) || (query_type == SQ_UPDALL)) {
i++;
- zend_hash_move_forward(pblobidarr->value.ht);
+ zend_hash_move_forward((*pblobidarr)->value.ht);
}
Ifx_Result->paramquery=1;
EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :descrpid;
case 2:
break;
case 3:
- if (getParameters(ht, 3,
+ if (getParametersEx(3,
&dummy,
&dummy,
&cursortype)==FAILURE) {
RETURN_FALSE;
}
- convert_to_long(cursortype);
- ctype = cursortype->value.lval;
+ convert_to_long_ex(cursortype);
+ ctype = (*cursortype)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
PHP_FUNCTION(ifx_prepare)
{
- pval *query,*ifx_link, *cursortype, *dummy;
+ pval **query,**ifx_link, **cursortype, **dummy;
int id;
IFX_RES *Ifx_Result;
php4 insists on the correct number of arguments */
switch(ARG_COUNT(ht)) {
case 2:
- if (getParameters(ht, 2, &query, &ifx_link)==FAILURE)
+ if (getParametersEx(2, &query, &ifx_link)==FAILURE)
RETURN_FALSE;
break;
case 3:
- if (getParameters(ht, 3, &query, &ifx_link, &dummy)==FAILURE)
+ if (getParametersEx(3, &query, &ifx_link, &dummy)==FAILURE)
RETURN_FALSE;
break;
case 4:
- if (getParameters(ht, 4, &query, &ifx_link, &dummy, &dummy)==FAILURE)
+ if (getParametersEx(4, &query, &ifx_link, &dummy, &dummy)==FAILURE)
RETURN_FALSE;
break;
}
affected_rows = -1; /* invalid */
- convert_to_string(query);
+ convert_to_string_ex(query);
- statement = query->value.str.val;
+ statement = (*query)->value.str.val;
IFXG(cursorid)++;
sprintf(statemid, "statem%x", IFXG(cursorid));
sprintf(cursorid, "cursor%x", IFXG(cursorid));
## NONSELECT-STATEMENT
##
*/
- pval *pblobidarr, **tmp;
+ pval **pblobidarr, **tmp;
Ifx_Result->iscursory = 0;
}
if(ARG_COUNT(ht)==3) {
Ifx_Result->paramquery=1;
- if (getParameters(ht, 3, &dummy, &dummy,&pblobidarr) == FAILURE) {
+ if (getParametersEx(3, &dummy, &dummy,&pblobidarr) == FAILURE) {
php_error(E_WARNING,"Can't get blob array param");
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
RETURN_FALSE;
}
- if(pblobidarr->type != IS_ARRAY) {
+ if((*pblobidarr)->type != IS_ARRAY) {
php_error(E_WARNING,"blob-parameter not an array");
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
EXEC SQL free :statemid;
efree(Ifx_Result);
RETURN_FALSE;
}
- zend_hash_internal_pointer_reset(pblobidarr->value.ht);
+ zend_hash_internal_pointer_reset((*pblobidarr)->value.ht);
i=1;
- while (zend_hash_get_current_data(pblobidarr->value.ht,
+ while (zend_hash_get_current_data((*pblobidarr)->value.ht,
(void **) &tmp) == SUCCESS) {
convert_to_long(*tmp);
if ((query_type == SQ_UPDATE) || (query_type == SQ_UPDALL)) {
}
i++;
- zend_hash_move_forward(pblobidarr->value.ht);
+ zend_hash_move_forward((*pblobidarr)->value.ht);
} /* while */
} /* if paramquery */
Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */
case 2:
break;
case 3:
- if (getParameters(ht, 3,
- &dummy,
- &dummy,
- &cursortype)==FAILURE) {
+ if (getParametersEx(3, &dummy, &dummy, &cursortype)==FAILURE) {
RETURN_FALSE;
}
- convert_to_long(cursortype);
- ctype = cursortype->value.lval;
+ convert_to_long_ex(cursortype);
+ ctype = (*cursortype)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
executes a previously prepared query or opens a cursor for it */
PHP_FUNCTION(ifx_do)
{
- pval *result;
+ pval **result;
IFX_RES *Ifx_Result;
EXEC SQL BEGIN DECLARE SECTION;
WRONG_PARAM_COUNT;
break;
case 1:
- if (getParameters(ht, 1, &result)==FAILURE) {
+ if (getParametersEx(1, &result)==FAILURE) {
RETURN_FALSE;
}
break;
if (Ifx_Result->iscursory < 0) {
php_error(E_WARNING, "Resultindex %d is not a prepared query",
- result->value.lval);
+ (*result)->value.lval);
RETURN_FALSE;
}
if (Ifx_Result->iscursory==0) { /* execute immediate */
returns the Informix error codes (SQLSTATE & SQLCODE) */
PHP_FUNCTION(ifx_error)
{
- pval *ifx_link;
+ pval **ifx_link;
int id;
IFXLS_FETCH();
id = IFXG(default_link);
break;
case 1:
- if (getParameters(ht, 1, &ifx_link)==FAILURE) {
+ if (getParametersEx(1, &ifx_link)==FAILURE) {
RETURN_FALSE;
}
break;
returns the Informix errormessage associated with */
PHP_FUNCTION(ifx_errormsg)
{
- pval *errcode;
+ pval **errcode;
int ifx_errorcode;
int msglen, maxmsglen;
ifx_errorcode = IFXG(sv_sqlcode);
break;
case 1:
- if (getParameters(ht, 1, &errcode)==FAILURE) {
+ if (getParametersEx(1, &errcode)==FAILURE) {
RETURN_FALSE;
}
- convert_to_long(errcode);
- ifx_errorcode = errcode->value.lval;
+ convert_to_long_ex(errcode);
+ ifx_errorcode = (*errcode)->value.lval;
break;
default:
WRONG_PARAM_COUNT;
returns the number of rows affected by query identified by resultid */
PHP_FUNCTION(ifx_affected_rows)
{
- pval *result;
+ pval **result;
IFX_RES *Ifx_Result;
IFXLS_FETCH();
WRONG_PARAM_COUNT;
break;
case 1:
- if (getParameters(ht, 1, &result)==FAILURE) {
+ if (getParametersEx(1, &result)==FAILURE) {
RETURN_FALSE;
}
break;
fetches the next row or <position> row if using a scroll cursor */
PHP_FUNCTION(ifx_fetch_row)
{
- pval *result, *position;
+ pval **result, **position;
IFX_RES *Ifx_Result;
EXEC SQL BEGIN DECLARE SECTION;
WRONG_PARAM_COUNT;
break;
case 1:
- if (getParameters(ht, 1, &result)==FAILURE) {
+ if (getParametersEx(1, &result)==FAILURE) {
RETURN_FALSE;
}
fetch_pos = NULL;
fetch_row = 0;
break;
case 2:
- if (getParameters(ht, 2, &result, &position)==FAILURE) {
+ if (getParametersEx(2, &result, &position)==FAILURE) {
RETURN_FALSE;
}
- if (position->type != IS_STRING) {
+ if ((*position)->type != IS_STRING) {
fetch_pos = NULL;
- fetch_row = position->value.lval;
+ fetch_row = (*position)->value.lval;
} else {
- fetch_pos = position->value.str.val;
+ fetch_pos = (*position)->value.str.val;
fetch_row = 0;
}
break;
formats all rows of the $resultid query into a html table */
PHP_FUNCTION(ifx_htmltbl_result)
{
- pval *result, *arg2;
+ pval **result, **arg2;
IFX_RES *Ifx_Result;
EXEC SQL BEGIN DECLARE SECTION;
switch (ARG_COUNT(ht)) {
case 1:
- if (getParameters(ht, 1, &result)==FAILURE) {
+ if (getParametersEx(1, &result)==FAILURE) {
RETURN_FALSE;
}
table_options = NULL;
break;
case 2:
- if (getParameters(ht, 2, &result, &arg2)==FAILURE) {
+ if (getParametersEx(2, &result, &arg2)==FAILURE) {
RETURN_FALSE;
}
- table_options = arg2->value.str.val;
+ table_options = (*arg2)->value.str.val;
break;
default:
WRONG_PARAM_COUNT;
returns an associative array with fieldnames as key for query <resultid> */
PHP_FUNCTION(ifx_fieldtypes)
{
- pval *result, *arg2;
+ pval **result;
IFX_RES *Ifx_Result;
EXEC SQL BEGIN DECLARE SECTION;
int num_fields;
char *p;
- char *table_options;
IFXLS_FETCH();
switch (ARG_COUNT(ht)) {
case 1:
- if (getParameters(ht, 1, &result)==FAILURE) {
+ if (getParametersEx(1, &result)==FAILURE) {
RETURN_FALSE;
}
- table_options = NULL;
- break;
- case 2:
- if (getParameters(ht, 2, &result, &arg2)==FAILURE) {
- RETURN_FALSE;
- }
- table_options = arg2->value.str.val;
break;
default:
WRONG_PARAM_COUNT;
returns an associative for query <resultid> array with fieldnames as key */
PHP_FUNCTION(ifx_fieldproperties)
{
- pval *result, *arg2;
+ pval **result;
IFX_RES *Ifx_Result;
EXEC SQL BEGIN DECLARE SECTION;
char string_data[256];
char *p;
- char *table_options;
IFXLS_FETCH();
switch (ARG_COUNT(ht)) {
case 1:
- if (getParameters(ht, 1, &result)==FAILURE) {
- RETURN_FALSE;
- }
- table_options = NULL;
- break;
- case 2:
- if (getParameters(ht, 2, &result, &arg2)==FAILURE) {
+ if (getParametersEx(1, &result)==FAILURE) {
RETURN_FALSE;
}
- table_options = arg2->value.str.val;
break;
default:
WRONG_PARAM_COUNT;
returns the number of rows already fetched for query identified by resultid */
PHP_FUNCTION(ifx_num_rows)
{
- pval *result;
+ pval **result;
IFX_RES *Ifx_Result;
IFXLS_FETCH();
- if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &result)==FAILURE) {
+ if (ARG_COUNT(ht)!=1 || getParametersEx(1, &result)==FAILURE) {
WRONG_PARAM_COUNT;
}
returns the sqlerrd[] fields of the sqlca struct for query $resultid */
PHP_FUNCTION(ifx_getsqlca)
{
- pval *result;
+ pval **result;
IFX_RES *Ifx_Result;
char fieldname[16];
IFXLS_FETCH();
- if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &result)==FAILURE) {
+ if (ARG_COUNT(ht)!=1 || getParametersEx(1, &result)==FAILURE) {
WRONG_PARAM_COUNT;
}
returns the number of columns in query resultid */
PHP_FUNCTION(ifx_num_fields)
{
- pval *result;
+ pval **result;
IFX_RES *Ifx_Result;
IFXLS_FETCH();
- if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &result)==FAILURE) {
+ if (ARG_COUNT(ht)!=1 || getParametersEx(1, &result)==FAILURE) {
WRONG_PARAM_COUNT;
}
releases resources for query associated with resultid */
PHP_FUNCTION(ifx_free_result)
{
- pval *result;
+ pval **result;
IFX_RES *Ifx_Result;
EXEC SQL BEGIN DECLARE SECTION;
IFXLS_FETCH();
- if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &result)==FAILURE) {
+ if (ARG_COUNT(ht)!=1 || getParametersEx(1, &result)==FAILURE) {
WRONG_PARAM_COUNT;
}
efree(Ifx_Result); /* this can be safely done now */
- zend_list_delete(result->value.lval);
+ zend_list_delete((*result)->value.lval);
RETURN_TRUE;
}
/* }}} */