/*
+----------------------------------------------------------------------+
- | PHP HTML Embedded Scripting Language Version 3.0 |
+ | PHP HTML Embedded Scripting Language Version 4.0 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997,1998 PHP Development Team (See Credits file) |
+ | Copyright (c) 1997,1999 PHP Development Team (See Credits file) |
+----------------------------------------------------------------------+
| This program is free software; you can redistribute it and/or modify |
| it under the terms of one of the following licenses: |
+----------------------------------------------------------------------+
| Authors: Danny Heijl <Danny.Heijl@cevi.be> : initial cut (ODS 7.2x) |
| Christian Cartus <chc@idgruppe.de> : blobs, and IUS 9 |
- | Jouni Ahto <jah@guru.cultnet.fi> : configuration stuff |
- | Based on the MySQL code by: Zeev Suraski <bourbon@netvision.net.il> |
+ | Jouni Ahto <jah@mork.net> : configuration stuff |
+ | Based on the MySQL code by: Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
- */
+*/
+
+
/* -------------------------------------------------------------------
* if you want a function reference : "grep '^\*\*' ifx.ec" will give
* you a very short one
*
* ? cursory stored procedures
* Jouni Ahto promised help and already did the configuration stuff
- * (Jouni Ahto <jah@guru.cultnet.fi>).
+ * (Jouni Ahto <jah@mork.net>).
*
*/
(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)
+- 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)
Changes 14.9.1998 (chc@idgruppe.de)
- supports now IUS- serial8,int8,boolean, nchar, nvchar, lvarchar
- cursory and non-cursory stored procedures
Changes 24.10.1998 (chc@idgruppe.de)
-- changes the internal structure of IFX_BLOB and IFX_SLOB into one structure. it is now prepared for general-id-usage
+- changes the internal structure of IFX_BLOB and IFX_SLOB into one structure.
+ it is now prepared for general-id-usage.
- fixed a lvarchar-bug (i hate esql/c)
Changes 12.11.1998 (danny.heijl@cevi.be)
- added proto comments
+
+Changes 04/03/1999 (danny.heijl@cevi.be)
+- added "SET CONNECTION" statement to ifx_fetch_row() so that you can now
+ fetch rows from different databases simultaneously
+ (ifx_query() & ifx_prepare() were already OK).
+
+Changes 05/03/1999 (danny.heijl@cevi.be)
+- made all sqlerrd[] fields of sqlca structure available
+ with ifx_getsqlca($query_id) in a pseudo-row after a
+ prepare (select statements) or insert/update (non-select statements).
+ gives access to affected rows and serial insert values
+- made all internal functions static
+
+
+Changes 09/03/1999 (danny.heijl@cevi.be)
+- suppressed ESQL/C BLOB memory leak fix for ESQL/C 7.24 and higher
+ this is the same fix as in Perl DBD::Informix
+- really free an Ifx_Result now, do not wait for script termination
+- code cleanup
+
*/
#include "dl/phpdl.h"
#endif
+//
+// php 3.0
+//#if defined(THREAD_SAFE)
+//#include "tls.h"
+//DWORD InformixTls;
+//static int numthreads=0;
+//void *ifx_mutex;
+//#endif
+
#if WIN32|WINNT
#include <winsock.h>
#else
#include "build-defs.h"
#include "php_informix.h"
+
#if HAVE_IFX
+ /* local function prototypes */
+static long php3_intifx_getType(long id, HashTable *list);
+static long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list);
+static long php3_intifx_free_blob(long id, HashTable *list);
+static long php3_intifx2_free_blob(long id, HashTable *list);
+static long php3_intifx_get_blob(long bid, HashTable *list, char** content);
+static long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list);
+static loc_t *php3_intifx_get_blobloc(long bid, HashTable *list);
+static char* php3_intifx_create_tmpfile(long bid);
+static long php3_intifx_copy_blob(long bid, HashTable *list);
+static char* php3_intifx_null();
+static long php3_intifx_create_char(char* param, long len, HashTable *list);
+static long php3_intifx_free_char(long id, HashTable *list);
+static long php3_intifx_update_char(long bid, char* param, long len, HashTable *list);
+static long php3_intifx_get_char(long bid, HashTable *list, char** content);
+#if HAVE_IFX_IUS
+static long php3_intifxus_create_slob(long create_mode, HashTable *list);
+static long php3_intifxus_free_slob(long bid, HashTable *list);
+static long php3_intifxus_close_slob(long bid, HashTable *list);
+static long php3_intifxus_open_slob(long bid, long create_mode, HashTable *list);
+static long php3_intifxus_new_slob(HashTable *list);
+static ifx_lo_t *php3_intifxus_get_slobloc(long bid, HashTable *list);
+#endif
+
#ifndef CLIENT_SQLI_VER /* 7.10 on (at least) AIX is missing this */
#define CLIENT_SQLI_VER IFX_VERSION
#endif
{"ifx_htmltbl_result", php3_ifx_htmltbl_result, NULL},
{"ifx_fieldtypes", php3_ifx_fieldtypes, NULL},
{"ifx_fieldproperties",php3_ifx_fieldproperties, NULL},
+ {"ifx_getsqlca", php3_ifx_getsqlca, NULL},
{"ifx_create_blob", php3_ifx_create_blob, NULL},
{"ifx_free_blob", php3_ifx_free_blob, NULL},
&Informix_GLOBAL(php3_ifx_module).nullformat)==FAILURE) {
Informix_GLOBAL(php3_ifx_module).nullformat=0;
}
+
+ Informix_GLOBAL(php3_ifx_module).nullvalue = malloc(1);
+ Informix_GLOBAL(php3_ifx_module).nullvalue[0] = 0;
+ Informix_GLOBAL(php3_ifx_module).nullstring = malloc(5);
+ strcpy(Informix_GLOBAL(php3_ifx_module).nullstring, "NULL");
if (cfg_get_long("ifx.allow_persistent",
&Informix_GLOBAL(php3_ifx_module).allow_persistent)==FAILURE) {
** ----------------------------------------------------------------------
*/
-/* {{{ proto int ifx_(p)connect(string database,string userid,string password)
- connects to database using userid/password, returns connection id */
static void php3_ifx_do_connect(INTERNAL_FUNCTION_PARAMETERS,int persistent)
{
char *ifx;
EXEC SQL END DECLARE SECTION;
- char *tmp;
char *hashed_details;
int hashed_details_length;
Informix_TLS_VARS;
efree(hashed_details);
Informix_GLOBAL(php3_ifx_module).default_link=return_value->value.lval;
}
-/* }}} */
+/* {{{ proto int ifx_connect([string database[, string userid[, string password]]])
+ connects to database using userid/password, returns connection id */
PHP_FUNCTION(ifx_connect)
{
php3_ifx_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,0);
}
+/* }}} */
+/* {{{ proto int ifx_pconnect([string database[, string userid[, string password]]])
+ connects to database using userid/password, returns connection id */
PHP_FUNCTION(ifx_pconnect)
{
php3_ifx_do_connect(INTERNAL_FUNCTION_PARAM_PASSTHRU,1);
}
+/* }}} */
static int php3_ifx_get_default_link(INTERNAL_FUNCTION_PARAMETERS)
{
int locind;
int ctype;
int affected_rows;
+ long sqlerrd[6];
+ int e;
int query_type;
int cursoryproc;
ifx_error(ifx));
RETURN_FALSE;
}
+
affected_rows = sqlca.sqlerrd[0]; /* save estimated affected rows */
+ for (e = 0; e < 6; e++) sqlerrd[e] = sqlca.sqlerrd[e];
+
EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX 256;
if (ifx_check() < 0) {
Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
RETURN_FALSE;
}
Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */
+ for (e = 0; e < 6; e++) Ifx_Result->sqlerrd[e] = sqlca.sqlerrd[e];
} else {
/* ##
** SELECT-STATEMENT
- Ifx_Result->affected_rows = affected_rows; /* saved estimated */
+ Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */
+ for (e = 0; e < 6; e++) Ifx_Result->sqlerrd[e] = sqlerrd[e];
+
EXEC SQL GET DESCRIPTOR :descrpid :fieldcount = COUNT;
if (ifx_check() < 0) {
Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
char *statement; /* query text */
int fieldcount; /* field count */
int i; /* field index */
- short fieldtype;
loc_t *locator;
int loc_t_type=CLOCATORTYPE; /* WORKAROUND: TYPE=CLOCATORTYPE doesn't work, */
int sqlchar_type=SQLCHAR; /* don't ask me, why. */
char *char_tmp;
long len;
int indicator;
+ long sqlerrd[6];
+ int e;
$ifdef HAVE_IFX_IUS;
fixed binary 'blob' ifx_lo_t *slocator;
EXEC SQL END DECLARE SECTION;
- char *blobfilename;
- int locind;
int ctype;
int affected_rows;
int query_type;
RETURN_FALSE;
}
affected_rows = sqlca.sqlerrd[0]; /* save estimated affected rows */
+ for (e = 0; e < 6; e++) sqlerrd[e] = sqlca.sqlerrd[e];
EXEC SQL ALLOCATE DESCRIPTOR :descrpid WITH MAX 256;
if (ifx_check() < 0) {
Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
_php3_hash_move_forward(pblobidarr->value.ht);
} /* while */
} /* if paramquery */
- Ifx_Result->affected_rows = affected_rows; /* saved estimated */
+ Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */
+ for (e = 0; e < 6; e++) Ifx_Result->sqlerrd[e] = sqlerrd[e];
} else {
/* ##
** SELECT-STATEMENT
strcpy(Ifx_Result->cursorid, cursorid);
Ifx_Result->iscursory = 1;
- Ifx_Result->affected_rows = affected_rows; /* saved estimated */
+ Ifx_Result->affected_rows = affected_rows; /* saved estimated from prepare */
+ for (e = 0; e < 6; e++) Ifx_Result->sqlerrd[e] = sqlerrd[e];
EXEC SQL GET DESCRIPTOR :descrpid :fieldcount = COUNT;
if (ifx_check() < 0) {
Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
int i; /* field index */
short fieldtype;
loc_t *locator;
+
+ int e;
$ifdef HAVE_IFX_IUS;
fixed binary 'blob' ifx_lo_t *slocator;
int locind;
char *blobfilename;
- char *blobdir;
Informix_TLS_VARS;
descrpid = Ifx_Result->descrpid;
fieldcount = Ifx_Result->numcols;
+ EXEC SQL set connection :ifx;
+ if (ifx_check() < 0) {
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
+ php3_error(E_WARNING,"Set connection %s fails (%s)",
+ ifx,
+ ifx_error(ifx));
+ RETURN_FALSE;
+ }
if (Ifx_Result->iscursory < 0) {
php3_error(E_WARNING, "Resultindex %d is not a prepared query",
RETURN_FALSE;
}
Ifx_Result->affected_rows = sqlca.sqlerrd[2]; /* really affected */
+ for (e = 0; e < 6; e++) Ifx_Result->sqlerrd[e] = sqlca.sqlerrd[e];
} else { /* open cursor */
if (Ifx_Result->isscroll)
if (Ifx_Result->ishold)
PHP_FUNCTION(ifx_error)
{
pval *ifx_link;
- int id,type;
- IFX *ifx;
+ int id;
Informix_TLS_VARS;
break;
}
-/* connection id is no longer checked
-* ifx = (IFX *) php3_list_find(id,&type);
-* if (type!=Informix_GLOBAL(php3_ifx_module).le_link
-* && type!=Informix_GLOBAL(php3_ifx_module).le_plink) {
-* php3_error(E_WARNING,
-* "ifx_error : %d (type %d) is not an Informix link index",
-* id,
-* type);
-* }
-*/
RETURN_STRING(ifx_error(0),0); /* ifx_error returns emalloced string */
}
/* }}} */
** ----------------------------------------------------------------------
*/
-/* {{{ array ifx_fetch_row(int resultid, [mixed position])
+/* {{{ proto array ifx_fetch_row(int resultid, [mixed position])
fetches the next row or <position> row if using a scroll cursor */
PHP_FUNCTION(ifx_fetch_row)
{
char *cursorid; /* query cursor id */
char *statemid; /* statement id */
char *descrpid; /* descriptor id */
- char *statement; /* query text */
int fieldcount; /* field count */
int i; /* an index */
char fieldname[64]; /* fieldname */
- char ifx_bug; /* pad for ifx bug */
short fieldtype; /* field type */
int fieldleng; /* field length */
- int field_ind; /* the field index */
- char *field; /* the field data */
$ifdef HAVE_IFX_IUS;
ifx_int8_t int8_var;
datetime dt_data = {0};
decimal dec_data = {0};
short short_data;
- loc_t *locator, *locator_b;
+ loc_t *locator_b;
$ifdef HAVE_IFX_IUS;
fixed binary 'blob' ifx_lo_t *slocator;
char string_data[256];
long long_data;
char *p;
- FILE *fp;
char *blobfilename;
char *fetch_pos;
descrpid = Ifx_Result->descrpid;
fieldcount = Ifx_Result->numcols;
+ EXEC SQL set connection :ifx;
+ if (ifx_check() < 0) {
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
+ php3_error(E_WARNING,"Set connection %s fails (%s)",
+ ifx,
+ ifx_error(ifx));
+ RETURN_FALSE;
+ }
+
+
if (! Ifx_Result->isscroll) {
EXEC SQL FETCH :cursorid USING SQL DESCRIPTOR :descrpid;
} else {
continue;
}
- efree(nullstr);
}
/* }}} */
char *cursorid; /* query cursor id */
char *statemid; /* statement id */
char *descrpid; /* descriptor id */
- char *statement; /* query text */
int fieldcount; /* field count */
int i; /* an index */
char fieldname[64]; /* fieldname */
short fieldtype; /* field type */
- int field_ind; /* the field index */
int fieldleng; /* field length */
- char *field; /* the field */
$ifdef HAVE_IFX_IUS;
ifx_int8_t int8_var;
long long_data;
char *p;
int locind,bid_b;
- FILE *fp;
- char *blobfilename;
- char *blobdir;
char *table_options;
int moredata;
- int bid;
-
+
Informix_TLS_VARS;
switch (ARG_COUNT(ht)) {
descrpid = Ifx_Result->descrpid;
fieldcount = Ifx_Result->numcols;
+ EXEC SQL set connection :ifx;
+ if (ifx_check() < 0) {
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
+ php3_error(E_WARNING,"Set connection %s fails (%s)",
+ ifx,
+ ifx_error(ifx));
+ RETURN_FALSE;
+ }
+
+
/* try to fetch the first row */
EXEC SQL FETCH :cursorid USING SQL DESCRIPTOR :descrpid;
switch (ifx_check()) {
} /* endwhile (moredata); */
php3_printf("</table>\n");
- efree(nullstr);
RETURN_LONG(Ifx_Result->rowid);
}
char *cursorid; /* query cursor id */
char *statemid; /* statement id */
char *descrpid; /* descriptor id */
- char *statement; /* query text */
int fieldcount; /* field count */
int i; /* an index */
char fieldname[64]; /* fieldname */
short fieldtype; /* field type */
- int field_ind; /* the field index */
- int fieldleng; /* field length */
- char *field; /* the field */
- short indicator;
- int int_data;
char *char_data = NULL;
- long date_data;
- interval intvl_data = {0};
- datetime dt_data = {0};
- decimal dec_data = {0};
- short short_data;
- float float_data;
- double double_data;
- loc_t *locator;
+
EXEC SQL END DECLARE SECTION;
int type;
int num_fields;
- char string_data[256];
- long long_data;
char *p;
- int locind;
- FILE *fp;
- char *blobfilename;
- char *blobdir;
char *table_options;
- int moredata;
Informix_TLS_VARS;
descrpid = Ifx_Result->descrpid;
fieldcount = Ifx_Result->numcols;
+ EXEC SQL set connection :ifx;
+ if (ifx_check() < 0) {
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
+ php3_error(E_WARNING,"Set connection %s fails (%s)",
+ ifx,
+ ifx_error(ifx));
+ RETURN_FALSE;
+ }
+
if (array_init(return_value)==FAILURE) {
RETURN_FALSE;
}
char *cursorid; /* query cursor id */
char *statemid; /* statement id */
char *descrpid; /* descriptor id */
- char *statement; /* query text */
int fieldcount; /* field count */
int i; /* an index */
char fieldname[64]; /* fieldname */
short fieldtype; /* field type */
- int field_ind; /* the field index */
- int fieldleng; /* field length */
- char *field; /* the field */
-
- short indicator;
- int int_data;
char *char_data = NULL;
- long date_data;
- interval intvl_data = {0};
- datetime dt_data = {0};
- decimal dec_data = {0};
- short short_data;
- float float_data;
- double double_data;
- loc_t *locator;
int size;
int precision;
int scale;
int num_fields;
char string_data[256];
- long long_data;
char *p;
- int locind;
- FILE *fp;
- char *blobfilename;
- char *blobdir;
char *table_options;
- int moredata;
Informix_TLS_VARS;
descrpid = Ifx_Result->descrpid;
fieldcount = Ifx_Result->numcols;
+ EXEC SQL set connection :ifx;
+ if (ifx_check() < 0) {
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
+ php3_error(E_WARNING,"Set connection %s fails (%s)",
+ ifx,
+ ifx_error(ifx));
+ RETURN_FALSE;
+ }
+
+
if (array_init(return_value)==FAILURE) {
RETURN_FALSE;
}
}
/* }}} */
+
+/* --------------------------------------------------------------
+** int ifx_getsqlca(int $resultid)
+**
+** returns the sqlerrd[] fields of the sqlca struct for query $resultid
+** following the prepare (select) or execute immediate (insert/update/execute procedure)
+**
+** ---------------------------------------------------------------
+*/
+
+/* {{{ proto int ifx_getsqlca(int $resultid)
+ returns the sqlerrd[] fields of the sqlca struct for query $resultid */
+PHP_FUNCTION(ifx_getsqlca)
+{
+ pval *result;
+ IFX_RES *Ifx_Result;
+
+ int type;
+ char fieldname[16];
+ int e;
+
+ Informix_TLS_VARS;
+
+ if (ARG_COUNT(ht)!=1 || getParameters(ht, 1, &result)==FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = 0;
+
+ convert_to_long(result);
+ Ifx_Result = (IFX_RES *) php3_list_find(result->value.lval,&type);
+
+ if (type!=Informix_GLOBAL(php3_ifx_module).le_result) {
+ php3_error(E_WARNING,"%d is not a Informix result index",
+ result->value.lval);
+ RETURN_FALSE;
+ }
+
+ /* create pseudo-row array to return */
+ if (array_init(return_value)==FAILURE) {
+ RETURN_FALSE;
+ }
+ /* fill array with 6 fields sqlerrd0 .. sqlerrd5 */
+ /* each ESQLC call saves these sqlca values */
+ for (e = 0; e < 6; e++) {
+ sprintf(fieldname,"sqlerrd%d", e);
+ add_assoc_long(return_value, fieldname, Ifx_Result->sqlerrd[e]);
+ }
+
+}
+/* }}} */
+
+
+
/* ----------------------------------------------------------------------
** int ifx_num_fields(int $resultid)
**
}
}
+ ifx = Ifx_Result->connecid;
cursorid = Ifx_Result->cursorid;
statemid = Ifx_Result->statemid;
descrpid = Ifx_Result->descrpid;
+ EXEC SQL set connection :ifx;
+ if (ifx_check() < 0) {
+ Informix_GLOBAL(php3_ifx_module).sv_sqlcode = SQLCODE;
+ php3_error(E_WARNING,"Set connection %s fails (%s)",
+ ifx,
+ ifx_error(ifx));
+ RETURN_FALSE;
+ }
+
+
EXEC SQL free :statemid;
if (strlen(cursorid) != 0) {
EXEC SQL CLOSE :cursorid;
EXEC SQL DEALLOCATE DESCRIPTOR :descrpid;
+ efree(Ifx_Result); /* this can be safely done now */
+
php3_list_delete(result->value.lval);
RETURN_TRUE;
}
* return -1 on error otherwise the type: TYPE_BLTEXT, TYPE_BLBYTE, TYPE_SLOB
* ----------------------------------------------------------------------
*/
-long php3_intifx_getType(long id, HashTable *list) {
+static long php3_intifx_getType(long id, HashTable *list) {
IFX_IDRES *Ifx_res;
int type;
* 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) {
+static long php3_intifx_create_blob(long type, long mode, char* param, long len, HashTable *list) {
IFX_IDRES *Ifx_blob;
* return -1 on error otherwise the new Blob-Object-id
* ----------------------------------------------------------------------
*/
-long php3_intifx_copy_blob(long bid, HashTable *list) {
+static long php3_intifx_copy_blob(long bid, HashTable *list) {
IFX_IDRES *Ifx_blob, *Ifx_blob_orig;
loc_t *locator, *locator_orig;
int type;
* FREES BYTE-MEMORY WITH EFREE()
* ----------------------------------------------------------------------
*/
-long php3_intifx_free_blob(long bid, HashTable *list) {
+static long php3_intifx_free_blob(long bid, HashTable *list) {
IFX_IDRES *Ifx_blob;
int type;
* use this for freeing blob-source after select (in ifx_free_result)
* ----------------------------------------------------------------------
*/
-long php3_intifx2_free_blob(long bid, HashTable *list) {
+static long php3_intifx2_free_blob(long bid, HashTable *list) {
IFX_IDRES *Ifx_blob;
int type;
bid);
return -1;
}
+#if IFX_VERSION < 724 /* this Informix memory leak is fixed from 7.24 on */
+ /* according to the current PERL DBD::Informix */
+ /* and otherwise I get segmenation violations with 7.30 */
+
if(Ifx_blob->BLOB.mode==BLMODE_INMEM) {
if(Ifx_blob->BLOB.blob_data.loc_buffer==NULL ||
Ifx_blob->BLOB.blob_data.loc_size<=0) {;} else {
efree(Ifx_blob->BLOB.blob_data.loc_fname);
}
}
-
+
+#endif
+
php3_list_delete(bid);
efree(Ifx_blob);
return 0;
* 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) {
+static long php3_intifx_get_blob(long bid, HashTable *list, char** content) {
IFX_IDRES *Ifx_blob;
int type;
* return NULL on error or the pointer to the locator-structur
* ----------------------------------------------------------------------
*/
-loc_t *php3_intifx_get_blobloc(long bid, HashTable *list) {
+static loc_t *php3_intifx_get_blobloc(long bid, HashTable *list) {
IFX_IDRES *Ifx_blob;
int type;
** ----------------------------------------------------------------------
*/
-/* {{{ proto int update_blob(int bid, string content)
+/* {{{ proto int ifx_update_blob(int bid, string content)
updates the content of the blob-object */
PHP_FUNCTION(ifx_update_blob) {
pval *pbid,*pparam;
* return nothing
* ----------------------------------------------------------------------
*/
-long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list) {
+static long php3_intifx_update_blob(long bid, char* param, long len, HashTable *list) {
IFX_IDRES *Ifx_blob;
int type;
*/
-char* php3_intifx_create_tmpfile(long bid) {
+static char* php3_intifx_create_tmpfile(long bid) {
char filename[10];
char *blobdir;
char *blobfile;
* return "" or "NULL"
* ----------------------------------------------------------------------
*/
-char* php3_intifx_null() {
+static char* php3_intifx_null() {
char* tmp;
if(Informix_GLOBAL(php3_ifx_module).nullformat==0) {
- tmp=emalloc(1);
- tmp[0]=0;
+ tmp=Informix_GLOBAL(php3_ifx_module).nullvalue;
} else {
- tmp=emalloc(5);
- strcpy(tmp,"NULL");
+ tmp=Informix_GLOBAL(php3_ifx_module).nullstring;
}
return tmp;
}
* return -1 on error otherwise the new char-Object-id
* ----------------------------------------------------------------------
*/
-long php3_intifx_create_char(char* param, long len, HashTable *list) {
+static long php3_intifx_create_char(char* param, long len, HashTable *list) {
IFX_IDRES *Ifx_char;
* returns the pointer to the content in char** content and the amount of content in bytes
* ----------------------------------------------------------------------
*/
-long php3_intifx_get_char(long bid, HashTable *list, char** content) {
+static long php3_intifx_get_char(long bid, HashTable *list, char** content) {
IFX_IDRES *Ifx_char;
int type;
* return -1 on error otherwise 0
* ----------------------------------------------------------------------
*/
-long php3_intifx_free_char(long bid, HashTable *list) {
+static long php3_intifx_free_char(long bid, HashTable *list) {
IFX_IDRES *Ifx_char;
int type;
* return nothing
* ----------------------------------------------------------------------
*/
-long php3_intifx_update_char(long bid, char* param, long len, HashTable *list) {
+static long php3_intifx_update_char(long bid, char* param, long len, HashTable *list) {
IFX_IDRES *Ifx_char;
int type;
* return -1 on error otherwise the new Blob-Object-id
* ----------------------------------------------------------------------
*/
-long php3_intifxus_create_slob(long create_mode, HashTable *list) {
+static long php3_intifxus_create_slob(long create_mode, HashTable *list) {
IFX_IDRES *Ifx_slob;
int errcode;
* return -1 on error otherwise 0
* ----------------------------------------------------------------------
*/
-long php3_intifxus_free_slob(long bid, HashTable *list) {
+static long php3_intifxus_free_slob(long bid, HashTable *list) {
IFX_IDRES *Ifx_slob;
int type;
* return -1 on error otherwise 0
* ----------------------------------------------------------------------
*/
-long php3_intifxus_close_slob(long bid, HashTable *list) {
+static long php3_intifxus_close_slob(long bid, HashTable *list) {
IFX_IDRES *Ifx_slob;
int type;
* return -1 on error otherwise the new Blob-Object-id
* ----------------------------------------------------------------------
*/
-long php3_intifxus_open_slob(long bid, long create_mode, HashTable *list) {
+static long php3_intifxus_open_slob(long bid, long create_mode, HashTable *list) {
IFX_IDRES *Ifx_slob;
int errcode;
int type;
* return -1 on error otherwise the new slob-Object-id
* ----------------------------------------------------------------------
*/
-long php3_intifxus_new_slob(HashTable *list) {
+static long php3_intifxus_new_slob(HashTable *list) {
IFX_IDRES *Ifx_slob;
int errcode;
* return -1 on error otherwise the new Blob-Object-id
* ----------------------------------------------------------------------
*/
-ifx_lo_t *php3_intifxus_get_slobloc(long bid, HashTable *list) {
+static ifx_lo_t *php3_intifxus_get_slobloc(long bid, HashTable *list) {
IFX_IDRES *Ifx_slob;
int errcode, type;