CVS update: php3/functions
| From: | nyenyon | Date: | Fri, 11 Sep 1998 11:10:49 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-965@lists.php.net to get a copy of this message | ||
Date: Friday September 11, 1998 @ 7:10
Author: nyenyon
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv7616
Modified Files:
ifx.ec php3_ifx.h
Log Message:
- ifx_query and ifx_prepare: blob-paramters now as array
- new funtions: ifx_textasvarchar, ifx_byteasvarchar, ifx_nullformat
- new php.ini-variables: ifx.textasvarchar, ifx.byteasvarchar, ifx.nullformat
- update all functions to support blobarray and new funktions (ifx_query, ifx_prepare, ifx_do,
ifx_htmltbl_result, ifx_fetch_row)
- minor bug-fixes
- Test-Page (informix_blob.php3) updated
- begin with coding of slob-support(still deactivated, not yet complete: #undef HAVE_IFX_IUS in
php3_ifx.h)
- ifx_fetch_row returns always a blob-id (contains "NULL"-flag or content from db)(except
ifx_textasvarchar, ifx_byteasvarchar set to 1)
Index: php3/functions/ifx.ec
diff -c php3/functions/ifx.ec:1.14 php3/functions/ifx.ec:1.15
*** php3/functions/ifx.ec:1.14 Wed Aug 26 05:26:29 1998
--- php3/functions/ifx.ec Fri Sep 11 07:10:48 1998
***************
*** 70,75 ****
--- 70,85 ----
- minor bug-fixes
- Test-Page (informix_blob.php3) which tests the blob-support
+
+ Changes: 11.9.1998 (chc@idgruppe.de)
+ - ifx_query and ifx_prepare: blob-paramters now as array
+ - new funtions: ifx_textasvarchar, ifx_byteasvarchar, ifx_nullformat
+ - new php.ini-variables: ifx.textasvarchar, ifx.byteasvarchar, ifx.nullformat
+ - update all functions to support blobarray and new funktions (ifx_query, ifx_prepare, ifx_do,
ifx_htmltbl_result, ifx_fetch_row)
+ - minor bug-fixes
+ - Test-Page (informix_blob.php3) updated
+ - begin with coding of slob-support(still deactivated, not yet complete: #undef HAVE_IFX_IUS in
php3_ifx.h)
+ - ifx_fetch_row returns always a blob-id (contains "NULL"-flag or content from
db)(except ifx_textasvarchar, ifx_byteasvarchar set to 1)
*/
***************
*** 138,145 ****
{"ifx_free_blob", php3_ifx_free_blob, NULL},
{"ifx_get_blob", php3_ifx_get_blob, NULL},
{"ifx_update_blob", php3_ifx_update_blob, NULL},
- {"ifx_blobinfile_mode",php3_ifx_blobinfile_mode, NULL},
{"ifx_copy_blob" ,php3_ifx_copy_blob, NULL},
{NULL, NULL, NULL}
};
--- 148,170 ----
{"ifx_free_blob", php3_ifx_free_blob, NULL},
{"ifx_get_blob", php3_ifx_get_blob, NULL},
{"ifx_update_blob", php3_ifx_update_blob, NULL},
{"ifx_copy_blob" ,php3_ifx_copy_blob, NULL},
+ {"ifx_textasvarchar" ,php3_ifx_textasvarchar, NULL},
+ {"ifx_byteasvarchar" ,php3_ifx_byteasvarchar, NULL},
+ {"ifx_nullformat" ,php3_ifx_nullformat, NULL},
+ {"ifx_blobinfile_mode",php3_ifx_blobinfile_mode, NULL},
+
+ #if HAVE_IFX_IUS
+ {"ifxus_create_slob", php3_ifxus_create_slob, NULL},
+ {"ifxus_close_slob", php3_ifxus_close_slob, NULL},
+ {"ifxus_open_slob", php3_ifxus_open_slob, NULL},
+ {"ifxus_free_slob", php3_ifxus_free_slob, NULL},
+ {"ifxus_read_slob", php3_ifxus_read_slob, NULL},
+ {"ifxus_write_slob", php3_ifxus_write_slob, NULL},
+ {"ifxus_seek_slob", php3_ifxus_seek_slob, NULL},
+ {"ifxus_tell_slob", php3_ifxus_tell_slob, NULL},
+
+ #endif
{NULL, NULL, NULL}
};
***************
*** 325,330 ****
--- 350,371 ----
Informix_GLOBAL(php3_ifx_module).blobinfile=BLOBINFILE;
}
+ if (cfg_get_long("ifx.textasvarchar",
+ &Informix_GLOBAL(php3_ifx_module).textasvarchar)==FAILURE) {
+ Informix_GLOBAL(php3_ifx_module).textasvarchar=0;
+ }
+
+
+ if (cfg_get_long("ifx.byteasvarchar",
+ &Informix_GLOBAL(php3_ifx_module).byteasvarchar)==FAILURE) {
+ Informix_GLOBAL(php3_ifx_module).byteasvarchar=0;
+ }
+
+ if (cfg_get_long("ifx.nullformat",
+ &Informix_GLOBAL(php3_ifx_module).nullformat)==FAILURE) {
+ Informix_GLOBAL(php3_ifx_module).nullformat=0;
+ }
+
if (cfg_get_long("ifx.allow_persistent",
&Informix_GLOBAL(php3_ifx_module).allow_persistent)==FAILURE) {
Informix_GLOBAL(php3_ifx_module).allow_persistent=1;
***************
*** 357,362 ****
--- 398,405 ----
register_list_destructors(ifx_free_result,NULL);
Informix_GLOBAL(php3_ifx_module).le_blobresult =
register_list_destructors(ifx_free_result,NULL);
+ Informix_GLOBAL(php3_ifx_module).le_slobresult =
+ register_list_destructors(ifx_free_result,NULL);
Informix_GLOBAL(php3_ifx_module).le_link =
register_list_destructors(_close_ifx_link,NULL);
Informix_GLOBAL(php3_ifx_module).le_plink =
***************
*** 783,796 ****
}
/* ----------------------------------------------------------------------
! ** int ifx_query(string $query, int $connid, [string $hold, [string $scroll]],[blobid,..])
**
** executes query $query on connection $connid
** for select queries a cursor is declared and opened
** non-select queries are "execute immediate"
** select queries accept 2 optional params : "SCROLL" and/or "HOLD"
! ** blobsupport: mark the blob-column with ? and add a blob-id-functionparameter
! ** example: ifx_query'insert into catalog (stock_num, manu_code,cat_descr,cat_picture)
values(1,"HRO",?,?)',$cid,$bid1,$bid2);
**
** returns a "result id" on success or FALSE on error
** also sets "affected_rows for retrieval by ifx_affected_rows
--- 826,839 ----
}
/* ----------------------------------------------------------------------
! ** int ifx_query(string $query, int $connid, [string $hold, [string $scroll]],[blobidarray])
**
** executes query $query on connection $connid
** for select queries a cursor is declared and opened
** non-select queries are "execute immediate"
** select queries accept 2 optional params : "SCROLL" and/or "HOLD"
! ** blobsupport: mark the blob-column with ? and add a blob-id-array-functionparameter
! ** example: ifx_query'insert into catalog (stock_num, manu_code,cat_descr,cat_picture)
values(1,"HRO",?,?)',$cid,$bidarray);
**
** returns a "result id" on success or FALSE on error
** also sets "affected_rows for retrieval by ifx_affected_rows
***************
*** 799,807 ****
void php3_ifx_query(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *pblobid[10];
!
! pval *query,*ifx_link, *cursortype1, *cursortype2;
int id,type;
IFX_RES *Ifx_Result;
--- 842,848 ----
void php3_ifx_query(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *query,*ifx_link, *cursortype1, *cursortype2, *dummy;
int id,type;
IFX_RES *Ifx_Result;
***************
*** 907,912 ****
--- 948,958 ----
strcpy(Ifx_Result->descrpid, descrpid);
for (i = 0; i < MAXBLOBS; ++i)
Ifx_Result->blob_id[i] = -1;
+ #if HAVE_IFX_IUS
+ for (i = 0; i < MAXSLOBS; ++i)
+ Ifx_Result->slob_id[i] = -1;
+ #endif
+
Ifx_Result->iscursory = -1; /* prevent ifx_do */
Ifx_Result->paramquery=0;
***************
*** 915,938 ****
## NONSELECT-STATEMENT
##
*/
strcpy(Ifx_Result->cursorid, "");
strcpy(Ifx_Result->descrpid, descrpid);
strcpy(Ifx_Result->statemid, statemid);
! if(ARG_COUNT(ht)>2) {
! for(i=0;i<10;i++)
! pblobid[i]=NULL;
! getParameters(ht, ARG_COUNT(ht),
&pblobid[0],&pblobid[1],&pblobid[2],&pblobid[3],&pblobid[4],&pblobid[5],&pblobid[6],&pblobid[7],&pblobid[8],&pblobid[9]);
!
! for(i=1;i<(ARG_COUNT(ht)-1);i++) {
! convert_to_long(pblobid[i+1]);
! locator=php3_intifx_get_blobloc((int)pblobid[i+1]->value.lval,list);
! if(locator->loc_loctype=LOCFNAME)
! locator->loc_oflags=LOC_RONLY;
! EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator, TYPE=:loc_t_type;
! }
! Ifx_Result->paramquery=1;
EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :descrpid;
} else {
EXEC SQL EXECUTE :statemid;
--- 961,1008 ----
## NONSELECT-STATEMENT
##
*/
+ pval *pblobidarr, *tmp;
+
+ Ifx_Result->iscursory = 0;
strcpy(Ifx_Result->cursorid, "");
strcpy(Ifx_Result->descrpid, descrpid);
strcpy(Ifx_Result->statemid, statemid);
! if(ARG_COUNT(ht)>3) {
! WRONG_PARAM_COUNT;
! }
!
! if(ARG_COUNT(ht)==3) {
! getParameters(ht, ARG_COUNT(ht), &dummy,&dummy,&pblobidarr);
! if(pblobidarr->type != IS_ARRAY) {
! php3_error(E_WARNING,"blob-parameter not an array");
! EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
! EXEC SQL free :statemid;
! efree(Ifx_Result);
! RETURN_FALSE;
! }
!
! _php3_hash_internal_pointer_reset(pblobidarr->value.ht);
! i=1;
! while (_php3_hash_get_current_data(pblobidarr->value.ht, (void **) &tmp) == SUCCESS) {
! convert_to_long(tmp);
! locator=php3_intifx_get_blobloc((int)tmp->value.lval,list);
! if(locator==NULL) {
! php3_error(E_WARNING,"%d is not a Informix blob-result index",
! (int)tmp->value.lval);
! EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
! EXEC SQL free :statemid;
! efree(Ifx_Result);
! RETURN_FALSE;
! }
! if(locator->loc_loctype==LOCFNAME)
! locator->loc_oflags=LOC_RONLY;
! EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator, TYPE=:loc_t_type;
! i++;
! _php3_hash_move_forward(pblobidarr->value.ht);
! }
! Ifx_Result->paramquery=1;
EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :descrpid;
} else {
EXEC SQL EXECUTE :statemid;
***************
*** 960,967 ****
break;
case 3:
if (getParameters(ht, 3,
! &pblobid[0],
! &pblobid[1],
&cursortype1)==FAILURE) {
RETURN_FALSE;
}
--- 1030,1037 ----
break;
case 3:
if (getParameters(ht, 3,
! &dummy,
! &dummy,
&cursortype1)==FAILURE) {
RETURN_FALSE;
}
***************
*** 972,979 ****
break;
case 4:
if (getParameters(ht, 4,
! &pblobid[0],
! &pblobid[1],
&cursortype1,
&cursortype2)==FAILURE) {
RETURN_FALSE;
--- 1042,1049 ----
break;
case 4:
if (getParameters(ht, 4,
! &dummy,
! &dummy,
&cursortype1,
&cursortype2)==FAILURE) {
RETURN_FALSE;
***************
*** 1104,1112 ****
void php3_ifx_prepare(INTERNAL_FUNCTION_PARAMETERS)
{
! pval *pblobid[10];
!
! pval *query,*ifx_link, *cursortype1, *cursortype2;
int id,type;
IFX_RES *Ifx_Result;
--- 1174,1181 ----
void php3_ifx_prepare(INTERNAL_FUNCTION_PARAMETERS)
{
!
! pval *query,*ifx_link, *cursortype1, *cursortype2, *dummy;
int id,type;
IFX_RES *Ifx_Result;
***************
*** 1214,1219 ****
--- 1283,1293 ----
strcpy(Ifx_Result->statemid, statemid);
for (i = 0; i < MAXBLOBS; ++i)
Ifx_Result->blob_id[i] = -1;
+ #if HAVE_IFX_IUS
+ for (i = 0; i < MAXSLOBS; ++i)
+ Ifx_Result->slob_id[i] = -1;
+ #endif
+
Ifx_Result->iscursory = -1; /* prevent ifx_do */
Ifx_Result->paramquery=0;
***************
*** 1222,1246 ****
## NONSELECT-STATEMENT
##
*/
! strcpy(Ifx_Result->cursorid, cursorid);
Ifx_Result->iscursory = 0;
strcpy(Ifx_Result->cursorid, "");
strcpy(Ifx_Result->descrpid, descrpid);
! if(ARG_COUNT(ht)>2) {
! for(i=0;i<10;i++)
! pblobid[i]=NULL;
! getParameters(ht, ARG_COUNT(ht),
&pblobid[0],&pblobid[1],&pblobid[2],&pblobid[3],&pblobid[4],&pblobid[5],&pblobid[6],&pblobid[7],&pblobid[8],&pblobid[9]);
!
! for(i=1;i<(ARG_COUNT(ht)-1);i++) {
! convert_to_long(pblobid[i+1]);
! locator=php3_intifx_get_blobloc((int)pblobid[i+1]->value.lval,list);
! if(locator->loc_loctype=LOCFNAME)
! locator->loc_oflags=LOC_RONLY;
!
! EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator, TYPE=:loc_t_type;
! } /* for */
Ifx_Result->paramquery=1;
} /* if */
} else {
/* ##
--- 1296,1342 ----
## NONSELECT-STATEMENT
##
*/
! pval *pblobidarr, *tmp;
!
Ifx_Result->iscursory = 0;
+
+ strcpy(Ifx_Result->cursorid, cursorid);
strcpy(Ifx_Result->cursorid, "");
strcpy(Ifx_Result->descrpid, descrpid);
!
! if(ARG_COUNT(ht)>3) {
! WRONG_PARAM_COUNT;
! }
! if(ARG_COUNT(ht)==3) {
Ifx_Result->paramquery=1;
+ getParameters(ht, ARG_COUNT(ht), &dummy,&dummy,&pblobidarr);
+ if(pblobidarr->type != IS_ARRAY) {
+ php3_error(E_WARNING,"blob-parameter not an array");
+ EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
+ EXEC SQL free :statemid;
+ efree(Ifx_Result);
+ RETURN_FALSE;
+ }
+ _php3_hash_internal_pointer_reset(pblobidarr->value.ht);
+ i=1;
+ while (_php3_hash_get_current_data(pblobidarr->value.ht, (void **) &tmp) == SUCCESS) {
+ convert_to_long(tmp);
+ locator=php3_intifx_get_blobloc((int)tmp->value.lval,list);
+ if(locator==NULL) {
+ php3_error(E_WARNING,"%d is not a Informix blob-result index",
+ (int)tmp->value.lval);
+ EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
+ EXEC SQL free :statemid;
+ efree(Ifx_Result);
+ RETURN_FALSE;
+ }
+ if(locator->loc_loctype==LOCFNAME)
+ locator->loc_oflags=LOC_RONLY;
+ EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator, TYPE=:loc_t_type;
+ i++;
+ _php3_hash_move_forward(pblobidarr->value.ht);
+ }
} /* if */
} else {
/* ##
***************
*** 1255,1262 ****
break;
case 3:
if (getParameters(ht, 3,
! &pblobid[0],
! &pblobid[1],
&cursortype1)==FAILURE) {
RETURN_FALSE;
}
--- 1351,1358 ----
break;
case 3:
if (getParameters(ht, 3,
! &dummy,
! &dummy,
&cursortype1)==FAILURE) {
RETURN_FALSE;
}
***************
*** 1267,1274 ****
break;
case 4:
if (getParameters(ht, 4,
! &pblobid[0],
! &pblobid[1],
&cursortype1,
&cursortype2)==FAILURE) {
RETURN_FALSE;
--- 1363,1370 ----
break;
case 4:
if (getParameters(ht, 4,
! &dummy,
! &dummy,
&cursortype1,
&cursortype2)==FAILURE) {
RETURN_FALSE;
***************
*** 1796,1804 ****
*p = 0;
if (indicator == -1) { /* NULL */
! if(fieldtype==SQLTEXT || fieldtype==SQLBYTES)
++locind;
! add_assoc_string(return_value, fieldname, "", DUP);
continue;
}
switch (fieldtype) {
--- 1892,1910 ----
*p = 0;
if (indicator == -1) { /* NULL */
! if(fieldtype==SQLTEXT || fieldtype==SQLBYTES) {
! char *nullstr;
!
! nullstr=php3_intifx_null();
! bid_b=Ifx_Result->blob_id[locind];
! bid=php3_intifx_copy_blob(bid_b, list);
! php3_intifx_update_blob(bid,nullstr,strlen(nullstr),list);
! add_assoc_long(return_value,fieldname,bid);
! efree(nullstr);
++locind;
! continue;
! }
! add_assoc_string(return_value, fieldname, php3_intifx_null(), 0);
continue;
}
switch (fieldtype) {
***************
*** 1872,1885 ****
locator_b->loc_bufsize);
RETURN_FALSE;
}
! if(locator_b->loc_indicator==-1) {
! add_assoc_string(return_value, fieldname, "", DUP);
++locind;
break;
}
- bid=php3_intifx_copy_blob(bid_b, list);
-
if(locator_b->loc_loctype==LOCFNAME) {
blobfilename=php3_intifx_create_tmpfile(bid_b);
php3_intifx_update_blob(bid_b,blobfilename,strlen(blobfilename),list);
--- 1978,1997 ----
locator_b->loc_bufsize);
RETURN_FALSE;
}
!
! bid=php3_intifx_copy_blob(bid_b, list);
!
! if(locator_b->loc_indicator==-1) {
! char *nullstr;
!
! nullstr=php3_intifx_null();
! php3_intifx_update_blob(bid,nullstr,strlen(nullstr),list);
! add_assoc_long(return_value,fieldname,bid);
! efree(nullstr);
++locind;
break;
}
if(locator_b->loc_loctype==LOCFNAME) {
blobfilename=php3_intifx_create_tmpfile(bid_b);
php3_intifx_update_blob(bid_b,blobfilename,strlen(blobfilename),list);
***************
*** 1888,1893 ****
--- 2000,2018 ----
}
++locind;
+ if((Informix_GLOBAL(php3_ifx_module).textasvarchar!=0 && fieldtype==SQLTEXT) ||
(Informix_GLOBAL(php3_ifx_module).byteasvarchar!=0 && fieldtype==SQLBYTES)) {
+ char *content;
+ long lg;
+
+ lg=php3_intifx_get_blob(bid, list, &content);
+ if(content==NULL || lg<0) {
+ add_assoc_string(return_value,fieldname,php3_intifx_null(),DUP);
+ } else {
+ add_assoc_stringl(return_value,fieldname,content,lg,DUP);
+ }
+ php3_intifx_free_blob(bid,list);
+ break;
+ }
add_assoc_long(return_value,fieldname,bid);
break;
default :
***************
*** 1946,1951 ****
--- 2071,2082 ----
loc_t *locator_b;
EXEC SQL END DECLARE SECTION;
+
+ char *content;
+ long lg;
+ char *nullstr;
+
+
int type;
int num_fields;
***************
*** 2073,2079 ****
if (indicator == -1) { /* NULL */
if(fieldtype==SQLTEXT || fieldtype==SQLBYTES)
++locind;
! php3_printf("<td>NULL</td>");
continue;
}
switch (fieldtype) {
--- 2204,2210 ----
if (indicator == -1) { /* NULL */
if(fieldtype==SQLTEXT || fieldtype==SQLBYTES)
++locind;
! php3_printf("<td>%s</td>",php3_intifx_null());
continue;
}
switch (fieldtype) {
***************
*** 2137,2147 ****
char_data = NULL;
break;
case SQLTEXT : /* is returned as if a long varchar */
! php3_printf("<td>(TEXT)</td>");
! break;
! case SQLBYTES :
! php3_printf("<td>(BYTE)</td>");
break;
default :
sprintf(string_data,"ESQL/C : %s : unsupported field type[%d]",
fieldname,
--- 2268,2318 ----
char_data = NULL;
break;
case SQLTEXT : /* is returned as if a long varchar */
!
! bid_b=Ifx_Result->blob_id[locind];
! locator_b=php3_intifx_get_blobloc(bid_b,list);
!
! EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :*locator_b = DATA;
! if (locator_b->loc_status < 0) { /* blob too large */
! php3_error(E_WARNING,"no memory (%d bytes) for blob",
! locator_b->loc_bufsize);
! RETURN_FALSE;
! }
!
! bid=php3_intifx_copy_blob(bid_b, list);
!
! if(locator_b->loc_indicator==-1) {
! nullstr=php3_intifx_null();
! php3_printf("<td>%s</td>", nullstr);
! efree(nullstr);
! ++locind;
break;
+ }
+
+ if(locator_b->loc_loctype==LOCFNAME) {
+ blobfilename=php3_intifx_create_tmpfile(bid_b);
+ php3_intifx_update_blob(bid_b,blobfilename,strlen(blobfilename),list);
+ efree(blobfilename);
+ EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator_b;
+ }
+ ++locind;
+
+ lg=php3_intifx_get_blob(bid, list, &content);
+ if(content==NULL || lg<0) {
+ nullstr=php3_intifx_null();
+ php3_printf("<td>%s</td>", nullstr);
+ efree(nullstr);
+ } else {
+ content[lg]=0;
+ php3_printf("<td>%s</td>", content);
+ }
+ php3_intifx_free_blob(bid,list);
+ break;
+
+ case SQLBYTES :
+ ++locind;
+ php3_printf("<td>(BYTE)</td>");
+ break;
default :
sprintf(string_data,"ESQL/C : %s : unsupported field type[%d]",
fieldname,
***************
*** 2651,2658 ****
--- 2822,2838 ----
for (i = 0; i < MAXBLOBS; ++i) {
if (Ifx_Result->blob_id[i]>0) {
php3_intifx_free_blob(Ifx_Result->blob_id[i],list);
+ Ifx_Result->blob_id[i]=-1;
+ }
+ }
+ #if HAVE_IFX_IUS
+ for (i = 0; i < MAXSLOBS; ++i) {
+ if (Ifx_Result->slob_id[i]>0) {
+ /* php3_intifxus_free_slob(Ifx_Result->slob_id[i],list);
+ Ifx_Result->slob_id[i]=-1; */
}
}
+ #endif
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
***************
*** 2956,2962 ****
if(len<0) {
RETURN_FALSE;
}
!
RETURN_STRINGL(content,len,1);
}
--- 3136,3144 ----
if(len<0) {
RETURN_FALSE;
}
! if(content==NULL) {
! RETURN_STRING(php3_intifx_null(),1);
! }
RETURN_STRINGL(content,len,1);
}
***************
*** 3009,3016 ****
Ifx_blob = (IFX_BLOBRES *) php3_list_find(bid,&type);
if (type!=Informix_GLOBAL(php3_ifx_module).le_blobresult) {
- php3_error(E_WARNING,"%d is not a Informix blob-result index",
- bid);
return NULL;
}
--- 3191,3196 ----
***************
*** 3152,3157 ****
--- 3332,3987 ----
Informix_GLOBAL(php3_ifx_module).blobinfile=pmode->value.lval;
RETURN_TRUE;
}
+
+
+
+ /* ----------------------------------------------------------------------
+ ** void php3_ifx_textasvarchar(int $mode)
+ **
+ ** sets the default text-mode for all select-queries
+ ** mode=0: select returns a blob-id
+ ** mode=1: select returns a varchar with text-content
+ ** return nothing
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifx_textasvarchar(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pmode;
+
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pmode)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pmode);
+
+ Informix_GLOBAL(php3_ifx_module).textasvarchar=pmode->value.lval;
+ RETURN_TRUE;
+ }
+
+
+
+ /* ----------------------------------------------------------------------
+ ** void php3_ifx_byteasvarchar(int $mode)
+ **
+ ** sets the default bye-mode for all select-queries
+ ** mode=0: select returns a blob-id
+ ** mode=1: select returns a varchar with byte-content
+ ** return nothing
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifx_byteasvarchar(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pmode;
+
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pmode)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pmode);
+
+ Informix_GLOBAL(php3_ifx_module).byteasvarchar=pmode->value.lval;
+ RETURN_TRUE;
+ }
+
+
+
+ /* ----------------------------------------------------------------------
+ ** void php3_ifx_nullformat(int $mode)
+ **
+ ** sets the default return value of a NULL-value un a fetch-row
+ ** mode=0: return ""
+ ** mode=1: return "NULL"
+ ** return nothing
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifx_nullformat(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pmode;
+
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pmode)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pmode);
+
+ Informix_GLOBAL(php3_ifx_module).nullformat=pmode->value.lval;
+ RETURN_TRUE;
+ }
+
+
+ /* ----------------------------------------------------------------------
+ ** void php3_intifx_null()
+ **
+ ** return the NULL-string depending on .nullformat
+ ** return "" or "NULL"
+ ** ----------------------------------------------------------------------
+ */
+ char* php3_intifx_null() {
+ char* tmp;
+
+ if(Informix_GLOBAL(php3_ifx_module).nullformat==0) {
+ tmp=emalloc(1);
+ tmp[0]=0;
+ } else {
+ tmp=emalloc(5);
+ strcpy(tmp,"NULL");
+ }
+ return tmp;
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ #if HAVE_IFX_IUS
+
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_create_slob( int mode)
+ **
+ ** creates an slob-object and opens it
+ ** mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER ->
or-mask
+ ** return false on error otherwise the new Slob-Object-id
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_create_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pmode;
+ long id;
+ long mode,create_mode;
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pmode)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pmode);
+
+ mode=pmode->value.lval;
+
+ create_mode=0;
+ if(mode&1!=0)
+ create_mode|=LO_RDONLY;
+ if(mode&2!=0)
+ create_mode|=LO_WRONLY;
+ if(mode&4!=0)
+ create_mode|=LO_APPEND;
+ if(mode&8!=0)
+ create_mode|=LO_RDWR;
+ if(mode&16!=0)
+ create_mode|=LO_BUFFER;
+ if(mode&32!=0)
+ create_mode|=LO_NOBUFFER;
+
+
+ id=php3_intifxus_create_slob(create_mode,list);
+ if(id<0) {
+ RETURN_FALSE;
+ }
+ RETURN_LONG(id);
+ }
+
+ /* ----------------------------------------------------------------------
+ ** internal function
+ ** long php3_intifx_create_slob(long create_mode, HashTable *list)
+ **
+ ** creates an slob-object and opens it
+ ** mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER ->
or-mask
+ ** list: internal hashlist of php3
+ ** return -1 on error otherwise the new Blob-Object-id
+ ** ----------------------------------------------------------------------
+ */
+ long php3_intifxus_create_slob(long create_mode, HashTable *list) {
+ IFX_SLOBRES *Ifx_slob;
+ int errcode;
+
+
+ Ifx_slob=emalloc(sizeof(IFX_SLOBRES));
+ if(Ifx_slob==NULL) {
+ php3_error(E_WARNING,"can't create slob-resource");
+ return -1;
+ }
+
+ errcode=ifx_lo_def_create_spec(&(Ifx_slob->createspec));
+ if(errcode<0) {
+ php3_error(E_WARNING,"can't create slob-resource");
+ return -1;
+ }
+
+
+
Ifx_slob->lofd=ifx_lo_create(Ifx_slob->createspec,create_mode,&(Ifx_slob->slobdata),&errcode);
+ if(errcode<0 || Ifx_slob->lofd<0) {
+ php3_error(E_WARNING,"can't create slob-resource");
+ return -1;
+ }
+
+ return php3_list_insert(Ifx_slob,Informix_GLOBAL(php3_ifx_module).le_slobresult);
+ }
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_free_slob(int bid)
+ **
+ ** deletes the slob-object
+ ** bid: Id of Slobobject
+ ** return false on error otherwise true
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_free_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pid;
+ long ret;
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pid)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pid);
+
+ ret=php3_intifxus_close_slob(pid->value.lval,list);
+ if(ret<0) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+ }
+
+ /* ----------------------------------------------------------------------
+ ** internal function
+ ** long php3_intifxus_free_slob(long bid, HashTable *list)
+ **
+ ** deletes the slob-object
+ ** bid: Id of Slobobject
+ ** list: internal hashlist of php3
+ **
+ ** return -1 on error otherwise 0
+ ** ----------------------------------------------------------------------
+ */
+ long php3_intifxus_free_slob(long bid, HashTable *list) {
+ IFX_SLOBRES *Ifx_slob;
+ int type;
+
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ return -1;
+ }
+
+
+ if(php3_intifxus_close_slob(bid, list)<0) {
+ return -1;
+ }
+ if(Ifx_slob->createspec!=NULL) {
+ ifx_lo_spec_free(Ifx_slob->createspec);
+ Ifx_slob->createspec=NULL;
+ }
+ efree(Ifx_slob);
+ php3_list_delete(bid);
+ return 0;
+ }
+
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_close_slob(int bid)
+ **
+ ** deletes the slob-object
+ ** bid: Id of Slobobject
+ ** return false on error otherwise true
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_close_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pid;
+ long ret;
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pid)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pid);
+
+ ret=php3_intifxus_close_slob(pid->value.lval,list);
+ if(ret<0) {
+ RETURN_FALSE;
+ }
+ RETURN_TRUE;
+ }
+
+ /* ----------------------------------------------------------------------
+ ** internal function
+ ** long php3_intifxus_close_slob(long bid, HashTable *list)
+ **
+ ** deletes the slob-object
+ ** bid: Id of Slobobject
+ ** list: internal hashlist of php3
+ **
+ ** return -1 on error otherwise 0
+ ** ----------------------------------------------------------------------
+ */
+ long php3_intifxus_close_slob(long bid, HashTable *list) {
+ IFX_SLOBRES *Ifx_slob;
+ int type;
+
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ return -1;
+ }
+
+
+ if(Ifx_slob->lofd<0) {
+ php3_error(E_WARNING,"slob-resource already closed");
+ return -1;
+ }
+
+ if(ifx_lo_close(Ifx_slob->lofd)<0) {
+ php3_error(E_WARNING,"can't close slob-resource");
+ return -1;
+ }
+
+ Ifx_slob->lofd=-1;
+ return 0;
+ }
+
+
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_open_slob(long bid, int mode)
+ **
+ ** opens an slob-object
+ ** bid: existing slob-id
+ ** mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER ->
or-mask
+ ** return false on error otherwise the new Slob-Object-id
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_open_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pbid,*pmode;
+ long id;
+ long mode,create_mode;
+
+ if (ARG_COUNT(ht)!=2 || getParameters(ht, 1, &pbid,&pmode)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pmode);
+ convert_to_long(pbid);
+ mode=pmode->value.lval;
+
+ create_mode=0;
+ if(mode&1!=0)
+ create_mode|=LO_RDONLY;
+ if(mode&2!=0)
+ create_mode|=LO_WRONLY;
+ if(mode&4!=0)
+ create_mode|=LO_APPEND;
+ if(mode&8!=0)
+ create_mode|=LO_RDWR;
+ if(mode&16!=0)
+ create_mode|=LO_BUFFER;
+ if(mode&32!=0)
+ create_mode|=LO_NOBUFFER;
+
+ RETURN_LONG(php3_intifxus_open_slob(pbid->value.lval,create_mode,list));
+ }
+
+
+ /* ----------------------------------------------------------------------
+ ** internal function
+ ** long php3_intifx_open_slob(long bid,long create_mode, HashTable *list)
+ **
+ ** opens an slob-object
+ ** mode: 1=LO_RDONLY, 2=LO_WRONLY, 4=LO_APPEND, 8=LO_RDWR, 16=LO_BUFFER, 32=LO_NOBUFFER ->
or-mask
+ ** list: internal hashlist of php3
+ ** return -1 on error otherwise the new Blob-Object-id
+ ** ----------------------------------------------------------------------
+ */
+ long php3_intifxus_open_slob(long bid, long create_mode, HashTable *list) {
+ IFX_SLOBRES *Ifx_slob;
+ int errcode;
+ int type;
+
+
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ return -1;
+ }
+
+ if(Ifx_slob->lofd>0) {
+ php3_error(E_WARNING,"slob-resource already open");
+ return -1;
+ }
+
+ Ifx_slob->lofd=ifx_lo_open(&(Ifx_slob->slobdata),create_mode,&errcode);
+ if(errcode<0 || Ifx_slob->lofd<0) {
+ php3_error(E_WARNING,"can't open slob-resource");
+ return -1;
+ }
+
+ return 0;
+ }
+
+
+
+
+
+
+
+ /* ----------------------------------------------------------------------
+ ** internal function
+ ** long php3_intifx_new_slob(HashTable *list)
+ **
+ ** creates an slob-object but don't open it
+ ** list: internal hashlist of php3
+ ** return -1 on error otherwise the new Blob-Object-id
+ ** ----------------------------------------------------------------------
+ */
+ long php3_intifxus_new_slob(HashTable *list) {
+ IFX_SLOBRES *Ifx_slob;
+ int errcode;
+
+
+ Ifx_slob=emalloc(sizeof(IFX_SLOBRES));
+ if(Ifx_slob==NULL) {
+ php3_error(E_WARNING,"can't create slob-resource");
+ return -1;
+ }
+
+ Ifx_slob->lofd=-1;
+ Ifx_slob->createspec=NULL;
+ return php3_list_insert(Ifx_slob,Informix_GLOBAL(php3_ifx_module).le_slobresult);
+ }
+
+
+
+ /* ----------------------------------------------------------------------
+ ** internal function
+ ** ifx_lo_t *php3_intifx_get_slobloc(long bid, HashTable *list)
+ **
+ ** retuens the ifx_lo_t-structure of a slob-object
+ ** list: internal hashlist of php3
+ ** return -1 on error otherwise the new Blob-Object-id
+ ** ----------------------------------------------------------------------
+ */
+ ifx_lo_t *php3_intifx_get_slobloc(long bid, HashTable *list) {
+ IFX_SLOBRES *Ifx_slob;
+ int errcode, type;
+
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ return NULL;
+ }
+
+ return &(Ifx_slob->slobdata);
+ }
+
+
+
+
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_tell_slob(long bid)
+ **
+ ** retuens the current file or seek position of an open slob-object
+ ** bid: existing slob-id
+ ** return false on error otherwise the seek-position
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_tell_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pbid;
+ long bid;
+ IFX_SLOBRES *Ifx_slob;
+ ifx_int8_t akt_seek_pos;
+ int type;
+ long lakt_seek_pos;
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &pbid)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pbid);
+ bid=pbid->value.lval;
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ RETURN_FALSE;
+ }
+
+ if(ifx_lo_tell(Ifx_slob->lofd,&akt_seek_pos)<0) {
+ php3_error(E_WARNING,"can't perform tell-operation");
+ RETURN_FALSE;
+ }
+
+ if(ifx_int8tolong(&akt_seek_pos,&lakt_seek_pos)<0) {
+ php3_error(E_WARNING,"seek-position to large for long");
+ RETURN_FALSE;
+ }
+ RETURN_LONG(lakt_seek_pos);
+ }
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_seek_slob(long bid, int mode, long offset)
+ **
+ ** sets the current file or seek position of an open slob-object
+ ** bid: existing slob-id
+ ** mode: 0=LO_SEEK_SET, 1=LO_SEEK_CUR, 2=LO_SEEK_END
+ ** offset: byte-offset
+ ** return false on error otherwise the seek-position
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_seek_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pbid, *pmode, *poffset;
+ long bid,lakt_seek_pos;
+ IFX_SLOBRES *Ifx_slob;
+ ifx_int8_t akt_seek_pos,offset;
+ int type,mode;
+
+ if (ARG_COUNT(ht)!=3 || getParameters(ht, 3, &pbid, &pmode, &poffset)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pbid);
+ convert_to_long(pmode);
+ convert_to_long(poffset);
+
+ bid=pbid->value.lval;
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ RETURN_FALSE;
+ }
+
+ mode=LO_SEEK_SET;
+ if(pmode->value.lval==1) {
+ mode=LO_SEEK_CUR;
+ }
+ if(pmode->value.lval==2) {
+ mode=LO_SEEK_END;
+ }
+
+ ifx_int8cvlong(poffset->value.lval,&offset);
+ if(ifx_lo_seek(Ifx_slob->lofd,&offset, mode,&akt_seek_pos)<0) {
+ php3_error(E_WARNING,"can't perform seek-operation");
+ RETURN_FALSE;
+ }
+
+ if(ifx_int8tolong(&akt_seek_pos,&lakt_seek_pos)<0) {
+ php3_error(E_WARNING,"seek-position to large for long");
+ RETURN_FALSE;
+ }
+ RETURN_LONG(lakt_seek_pos);
+ }
+
+
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_read_slob(long bid, long nbytes)
+ **
+ ** reads nbytes of the slob-object
+ ** bid: existing slob-id
+ ** nbytes: bytes zu read
+ ** return false on error otherwise the string
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_read_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pbid, *pnbytes;
+ long bid, nbytes;
+ IFX_SLOBRES *Ifx_slob;
+ int errcode,type;
+ char *buffer;
+
+
+ if (ARG_COUNT(ht)!=2 || getParameters(ht, 2, &pbid, &pnbytes)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pbid);
+ convert_to_long(pnbytes);
+
+ bid=pbid->value.lval;
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ RETURN_FALSE;
+ }
+
+ nbytes=pnbytes->value.lval;
+ buffer=emalloc (nbytes);
+ if(buffer==NULL) {
+ php3_error(E_WARNING,"cannot allocate memory");
+ RETURN_FALSE;
+ }
+ if(ifx_lo_read(Ifx_slob->lofd,buffer,nbytes,&errcode)<0) {
+ efree(buffer);
+ php3_error(E_WARNING,"error during reading slob");
+ RETURN_FALSE;
+ }
+
+ RETURN_STRINGL(buffer,nbytes,0);
+ }
+
+
+ /* ----------------------------------------------------------------------
+ ** int php3_ifxus_write_slob(long bid, string content)
+ **
+ ** writes a string into the slob-object
+ ** bid: existing slob-id
+ ** content: content to write
+ ** return false on error otherwise bytes written
+ ** ----------------------------------------------------------------------
+ */
+ void php3_ifxus_write_slob(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *pbid, *pcontent;
+ long bid, nbytes;
+ IFX_SLOBRES *Ifx_slob;
+ int errcode,type;
+ char *buffer;
+
+
+ if (ARG_COUNT(ht)!=2 || getParameters(ht, 2, &pbid, &pcontent)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+ convert_to_long(pbid);
+ convert_to_string(pcontent);
+
+ bid=pbid->value.lval;
+ Ifx_slob = (IFX_SLOBRES *) php3_list_find(bid,&type);
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_slobresult) {
+ php3_error(E_WARNING,"%d is not a Informix slob-result index",
+ bid);
+ RETURN_FALSE;
+ }
+
+ buffer=pcontent->value.str.val;
+ nbytes=pcontent->value.str.len;
+ if(nbytes<=0) {
+ php3_error(E_WARNING,"string contains no content");
+ RETURN_FALSE;
+ }
+ if((nbytes=ifx_lo_write(Ifx_slob->lofd,buffer,nbytes,&errcode))<0) {
+ php3_error(E_WARNING,"error during writing slob");
+ RETURN_FALSE;
+ }
+
+ RETURN_LONG(nbytes);
+ }
+
+
+
+ #endif
+
/*
* Local variables:
Index: php3/functions/php3_ifx.h
diff -c php3/functions/php3_ifx.h:1.6 php3/functions/php3_ifx.h:1.7
*** php3/functions/php3_ifx.h:1.6 Sun Aug 23 12:23:06 1998
--- php3/functions/php3_ifx.h Fri Sep 11 07:10:49 1998
***************
*** 33,38 ****
--- 33,40 ----
#ifndef _PHP3_IFX_H
#define _PHP3_IFX_H
+ #undef HAVE_IFX_IUS /* deactivated >> incomplete implementation */
+
#if COMPILE_DL
#undef HAVE_IFX
#define HAVE_IFX 1
***************
*** 71,102 ****
extern void php3_ifx_fieldproperties(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_ifx_create_blob(INTERNAL_FUNCTION_PARAMETERS);
! extern long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list);
extern void php3_ifx_free_blob(INTERNAL_FUNCTION_PARAMETERS) ;
! extern long php3_intifx_free_blob(long id, HashTable *list);
extern void php3_ifx_get_blob(INTERNAL_FUNCTION_PARAMETERS);
! extern long php3_intifx_get_blob(long bid, HashTable *list, char** content);
extern void php3_ifx_update_blob(INTERNAL_FUNCTION_PARAMETERS);
! extern long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list);
! extern loc_t *php3_intifx_get_blobloc(long bid, HashTable *list);
! extern char* php3_intifx_create_tmpfile(long bid);
extern void php3_ifx_blobinfile_mode(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_ifx_copy_blob(INTERNAL_FUNCTION_PARAMETERS);
! extern long php3_intifx_copy_blob(long bid, HashTable *list);
typedef struct {
long default_link;
long num_links,num_persistent;
long max_links,max_persistent;
long allow_persistent;
! int le_result,le_link,le_plink,le_blobresult;
char *default_host, *default_user, *default_password;
int connectionid;
int cursorid;
long blobinfile; /* 0=save in memory, 1=save in file */
} ifx_module;
#define MAXBLOBS 64
#define BLOBINFILE 0 /* 0=in memory, 1=in file */
typedef struct ifx_res {
--- 73,129 ----
extern void php3_ifx_fieldproperties(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_ifx_create_blob(INTERNAL_FUNCTION_PARAMETERS);
! long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list);
extern void php3_ifx_free_blob(INTERNAL_FUNCTION_PARAMETERS) ;
! long php3_intifx_free_blob(long id, HashTable *list);
extern void php3_ifx_get_blob(INTERNAL_FUNCTION_PARAMETERS);
! long php3_intifx_get_blob(long bid, HashTable *list, char** content);
extern void php3_ifx_update_blob(INTERNAL_FUNCTION_PARAMETERS);
! long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list);
! loc_t *php3_intifx_get_blobloc(long bid, HashTable *list);
! char* php3_intifx_create_tmpfile(long bid);
extern void php3_ifx_blobinfile_mode(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_ifx_copy_blob(INTERNAL_FUNCTION_PARAMETERS);
! long php3_intifx_copy_blob(long bid, HashTable *list);
! extern void php3_ifx_textasvarchar(INTERNAL_FUNCTION_PARAMETERS);
! extern void php3_ifx_byteasvarchar(INTERNAL_FUNCTION_PARAMETERS);
! extern void php3_ifx_nullformat(INTERNAL_FUNCTION_PARAMETERS);
! char* php3_intifx_null();
!
! #if HAVE_IFX_IUS
! extern void php3_ifxus_create_slob(INTERNAL_FUNCTION_PARAMETERS);
! long php3_intifxus_create_slob(long create_mode, HashTable *list);
! extern void php3_ifxus_free_slob(INTERNAL_FUNCTION_PARAMETERS) ;
! long php3_intifxus_free_slob(long bid, HashTable *list);
! extern void php3_ifxus_close_slob(INTERNAL_FUNCTION_PARAMETERS) ;
! long php3_intifxus_close_slob(long bid, HashTable *list);
! extern void php3_ifxus_open_slob(INTERNAL_FUNCTION_PARAMETERS) ;
! long php3_intifxus_open_slob(long bid, long create_mode, HashTable *list);
! long php3_intifxus_new_slob(HashTable *list);
! ifx_lo_t *php3_intifx_get_slobloc(long bid, HashTable *list);
! extern void php3_ifxus_read_slob(INTERNAL_FUNCTION_PARAMETERS);
! extern void php3_ifxus_write_slob(INTERNAL_FUNCTION_PARAMETERS);
! extern void php3_ifxus_seek_slob(INTERNAL_FUNCTION_PARAMETERS);
! extern void php3_ifxus_tell_slob(INTERNAL_FUNCTION_PARAMETERS);
! #endif
typedef struct {
long default_link;
long num_links,num_persistent;
long max_links,max_persistent;
long allow_persistent;
! int le_result,le_link,le_plink,le_blobresult,le_slobresult;
char *default_host, *default_user, *default_password;
int connectionid;
int cursorid;
long blobinfile; /* 0=save in memory, 1=save in file */
+ long textasvarchar; /* 0=as id, 1=as varchar */
+ long byteasvarchar; /* 0=as id, 1=as varchar */
+ long nullformat; /* 0=NULL as "", 1= NULL as "NULL" */
} ifx_module;
#define MAXBLOBS 64
+ #define MAXSLOBS 64
#define BLOBINFILE 0 /* 0=in memory, 1=in file */
typedef struct ifx_res {
***************
*** 112,125 ****
int rowid;
int affected_rows;
int blob_id[MAXBLOBS];
} IFX_RES;
typedef struct ifx_blobres {
! loc_t blob_data;
! int type;
! int mode;
} IFX_BLOBRES;
#ifndef THREAD_SAFE
--- 139,170 ----
int rowid;
int affected_rows;
int blob_id[MAXBLOBS];
+ #if HAVE_IFX_IUS
+ int slob_id[MAXSLOBS];
+ #endif
} IFX_RES;
+
+
+
typedef struct ifx_blobres {
! int mode;
! loc_t blob_data;
! int type;
} IFX_BLOBRES;
+
+
+ #if HAVE_IFX_IUS
+ typedef struct ifx_slobres {
+ ifx_lo_t slobdata;
+ ifx_lo_create_spec_t *createspec;
+ int lofd;
+ } IFX_SLOBRES;
+ #endif
+
+
+
#ifndef THREAD_SAFE
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net