summaryrefslogtreecommitdiff
path: root/ext/informix/php_informix.h
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2001-07-30 10:09:53 +0000
committerfoobar <sniper@php.net>2001-07-30 10:09:53 +0000
commit381d4c3143fec394fef534804f3d5034ef7523c5 (patch)
treea9d1fed2e4fc05ee2704b9f469dc2284d9764ddd /ext/informix/php_informix.h
parent9f4c0ae6c09abf1defd5e44741c50c322dbc8f57 (diff)
downloadphp-git-381d4c3143fec394fef534804f3d5034ef7523c5.tar.gz
Make this extension compile thread safe on unixes too.
Also changed all those nice spaces to tabs # # Zeev, could you make those changes for this extension too? # # And yes, I know I shouldn't mix ws fixes to anything else but # this was easier to do this way.
Diffstat (limited to 'ext/informix/php_informix.h')
-rw-r--r--ext/informix/php_informix.h106
1 files changed, 40 insertions, 66 deletions
diff --git a/ext/informix/php_informix.h b/ext/informix/php_informix.h
index 78774eaba2..caf693684c 100644
--- a/ext/informix/php_informix.h
+++ b/ext/informix/php_informix.h
@@ -17,8 +17,9 @@
| Jouni Ahto <jouni.ahto@exdec.fi>, configuration stuff |
| based on mysql code by: Zeev Suraski <zeev@php.net> |
+----------------------------------------------------------------------+
- */
+*/
+/* $Id$ */
#ifndef PHP_INFORMIX_H
#define PHP_INFORMIX_H
@@ -29,7 +30,6 @@
#define PHP_IFX_API
#endif
-
#if HAVE_IFX /* with Informix */
#ifndef DLEXPORT
@@ -99,7 +99,7 @@ PHP_FUNCTION(ifxus_seek_slob);
PHP_FUNCTION(ifxus_tell_slob);
#endif
-typedef struct {
+ZEND_BEGIN_MODULE_GLOBALS(ifx)
long default_link;
long num_links,num_persistent;
long max_links,max_persistent;
@@ -107,37 +107,23 @@ typedef struct {
char *default_host, *default_user, *default_password;
int connectionid;
int cursorid;
- int sv_sqlcode; /* saved informix SQLCODE value */
- 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 charasvarchar; /* 0=don't strip trailing blanks, 1=strip */
- long nullformat; /* 0=NULL as "", 1= NULL as "NULL" */
- char *nullvalue; /* "" */
- char *nullstring; /* "NULL" */
-} php_ifx_globals; /* formerly "ifx_module" in the php3 version */
-
-typedef struct {
- int le_result;
- int le_link;
- int le_plink;
- int le_idresult;
-} php_ifx_listids;
-
-#define IFXL(v) (ifx_listids.v)
-
-#ifndef ZTS
-extern php_ifx_globals ifx_globals;
-#endif
+ int sv_sqlcode; /* saved informix SQLCODE value */
+ 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 charasvarchar; /* 0=don't strip trailing blanks, 1=strip */
+ long nullformat; /* 0=NULL as "", 1= NULL as "NULL" */
+ char nullvalue[1]; /* "" */
+ char nullstring[5]; /* "NULL" */
+ZEND_END_MODULE_GLOBALS(ifx)
#ifdef ZTS
-# define IFXLS_D php_ifx_globals *ifx_globals
+# define IFXLS_D zend_ifx_globals *ifx_globals
# define IFXLS_DC , IFXLS_D
# define IFXLS_C ifx_globals
# define IFXLS_CC , IFXLS_C
# define IFXG(v) (ifx_globals->v)
-# define IFXLS_FETCH() php_ifx_globals *ifx_globals = ts_resource(ifx_globals_id)
-# define IFX_TLS_VARS char *globals; IFXLS_FETCH(); globals = (char *)ifx_globals;
+# define IFXLS_FETCH() zend_ifx_globals *ifx_globals = ts_resource(ifx_globals_id)
#else
# define IFXLS_D
# define IFXLS_DC
@@ -145,11 +131,8 @@ extern php_ifx_globals ifx_globals;
# define IFXLS_CC
# define IFXG(v) (ifx_globals.v)
# define IFXLS_FETCH()
-# define IFX_TLS_VARS char *globals = (char *)&ifx_globals
-extern ZEND_API php_ifx_globals ifx_globals;
#endif
-
#define MAX_RESID 64
#define BLOBINFILE 0 /* 0=in memory, 1=in file */
@@ -159,44 +142,40 @@ typedef struct ifx_res {
char cursorid[16];
char descrpid[16];
char statemid[16];
- int isscroll;
- int ishold;
- int iscursory;
- int paramquery;
+ int isscroll;
+ int ishold;
+ int iscursory;
+ int paramquery;
int numcols;
int rowid;
- int affected_rows;
- long sqlerrd[6];
- int res_id[MAX_RESID];
+ int affected_rows;
+ long sqlerrd[6];
+ int res_id[MAX_RESID];
} IFX_RES;
-
-
-
-
typedef struct _IFX_IDRES {
- int type;
- union {
- struct {
- int mode;
- loc_t blob_data;
- } BLOBRES;
- struct {
- char *char_data;
- int len;
- } CHARRES;
+ int type;
+ union {
+ struct {
+ int mode;
+ loc_t blob_data;
+ } BLOBRES;
+
+ struct {
+ char *char_data;
+ int len;
+ } CHARRES;
+
#if HAVE_IFX_IUS
- struct {
- ifx_lo_t slob_data;
- ifx_lo_create_spec_t *createspec;
- int lofd;
- } SLOBRES;
+ struct {
+ ifx_lo_t slob_data;
+ ifx_lo_create_spec_t *createspec;
+ int lofd;
+ } SLOBRES;
#endif
- } DATARES;
+ } DATARES;
} IFX_IDRES;
-
-
#define BLOB DATARES.BLOBRES
#define CHAR DATARES.CHARRES
@@ -204,13 +183,8 @@ typedef struct _IFX_IDRES {
#define SLOB DATARES.SLOBRES
#endif
-
-#else /* not HAVE_IFX */
-
+#else /* not HAVE_IFX */
#define ifx_module_ptr NULL
-
#endif
-
#define phpext_informix_ptr ifx_module_ptr
-
#endif /* PHP_INFORMIX_H */