CVS update: php3/functions

From: Date: Wed, 16 Sep 1998 17:36:19 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-1169@lists.php.net to get a copy of this message
Date: Wednesday September 16, 1998 @ 13:36 Author: danny Update of /repository/php3/functions In directory asf:/u2/tmp/cvs-serv19362/functions Modified Files: ifx.ec Log Message: - ODS 7.x and SE 7.x now compile ifx.ec again - some cosmetic changes, and minor optimizations and bug fixes Index: php3/functions/ifx.ec diff -c php3/functions/ifx.ec:1.18 php3/functions/ifx.ec:1.19 *** php3/functions/ifx.ec:1.18 Tue Sep 15 17:46:55 1998 --- php3/functions/ifx.ec Wed Sep 16 13:36:18 1998 *************** *** 60,69 **** /* Changes: 23.8.1998 (chc@idgruppe.de) - full blobsupport (TEXT and BYTE) ! - new functions: ifx_create_blob, ifx_copy_blob, ifx_free_blob, ifx_update_blob, ifx_get_blob, ifx_blobinfile_mode - file and memory-support of blobs ! - load TEXT and BYTE in memory by default (controllable by "ifx.blobinfile" in php3.ini-file) ! - update all functions to support blobs (ifx_query, ifx_prepare, ifx_do, ifx_htmltbl_result, ifx_fetch_row) - minor bug-fixes - Test-Page (informix_blob.php3) which tests the blob-support --- 60,72 ---- /* Changes: 23.8.1998 (chc@idgruppe.de) - full blobsupport (TEXT and BYTE) ! - new functions: ifx_create_blob, ifx_copy_blob, ifx_free_blob, ! ifx_update_blob, ifx_get_blob, ifx_blobinfile_mode - file and memory-support of blobs ! - load TEXT and BYTE in memory by default ! (controllable by "ifx.blobinfile" in php3.ini-file) ! - update all functions to support blobs (ifx_query, ifx_prepare, ! ifx_do, ifx_htmltbl_result, ifx_fetch_row) - minor bug-fixes - Test-Page (informix_blob.php3) which tests the blob-support *************** *** 72,78 **** - 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) --- 75,82 ---- - 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 functions ! (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) *************** *** 146,155 **** {"ifx_fieldtypes", php3_ifx_fieldtypes, NULL}, {"ifx_fieldproperties",php3_ifx_fieldproperties, NULL}, ! {"ifx_create_blob", php3_ifx_create_blob, NULL}, ! {"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}, --- 150,159 ---- {"ifx_fieldtypes", php3_ifx_fieldtypes, NULL}, {"ifx_fieldproperties",php3_ifx_fieldproperties, NULL}, ! {"ifx_create_blob", php3_ifx_create_blob, NULL}, ! {"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}, *************** *** 849,856 **** ** 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(s) with ? in the query 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); ** --- 853,863 ---- ** 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" ! ** non-select queries accept an optional "blobarryid" parameter ! ** blobsupport: mark the blob-column(s) with ? in the insert/update query ! ** and add a blob-id-array-functionparameter ! ** select queries return "blob-ids" for blob columns ! ** except if text/byteasvarchar is set ** example: ifx_query("insert into catalog (stock_num, manu_code, ** cat_descr,cat_picture) values(1,'HRO',?,?)",$cid,$bidarray); ** *************** *** 969,980 **** 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; if (sqlca.sqlcode != 0) { /* not a select, execute immediate */ --- 976,987 ---- 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; if (sqlca.sqlcode != 0) { /* not a select, execute immediate */ *************** *** 995,1032 **** } 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; } if (ifx_check() < 0) { Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE; --- 1002,1042 ---- } 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; } if (ifx_check() < 0) { Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE; *************** *** 1154,1174 **** locind = 0; for (i = 1; i <= fieldcount; ++i) { EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; ! if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES)) { int bid; if(fieldtype==SQLTEXT) { ! bid=php3_intifx_create_blob(1,0,"",-1,list); ! } if(fieldtype==SQLBYTES) { ! if(Informix_GLOBAL(php3_ifx_module).blobinfile==0) { ! bid=php3_intifx_create_blob(0,0,"",-1,list); ! } else { ! blobfilename=php3_intifx_create_tmpfile(i); ! bid=php3_intifx_create_blob(0,1,blobfilename,strlen(blobfilename),list); ! locator=php3_intifx_get_blobloc(bid,list); ! locator->loc_oflags=LOC_WONLY; ! } } locator=php3_intifx_get_blobloc(bid,list); Ifx_Result->blob_id[locind]=bid; --- 1164,1185 ---- locind = 0; for (i = 1; i <= fieldcount; ++i) { EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; ! if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES)) { int bid; if(fieldtype==SQLTEXT) { ! bid=php3_intifx_create_blob(1,0,"",-1,list); ! } if(fieldtype==SQLBYTES) { ! if(Informix_GLOBAL(php3_ifx_module).blobinfile==0) { ! bid=php3_intifx_create_blob(0,0,"",-1,list); ! } else { ! blobfilename=php3_intifx_create_tmpfile(i); ! bid=php3_intifx_create_blob( ! 0,1,blobfilename,strlen(blobfilename),list); ! locator=php3_intifx_get_blobloc(bid,list); ! locator->loc_oflags=LOC_WONLY; ! } } locator=php3_intifx_get_blobloc(bid,list); Ifx_Result->blob_id[locind]=bid; *************** *** 1316,1327 **** 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; if (sqlca.sqlcode != 0) { /* not a select, execute immediate */ --- 1327,1338 ---- 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; if (sqlca.sqlcode != 0) { /* not a select, execute immediate */ *************** *** 1342,1375 **** 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); ! } /* while */ } /* if paramquery */ Ifx_Result->affected_rows = affected_rows; /* saved estimated */ } else { --- 1353,1387 ---- 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); ! } /* while */ } /* if paramquery */ Ifx_Result->affected_rows = affected_rows; /* saved estimated */ } else { *************** *** 1524,1530 **** result->value.lval); RETURN_FALSE; } ! if (Ifx_Result->iscursory==0) { /* execute immediate */ if(Ifx_Result->paramquery!=0) { EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :descrpid; } else { --- 1536,1542 ---- result->value.lval); RETURN_FALSE; } ! if (Ifx_Result->iscursory==0) { /* execute immediate */ if(Ifx_Result->paramquery!=0) { EXEC SQL EXECUTE :statemid USING SQL DESCRIPTOR :descrpid; } else { *************** *** 1537,1543 **** RETURN_FALSE; } Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */ ! } else { /* open cursor */ if (Ifx_Result->isscroll) if (Ifx_Result->ishold) EXEC SQL DECLARE :cursorid SCROLL CURSOR WITH HOLD FOR :statemid; --- 1549,1555 ---- RETURN_FALSE; } Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */ ! } else { /* open cursor */ if (Ifx_Result->isscroll) if (Ifx_Result->ishold) EXEC SQL DECLARE :cursorid SCROLL CURSOR WITH HOLD FOR :statemid; *************** *** 1567,1587 **** locind = 0; for (i = 1; i <= fieldcount; ++i) { EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; ! if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES)) { int bid; if(fieldtype==SQLTEXT) { ! bid=php3_intifx_create_blob(1,0,"",-1,list); ! } if(fieldtype==SQLBYTES) { ! if(Informix_GLOBAL(php3_ifx_module).blobinfile==0) { ! bid=php3_intifx_create_blob(0,0,"",-1,list); ! } else { ! blobfilename=php3_intifx_create_tmpfile(i); ! bid=php3_intifx_create_blob(0,1,blobfilename,strlen(blobfilename),list); ! locator=php3_intifx_get_blobloc(bid,list); ! locator->loc_oflags=LOC_WONLY; ! } } locator=php3_intifx_get_blobloc(bid,list); Ifx_Result->blob_id[locind]=bid; --- 1579,1600 ---- locind = 0; for (i = 1; i <= fieldcount; ++i) { EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE; ! if ((fieldtype == SQLTEXT) || (fieldtype == SQLBYTES)) { int bid; if(fieldtype==SQLTEXT) { ! bid=php3_intifx_create_blob(1,0,"",-1,list); ! } if(fieldtype==SQLBYTES) { ! if(Informix_GLOBAL(php3_ifx_module).blobinfile==0) { ! bid=php3_intifx_create_blob(0,0,"",-1,list); ! } else { ! blobfilename=php3_intifx_create_tmpfile(i); ! bid=php3_intifx_create_blob( ! 0,1,blobfilename,strlen(blobfilename),list); ! locator=php3_intifx_get_blobloc(bid,list); ! locator->loc_oflags=LOC_WONLY; ! } } locator=php3_intifx_get_blobloc(bid,list); Ifx_Result->blob_id[locind]=bid; *************** *** 1785,1793 **** int field_ind; /* the field index */ char *field; /* the field data */ ! #if HAVE_IFX_IUS ifx_int8_t int8_var; ! #endif short indicator; int int_data; --- 1798,1806 ---- int field_ind; /* the field index */ char *field; /* the field data */ ! $ifdef HAVE_IFX_IUS; ifx_int8_t int8_var; ! $endif; short indicator; int int_data; *************** *** 1815,1820 **** --- 1828,1835 ---- char *fetch_pos; + char *nullstr; + Informix_TLS_VARS; switch(ARG_COUNT(ht)) { *************** *** 1849,1854 **** --- 1864,1871 ---- break; } + nullstr=php3_intifx_null(); + Informix_GLOBAL(php3_ifx_module).sv_sqlcode = 0; if (type!=Informix_GLOBAL(php3_ifx_module).le_result) { *************** *** 1940,1963 **** *p = 0; if (indicator == -1) { /* NULL */ ! if((Informix_GLOBAL(php3_ifx_module).textasvarchar==0 && fieldtype==SQLTEXT) || (Informix_GLOBAL(php3_ifx_module).byteasvarchar==0 && 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; ! } ! if(fieldtype==SQLTEXT || fieldtype==SQLBYTES) { ! ++locind; ! } ! add_assoc_string(return_value, fieldname, php3_intifx_null(), 0); ! continue; ! } switch (fieldtype) { case SQLSERIAL : case SQLINT : --- 1957,1980 ---- *p = 0; if (indicator == -1) { /* NULL */ ! if((Informix_GLOBAL(php3_ifx_module).textasvarchar==0 ! && fieldtype==SQLTEXT) ! || (Informix_GLOBAL(php3_ifx_module).byteasvarchar==0 ! && fieldtype==SQLBYTES)) { ! 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); ! ++locind; ! continue; ! } ! if(fieldtype==SQLTEXT || fieldtype==SQLBYTES) { ! ++locind; ! } ! add_assoc_string(return_value, fieldname, nullstr, DUP); ! continue; ! } /* NULL */ switch (fieldtype) { case SQLSERIAL : case SQLINT : *************** *** 2011,2024 **** #if HAVE_IFX_IUS case SQLSERIAL8 : case SQLINT8 : EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA; ! ifx_int8toasc(&int8_var,string_data,200); add_assoc_string(return_value, fieldname, string_data, DUP); break; ! case SQLNCHAR : ! case SQLNVCHAR : ! case SQLLVARCHAR: ! case SQLBOOL: #endif case SQLCHAR : case SQLVCHAR : --- 2028,2043 ---- #if HAVE_IFX_IUS case SQLSERIAL8 : case SQLINT8 : + $ifdef HAVE_IFX_IUS; EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA; ! ifx_int8toasc(&int8_var,string_data,200); add_assoc_string(return_value, fieldname, string_data, DUP); break; ! $endif; ! case SQLNCHAR : ! case SQLNVCHAR : ! case SQLLVARCHAR: ! case SQLBOOL: #endif case SQLCHAR : case SQLVCHAR : *************** *** 2032,2089 **** char_data = NULL; break; case SQLBYTES : ! case SQLTEXT : ! bid_b=Ifx_Result->blob_id[locind]; ! locator_b=php3_intifx_get_blobloc(bid_b,list); ! ++locind; ! 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; } ! ! ! if(locator_b->loc_indicator==-1) { ! if((Informix_GLOBAL(php3_ifx_module).textasvarchar!=0 && fieldtype==SQLTEXT) || (Informix_GLOBAL(php3_ifx_module).byteasvarchar!=0 && fieldtype==SQLBYTES)) { ! add_assoc_string(return_value, fieldname, php3_intifx_null(), 0); ! } else { ! char *nullstr; ! ! bid=php3_intifx_copy_blob(bid_b, list); ! nullstr=php3_intifx_null(); ! php3_intifx_update_blob(bid,nullstr,strlen(nullstr),list); ! add_assoc_long(return_value,fieldname,bid); ! efree(nullstr); ! } ! 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); ! efree(blobfilename); ! EXEC SQL SET DESCRIPTOR :descrpid VALUE :i DATA= :*locator_b; ! } ! ! 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(),0); ! } 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 : sprintf(string_data,"ESQL/C : %s : unsupported field type[%d]", fieldname, --- 2051,2100 ---- char_data = NULL; break; case SQLBYTES : ! case SQLTEXT : /* NULL has already been dealt with */ ! bid_b=Ifx_Result->blob_id[locind]; ! locator_b=php3_intifx_get_blobloc(bid_b,list); ! ++locind; ! 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; } ! /* copy blob */ ! bid=php3_intifx_copy_blob(bid_b, list); ! /* and generate new tempfile for next row */ ! 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; ! } ! ! /* return blob as VARCHAR ? */ ! /* note that in case of "blobinfile" */ ! /* you get the file name */ ! /* a new one for every row ! */ ! 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,nullstr,DUP); ! } else { ! add_assoc_stringl(return_value,fieldname,content,lg,DUP); ! } ! php3_intifx_free_blob(bid, list); ! break; ! } ! /* no, return as blob id */ ! add_assoc_long(return_value,fieldname,bid); ! break; default : sprintf(string_data,"ESQL/C : %s : unsupported field type[%d]", fieldname, *************** *** 2094,2099 **** --- 2105,2112 ---- continue; } + + efree(nullstr); } *************** *** 2127,2135 **** int fieldleng; /* field length */ char *field; /* the field */ ! #if HAVE_IFX_IUS ifx_int8_t int8_var; ! #endif short indicator; int int_data; --- 2140,2148 ---- int fieldleng; /* field length */ char *field; /* the field */ ! $ifdef HAVE_IFX_IUS; ifx_int8_t int8_var; ! $endif; short indicator; int int_data; *************** *** 2146,2155 **** char *content; long lg; char *nullstr; - int type; int num_fields; --- 2159,2169 ---- char *content; + char *copy_content; long lg; + char *nullstr; int type; int num_fields; *************** *** 2167,2173 **** Informix_TLS_VARS; switch (ARG_COUNT(ht)) { ! case 1: if (getParameters(ht, 1, &result)==FAILURE) { RETURN_FALSE; } --- 2181,2187 ---- Informix_TLS_VARS; switch (ARG_COUNT(ht)) { ! case 1: if (getParameters(ht, 1, &result)==FAILURE) { RETURN_FALSE; } *************** *** 2230,2235 **** --- 2244,2250 ---- RETURN_LONG(0); } num_fields = fieldcount; + nullstr = php3_intifx_null(); /* start table tag */ if (table_options == NULL) *************** *** 2263,2269 **** locind = 0; for (i = 1; i <= num_fields; i++) { EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :fieldtype = TYPE, - :fieldname = NAME, :fieldleng = LENGTH, :indicator = INDICATOR; if (ifx_check() < 0) { --- 2278,2283 ---- *************** *** 2274,2288 **** RETURN_FALSE; } - p = fieldname; /* rtrim fieldname */ - while ((*p != ' ') && (p < &fieldname[sizeof(fieldname) - 1])) ++p; - *p = 0; - if (indicator == -1) { /* NULL */ ! if(fieldtype==SQLTEXT || fieldtype==SQLBYTES) ! ++locind; ! php3_printf("<td>%s</td>",php3_intifx_null()); ! continue; } switch (fieldtype) { case SQLSERIAL : --- 2288,2299 ---- RETURN_FALSE; } if (indicator == -1) { /* NULL */ ! if(fieldtype==SQLTEXT || fieldtype==SQLBYTES) { ! ++locind; ! } ! php3_printf("<td>%s</td>", nullstr); ! continue; } switch (fieldtype) { case SQLSERIAL : *************** *** 2334,2350 **** php3_printf("<td>%s</td>", string_data); break; #if HAVE_IFX_IUS ! case SQLSERIAL8 : ! case SQLINT8 : EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA; ! ifx_int8toasc(&int8_var,string_data,200); php3_printf("<td>%s</td>", string_data); break; ! case SQLNCHAR : ! case SQLNVCHAR : ! case SQLLVARCHAR: ! case SQLBOOL: #endif if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { php3_error(E_WARNING, "Out of memory"); RETURN_FALSE; --- 2345,2365 ---- php3_printf("<td>%s</td>", string_data); break; #if HAVE_IFX_IUS ! case SQLSERIAL8 : ! case SQLINT8 : ! $ifdef HAVE_IFX_IUS; EXEC SQL GET DESCRIPTOR :descrpid VALUE :i :int8_var = DATA; ! ifx_int8toasc(&int8_var,string_data,200); php3_printf("<td>%s</td>", string_data); break; ! $endif; ! case SQLNCHAR : ! case SQLNVCHAR : ! case SQLLVARCHAR: ! case SQLBOOL: #endif + case SQLCHAR : + case SQLVCHAR : if ((char_data = (char *)emalloc(fieldleng + 1)) == NULL) { php3_error(E_WARNING, "Out of memory"); RETURN_FALSE; *************** *** 2354,2411 **** efree(char_data); 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, ! fieldleng); ! php3_printf("<td>%s</td>", string_data); ! break; } continue; --- 2369,2420 ---- efree(char_data); char_data = NULL; break; ! case SQLTEXT : ! /* NULL has already been dealt with */ ! /* treated always as a long VARCHAR here */ ! /* if blobinbfile, too bad */ ! bid_b=Ifx_Result->blob_id[locind]; ++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; + } + + /* get blob contents */ + lg=php3_intifx_get_blob(bid_b, list, &content); + + if(content==NULL || lg<0) { + php3_printf("<td>%s</td>", nullstr); + } else { + /* need an extra byte for string terminator */ + copy_content = malloc(lg + 1); + if (copy_content == NULL) { + php3_error(E_WARNING,"no memory for TEXT column"); + RETURN_FALSE; + } + memcpy(copy_content, content, lg); + copy_content[lg]=0; + php3_printf("<td>%s</td>", copy_content); + free(copy_content); + } break; case SQLBYTES : ! ++locind; ! php3_printf("<td>(BYTE)</td>"); ! break; default : ! sprintf(string_data,"ESQL/C : %s : unsupported field type[%d]", ! fieldname, ! fieldleng); ! php3_printf("<td>%s</td>", string_data); ! break; } continue; *************** *** 2432,2438 **** } /* endwhile (moredata); */ php3_printf("</table>\n"); ! RETURN_LONG(Ifx_Result->rowid); } --- 2441,2447 ---- } /* endwhile (moredata); */ php3_printf("</table>\n"); ! efree(nullstr); RETURN_LONG(Ifx_Result->rowid); } *************** *** 2496,2502 **** Informix_TLS_VARS; switch (ARG_COUNT(ht)) { ! case 1: if (getParameters(ht, 1, &result)==FAILURE) { RETURN_FALSE; } --- 2505,2511 ---- Informix_TLS_VARS; switch (ARG_COUNT(ht)) { ! case 1: if (getParameters(ht, 1, &result)==FAILURE) { RETURN_FALSE; } *************** *** 2623,2629 **** default : char_data=emalloc(20); sprintf(char_data,"ESQL/C : %i",fieldtype); ! break; } /* switch (fieldtype) */ add_assoc_string(return_value, fieldname, char_data, DUP); --- 2632,2638 ---- default : char_data=emalloc(20); sprintf(char_data,"ESQL/C : %i",fieldtype); ! break; } /* switch (fieldtype) */ add_assoc_string(return_value, fieldname, char_data, DUP); *************** *** 2698,2704 **** Informix_TLS_VARS; switch (ARG_COUNT(ht)) { ! case 1: if (getParameters(ht, 1, &result)==FAILURE) { RETURN_FALSE; } --- 2707,2713 ---- Informix_TLS_VARS; switch (ARG_COUNT(ht)) { ! case 1: if (getParameters(ht, 1, &result)==FAILURE) { RETURN_FALSE; } *************** *** 2922,2930 **** IFX_RES *Ifx_Result; EXEC SQL BEGIN DECLARE SECTION; ! char *ifx; /* connection ID */ ! char *cursorid; /* query cursor id */ ! char *statemid; /* statement id */ char *descrpid; /* descriptor id */ EXEC SQL END DECLARE SECTION; --- 2931,2939 ---- IFX_RES *Ifx_Result; EXEC SQL BEGIN DECLARE SECTION; ! char *ifx; /* connection ID */ ! char *cursorid; /* query cursor id */ ! char *statemid; /* statement id */ char *descrpid; /* descriptor id */ EXEC SQL END DECLARE SECTION; *************** *** 2961,2974 **** 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 cursorid = Ifx_Result->cursorid; statemid = Ifx_Result->statemid; --- 2970,2983 ---- 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 cursorid = Ifx_Result->cursorid; statemid = Ifx_Result->statemid; *************** *** 3022,3045 **** id=php3_intifx_create_blob(type,mode,pparam->value.str.val,pparam->value.str.len,list); if(id<0) { ! RETURN_FALSE; } RETURN_LONG(id); } /* ---------------------------------------------------------------------- ! ** internal function ! ** long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list) ! ** ! ** creates an blob-object ! ** type: 1=TEXT, 0=BYTE ! ** mode: blob-object holds 0=the content in momory, 1=content in file ! ** param: if mode=0: pointer to the content ! ** mode=1: pointer to the filestring ! ** len: length of param ! ** list: internal hashlist of php3 ! ** return -1 on error otherwise the new Blob-Object-id ! ** ---------------------------------------------------------------------- */ long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list) { IFX_BLOBRES *Ifx_blob; --- 3031,3054 ---- id=php3_intifx_create_blob(type,mode,pparam->value.str.val,pparam->value.str.len,list); if(id<0) { ! RETURN_FALSE; } RETURN_LONG(id); } /* ---------------------------------------------------------------------- ! * internal function ! * long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list) ! * ! * creates an blob-object ! * type: 1=TEXT, 0=BYTE ! * mode: blob-object holds 0=the content in momory, 1=content in file ! * param: if mode=0: pointer to the content ! * mode=1: pointer to the filestring ! * len: length of param ! * list: internal hashlist of php3 ! * return -1 on error otherwise the new Blob-Object-id ! * ---------------------------------------------------------------------- */ long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list) { IFX_BLOBRES *Ifx_blob; *************** *** 3124,3138 **** /* ---------------------------------------------------------------------- ! ** internal function ! ** long php3_intifx_copy_blob(long bid, HashTable *list) ! ** ! ** duplicates the given blob-object ! ** bid: Id of Blobobject ! ** list: internal hashlist of php3 ! ** ! ** return -1 on error otherwise the new Blob-Object-id ! ** ---------------------------------------------------------------------- */ long php3_intifx_copy_blob(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob, *Ifx_blob_orig; --- 3133,3147 ---- /* ---------------------------------------------------------------------- ! * internal function ! * long php3_intifx_copy_blob(long bid, HashTable *list) ! * ! * duplicates the given blob-object ! * bid: Id of Blobobject ! * list: internal hashlist of php3 ! * ! * return -1 on error otherwise the new Blob-Object-id ! * ---------------------------------------------------------------------- */ long php3_intifx_copy_blob(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob, *Ifx_blob_orig; *************** *** 3220,3235 **** } /* ---------------------------------------------------------------------- ! ** internal function ! ** long php3_intifx_free_blob(long bid, HashTable *list) ! ** ! ** deletes the blob-object ! ** bid: Id of Blobobject ! ** list: internal hashlist of php3 ! ** ! ** return -1 on error otherwise 0 ! ** FREES BYTE-MEMORY WITH EFREE() ! ** ---------------------------------------------------------------------- */ long php3_intifx_free_blob(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob; --- 3229,3244 ---- } /* ---------------------------------------------------------------------- ! * internal function ! * long php3_intifx_free_blob(long bid, HashTable *list) ! * ! * deletes the blob-object ! * bid: Id of Blobobject ! * list: internal hashlist of php3 ! * ! * return -1 on error otherwise 0 ! * FREES BYTE-MEMORY WITH EFREE() ! * ---------------------------------------------------------------------- */ long php3_intifx_free_blob(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob; *************** *** 3260,3275 **** /* ---------------------------------------------------------------------- ! ** internal function ! ** long php3_intifx2_free_blob(long bid, HashTable *list) ! ** ! ** deletes the blob-object ! ** bid: Id of Blobobject ! ** list: internal hashlist of php3 ! ** ! ** return -1 on error otherwise 0 ! ** FREES BYTE-MEMORY WITH FREE(), use this for freeing blob-source after select (in ifx_free_result) ! ** ---------------------------------------------------------------------- */long php3_intifx2_free_blob(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob; int type; --- 3269,3284 ---- /* ---------------------------------------------------------------------- ! * internal function ! * long php3_intifx2_free_blob(long bid, HashTable *list) ! * ! * deletes the blob-object ! * bid: Id of Blobobject ! * list: internal hashlist of php3 ! * ! * return -1 on error otherwise 0 ! * FREES BYTE-MEMORY WITH FREE(), use this for freeing blob-source after select (in ifx_free_result) ! * ---------------------------------------------------------------------- */long php3_intifx2_free_blob(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob; int type; *************** *** 3323,3338 **** /* ---------------------------------------------------------------------- ! ** internal function ! ** long php3_intifx_get_blob(long bid, HashTable *list, char** content) ! ** ! ** returns the content of the blob-object ! ** bid: Id of Blobobject ! ** list: internal hashlist of php3 ! ** ! ** return -1 on error ! ** returns the pointer to the content in char** content and the amount of content in bytes ! ** ---------------------------------------------------------------------- */ long php3_intifx_get_blob(long bid, HashTable *list, char** content) { IFX_BLOBRES *Ifx_blob; --- 3332,3347 ---- /* ---------------------------------------------------------------------- ! * internal function ! * long php3_intifx_get_blob(long bid, HashTable *list, char** content) ! * ! * returns the content of the blob-object ! * bid: Id of Blobobject ! * list: internal hashlist of php3 ! * ! * return -1 on error ! * returns the pointer to the content in char** content and the amount of content in bytes ! * ---------------------------------------------------------------------- */ long php3_intifx_get_blob(long bid, HashTable *list, char** content) { IFX_BLOBRES *Ifx_blob; *************** *** 3355,3368 **** /* ---------------------------------------------------------------------- ! ** internal function ! ** loc_t *php3_intifx_get_blobloc(long bid, HashTable *list) ! ** ! ** returns the blob-locator-structur ! ** bid: Id of Blobobject ! ** list: internal hashlist of php3 ! ** return NULL on error or the pointer to the locator-structur ! ** ---------------------------------------------------------------------- */ loc_t *php3_intifx_get_blobloc(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob; --- 3364,3377 ---- /* ---------------------------------------------------------------------- ! * internal function ! * loc_t *php3_intifx_get_blobloc(long bid, HashTable *list) ! * ! * returns the blob-locator-structur ! * bid: Id of Blobobject ! * list: internal hashlist of php3 ! * return NULL on error or the pointer to the locator-structur ! * ---------------------------------------------------------------------- */ loc_t *php3_intifx_get_blobloc(long bid, HashTable *list) { IFX_BLOBRES *Ifx_blob; *************** *** 3408,3423 **** /* ---------------------------------------------------------------------- ! ** internal function ! ** long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list) ! ** ! ** updates the content of the blob-object ! ** bid: Id of Blobobject ! ** param: string of new data ! ** len: length of string ! ** list: internal hashlist of php3 ! ** return nothing ! ** ---------------------------------------------------------------------- */ long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list) { IFX_BLOBRES *Ifx_blob; --- 3417,3432 ---- /* ---------------------------------------------------------------------- ! * internal function ! * long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list) ! * ! * updates the content of the blob-object ! * bid: Id of Blobobject ! * param: string of new data ! * len: length of string ! * list: internal hashlist of php3 ! * return nothing ! * ---------------------------------------------------------------------- */ long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list) { IFX_BLOBRES *Ifx_blob; *************** *** 3469,3476 **** } - char* php3_intifx_create_tmpfile(long bid) { --- 3478,3491 ---- } + /*------------------------------------------------- + * internal function + * + * php3_intifx_create_tmpfile(long bid) + * creates a temporary file to store a blob in + *------------------------------------------------- + */ char* php3_intifx_create_tmpfile(long bid) { *************** *** 3592,3602 **** /* ---------------------------------------------------------------------- ! ** void php3_intifx_null() ! ** ! ** return the NULL-string depending on .nullformat ! ** return "" or "NULL" ! ** ---------------------------------------------------------------------- */ char* php3_intifx_null() { char* tmp; --- 3607,3617 ---- /* ---------------------------------------------------------------------- ! * void php3_intifx_null() ! * ! * return the NULL-string depending on .nullformat ! * return "" or "NULL" ! * ---------------------------------------------------------------------- */ char* php3_intifx_null() { char* tmp; *************** *** 3670,3683 **** } /* ---------------------------------------------------------------------- ! ** 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; --- 3685,3698 ---- } /* ---------------------------------------------------------------------- ! * 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; *************** *** 3733,3747 **** } /* ---------------------------------------------------------------------- ! ** 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; --- 3748,3762 ---- } /* ---------------------------------------------------------------------- ! * 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; *************** *** 3795,3809 **** } /* ---------------------------------------------------------------------- ! ** 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; --- 3810,3824 ---- } /* ---------------------------------------------------------------------- ! * 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; *************** *** 3875,3888 **** /* ---------------------------------------------------------------------- ! ** 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; --- 3890,3903 ---- /* ---------------------------------------------------------------------- ! * 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; *************** *** 3918,3930 **** /* ---------------------------------------------------------------------- ! ** 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; --- 3933,3945 ---- /* ---------------------------------------------------------------------- ! * 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; *************** *** 3945,3957 **** /* ---------------------------------------------------------------------- ! ** 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; --- 3960,3972 ---- /* ---------------------------------------------------------------------- ! * 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; *************** *** 3976,3982 **** /* ---------------------------------------------------------------------- ** 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 ** ---------------------------------------------------------------------- --- 3991,3997 ---- /* ---------------------------------------------------------------------- ** int php3_ifxus_tell_slob(long bid) ** ! ** returns the current file or seek position of an open slob-object ** bid: existing slob-id ** return false on error otherwise the seek-position ** ---------------------------------------------------------------------- -- 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

« previous php.dev (#1169) next »