php-src/ext/oci8/php_oci8.h

221 lines
4.5 KiB
C
Raw Normal View History

1999-04-21 22:49:16 +00:00
/*
+----------------------------------------------------------------------+
| PHP version 4.0 |
1999-04-21 22:49:16 +00:00
+----------------------------------------------------------------------+
2001-02-26 06:11:02 +00:00
| Copyright (c) 1997-2001 The PHP Group |
1999-04-21 22:49:16 +00:00
+----------------------------------------------------------------------+
| This source file is subject to version 2.02 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available at through the world-wide-web at |
| http://www.php.net/license/2_02.txt. |
| If you did not receive a copy of the PHP license and are unable to |
| obtain it through the world-wide-web, please send a note to |
| license@php.net so we can mail you a copy immediately. |
1999-04-21 22:49:16 +00:00
+----------------------------------------------------------------------+
| Authors: Stig S<EFBFBD>ther Bakken <ssb@fast.no> |
2000-10-29 09:14:55 +00:00
| Thies C. Arntzen <thies@thieso.net> |
1999-04-21 22:49:16 +00:00
+----------------------------------------------------------------------+
*/
1999-04-21 22:49:16 +00:00
/* $Id$ */
1999-04-21 22:49:16 +00:00
#if HAVE_OCI8
# ifndef PHP_OCI8_H
# define PHP_OCI8_H
1999-04-21 22:49:16 +00:00
# endif
# 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 */
#ifdef PHP_WIN32
1999-08-17 13:54:25 +00:00
#define PHP_OCI_API __declspec(dllexport)
#else
#define PHP_OCI_API
#endif
2001-05-28 00:16:28 +00:00
#if defined(min)
#undef min
#endif
#if defined(max)
#undef max
#endif
#include <oci.h>
1999-04-21 22:49:16 +00:00
typedef struct {
int num;
1999-04-21 22:49:16 +00:00
int persistent;
2001-05-04 14:53:45 +00:00
int is_open;
1999-05-12 14:28:01 +00:00
char *dbname;
1999-04-21 22:49:16 +00:00
OCIServer *pServer;
#if 0
OCIFocbkStruct failover;
#endif
1999-08-17 13:54:25 +00:00
} oci_server;
1999-04-21 22:49:16 +00:00
typedef struct {
int num;
1999-04-21 22:49:16 +00:00
int persistent;
2001-05-04 14:53:45 +00:00
int is_open;
int exclusive;
char *hashed_details;
1999-08-17 13:54:25 +00:00
oci_server *server;
1999-04-21 22:49:16 +00:00
OCISession *pSession;
1999-08-17 13:54:25 +00:00
} oci_session;
1999-04-21 22:49:16 +00:00
typedef struct {
int id;
2001-05-04 14:53:45 +00:00
int is_open;
1999-08-17 13:54:25 +00:00
oci_session *session;
1999-04-21 22:49:16 +00:00
OCISvcCtx *pServiceContext;
1999-05-12 14:28:01 +00:00
sword error;
1999-04-21 22:49:16 +00:00
OCIError *pError;
1999-08-17 13:54:25 +00:00
} oci_connection;
1999-04-21 22:49:16 +00:00
typedef struct {
int id;
oci_connection *conn;
1999-04-21 22:49:16 +00:00
dvoid *ocidescr;
ub4 type;
1999-08-17 13:54:25 +00:00
} oci_descriptor;
1999-04-21 22:49:16 +00:00
typedef struct {
int id;
oci_connection *conn;
OCIType *tdo;
OCITypeCode coll_typecode;
OCIRef *elem_ref;
OCIType *element_type;
OCITypeCode element_typecode;
OCIColl *coll;
} oci_collection;
1999-04-21 22:49:16 +00:00
typedef struct {
zval *zval;
1999-04-21 22:49:16 +00:00
text *name;
ub4 name_len;
ub4 type;
1999-08-17 13:54:25 +00:00
} oci_define;
1999-04-21 22:49:16 +00:00
typedef struct {
int id;
1999-08-17 13:54:25 +00:00
oci_connection *conn;
1999-05-12 14:28:01 +00:00
sword error;
1999-04-21 22:49:16 +00:00
OCIError *pError;
OCIStmt *pStmt;
1999-05-12 14:28:01 +00:00
char *last_query;
1999-04-21 22:49:16 +00:00
HashTable *columns;
HashTable *binds;
HashTable *defines;
int ncolumns;
1999-04-21 22:49:16 +00:00
int executed;
1999-08-17 13:54:25 +00:00
} oci_statement;
1999-04-21 22:49:16 +00:00
typedef struct {
OCIBind *pBind;
zval *zval;
1999-04-21 22:49:16 +00:00
dvoid *descr; /* used for binding of LOBS etc */
1999-05-12 14:28:01 +00:00
OCIStmt *pStmt; /* used for binding REFCURSORs */
1999-04-21 22:49:16 +00:00
sb2 indicator;
ub2 retcode;
1999-08-17 13:54:25 +00:00
} oci_bind;
1999-04-21 22:49:16 +00:00
typedef struct {
1999-08-17 13:54:25 +00:00
oci_statement *statement;
1999-04-21 22:49:16 +00:00
OCIDefine *pDefine;
char *name;
ub4 name_len;
1999-07-08 14:12:07 +00:00
ub2 data_type;
ub2 data_size;
1999-04-21 22:49:16 +00:00
ub4 storage_size4;
sb2 indicator;
ub2 retcode;
1999-07-08 14:12:07 +00:00
ub2 retlen;
ub4 retlen4;
1999-04-21 22:49:16 +00:00
ub2 is_descr;
1999-05-12 14:28:01 +00:00
ub2 is_cursor;
1999-04-21 22:49:16 +00:00
int descr;
1999-08-17 13:54:25 +00:00
oci_statement *pstmt;
1999-05-12 14:28:01 +00:00
int stmtid;
int descid;
1999-04-21 22:49:16 +00:00
void *data;
1999-08-17 13:54:25 +00:00
oci_define *define;
1999-06-09 10:40:08 +00:00
int piecewise;
ub4 cb_retlen;
ub2 scale;
ub2 precision;
1999-08-17 13:54:25 +00:00
} oci_out_column;
1999-04-21 22:49:16 +00:00
typedef struct {
1999-05-12 14:28:01 +00:00
sword error;
1999-04-21 22:49:16 +00:00
OCIError *pError;
/*
1999-04-21 22:49:16 +00:00
char *default_username;
char *default_password;
char *default_dbname;
*/
1999-04-21 22:49:16 +00:00
long debug_mode;
int shutdown;
/* XXX NYI
1999-04-21 22:49:16 +00:00
long allow_persistent;
long max_persistent;
long max_links;
long num_persistent;
long num_links;
*/
1999-04-21 22:49:16 +00:00
HashTable *server;
HashTable *user;
1999-04-21 22:49:16 +00:00
OCIEnv *pEnv;
1999-08-17 13:54:25 +00:00
} php_oci_globals;
1999-04-21 22:49:16 +00:00
extern zend_module_entry oci8_module_entry;
1999-05-12 16:12:22 +00:00
#define phpext_oci8_ptr &oci8_module_entry
1999-04-21 22:49:16 +00:00
1999-08-17 13:54:25 +00:00
#define OCI_MAX_NAME_LEN 64
#define OCI_MAX_DATA_SIZE INT_MAX
#define OCI_PIECE_SIZE (64*1024)-1
#ifdef ZTS
#define OCILS_D php_oci_globals *oci_globals
#define OCILS_DC , OCILS_D
1999-08-17 13:54:25 +00:00
#define OCILS_C oci_globals
#define OCILS_CC , OCILS_C
#define OCI(v) (oci_globals->v)
#define OCILS_FETCH() php_oci_globals *oci_globals = ts_resource(oci_globals_id)
#else
#define OCILS_D
#define OCILS_DC
#define OCILS_C
#define OCILS_CC
#define OCI(v) (oci_globals.v)
#define OCILS_FETCH()
#endif
1999-04-21 22:49:16 +00:00
#else /* !HAVE_OCI8 */
# define oci8_module_ptr NULL
#endif /* HAVE_OCI8 */
/*
* Local variables:
* tab-width: 4
* c-basic-offset: 4
* End:
*/