1999-05-01 02:59:15 +08:00
|
|
|
/* $Id$ */
|
1999-04-22 06:49:16 +08:00
|
|
|
|
1999-06-29 23:16:38 +08:00
|
|
|
/* synced with oracle.h,v 1.40 1999/06/01 08:11:04 thies Exp $ */
|
|
|
|
|
1999-12-05 03:19:57 +08:00
|
|
|
#ifndef _PHP_ORACLE_H
|
|
|
|
#define _PHP_ORACLE_H
|
1999-04-22 06:49:16 +08:00
|
|
|
|
|
|
|
#if HAVE_ORACLE
|
|
|
|
|
|
|
|
#if (defined(__osf__) && defined(__alpha))
|
|
|
|
# ifndef A_OSF
|
|
|
|
# define A_OSF
|
|
|
|
# endif
|
|
|
|
# ifndef OSF1
|
|
|
|
# define OSF1
|
|
|
|
# endif
|
|
|
|
# ifndef _INTRINSICS
|
|
|
|
# define _INTRINSICS
|
|
|
|
# endif
|
|
|
|
#endif /* osf alpha */
|
|
|
|
|
|
|
|
#include "oratypes.h"
|
|
|
|
#include "ocidfn.h"
|
|
|
|
#ifdef __STDC__
|
|
|
|
#include "ociapr.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
extern php3_module_entry oracle_module_entry;
|
1999-05-12 21:44:09 +08:00
|
|
|
#define phpext_oracle_ptr &oracle_module_entry
|
1999-04-22 06:49:16 +08:00
|
|
|
|
1999-08-17 22:40:28 +08:00
|
|
|
#ifdef ZTS
|
|
|
|
#define ORALS_D php_ora_globals *ora_globals
|
1999-12-09 19:02:41 +08:00
|
|
|
#define ORALS_DC , ORACLE_D
|
1999-08-17 22:40:28 +08:00
|
|
|
#define ORALS_C ora_globals
|
|
|
|
#define ORALS_CC , ORALS_C
|
|
|
|
#define ORA(v) (ora_globals->v)
|
|
|
|
#define ORALS_FETCH() php_ora_globals *ora_globals = ts_resource(ora_globals_id)
|
|
|
|
#else
|
|
|
|
#define ORALS_D
|
|
|
|
#define ORALS_DC
|
|
|
|
#define ORALS_C
|
|
|
|
#define ORALS_CC
|
|
|
|
#define ORA(v) (ora_globals.v)
|
|
|
|
#define ORALS_FETCH()
|
|
|
|
#endif
|
|
|
|
|
1999-04-22 06:49:16 +08:00
|
|
|
/* oparse flags */
|
|
|
|
#define DEFER_PARSE 1
|
|
|
|
#define NATIVE 1
|
|
|
|
#define VERSION_7 2
|
|
|
|
|
|
|
|
#define ORANUMWIDTH 38
|
|
|
|
|
|
|
|
#if (defined(__osf__) && defined(__alpha)) || defined(CRAY) || defined(KSR)
|
|
|
|
#define HDA_SIZE 512
|
|
|
|
#else
|
|
|
|
#define HDA_SIZE 256
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define ORAUIDLEN 32
|
|
|
|
#define ORAPWLEN 32
|
|
|
|
#define ORANAMELEN 32
|
|
|
|
#define ORABUFLEN 2000
|
|
|
|
|
|
|
|
/* Some Oracle error codes */
|
|
|
|
#define VAR_NOT_IN_LIST 1007
|
|
|
|
#define NO_DATA_FOUND 1403
|
|
|
|
#define NULL_VALUE_RETURNED 1405
|
|
|
|
|
1999-08-17 22:40:28 +08:00
|
|
|
/* Some SQL and ORA function codes */
|
1999-04-22 06:49:16 +08:00
|
|
|
#define FT_INSERT 3
|
|
|
|
#define FT_SELECT 4
|
|
|
|
#define FT_UPDATE 5
|
|
|
|
#define FT_DELETE 9
|
|
|
|
|
|
|
|
#define FC_OOPEN 14
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
int open;
|
1999-09-23 17:15:38 +08:00
|
|
|
int persistent;
|
1999-04-22 06:49:16 +08:00
|
|
|
Lda_Def lda;
|
|
|
|
ub1 hda[HDA_SIZE];
|
|
|
|
} oraConnection;
|
|
|
|
|
|
|
|
typedef struct oraColumn {
|
|
|
|
sb4 dbsize;
|
|
|
|
sb2 dbtype;
|
|
|
|
text cbuf[ORANAMELEN+1];
|
|
|
|
sb4 cbufl;
|
|
|
|
sb4 dsize;
|
|
|
|
sb2 prec;
|
|
|
|
sb2 scale;
|
|
|
|
sb2 nullok;
|
|
|
|
ub1 *buf;
|
|
|
|
sb2 indp;
|
|
|
|
ub2 col_retlen, col_retcode;
|
|
|
|
} oraColumn;
|
|
|
|
|
|
|
|
typedef struct oraParam {
|
|
|
|
text *progv;
|
|
|
|
sword progvl;
|
1999-05-01 02:59:15 +08:00
|
|
|
sb2 inout;
|
1999-04-22 06:49:16 +08:00
|
|
|
ub2 alen;
|
|
|
|
} oraParam;
|
|
|
|
|
|
|
|
typedef struct oraCursor {
|
|
|
|
int open;
|
|
|
|
Cda_Def cda;
|
|
|
|
text *query;
|
|
|
|
HashTable *params;
|
|
|
|
int nparams;
|
|
|
|
oraColumn *columns;
|
|
|
|
int ncols;
|
|
|
|
int fetched;
|
|
|
|
oraConnection *conn_ptr;
|
1999-06-29 23:16:38 +08:00
|
|
|
int conn_id;
|
1999-04-22 06:49:16 +08:00
|
|
|
} oraCursor;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
char *defDB;
|
|
|
|
char *defUser;
|
|
|
|
char *defPW;
|
|
|
|
long allow_persistent;
|
|
|
|
long max_persistent;
|
|
|
|
long max_links;
|
|
|
|
long num_persistent;
|
|
|
|
long num_links;
|
1999-06-29 23:16:38 +08:00
|
|
|
HashTable *conns;
|
1999-08-17 22:40:28 +08:00
|
|
|
} php_ora_globals;
|
1999-04-22 06:49:16 +08:00
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define oracle_module_ptr NULL
|
|
|
|
|
|
|
|
#endif /* HAVE_ORACLE */
|
|
|
|
|
1999-12-05 03:19:57 +08:00
|
|
|
#endif /* _PHP_ORACLE_H */
|
1999-04-22 06:49:16 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local Variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* End:
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|