📄 ocilib_defs.h
字号:
/*
+----------------------------------------------------------------------+
| |
| OCILIB - C Driver for Oracle |
| |
| (C Wrapper for Oracle OCI) |
| |
+----------------------------------------------------------------------+
| Website : http://ocilib.net |
+----------------------------------------------------------------------+
| Copyright (c) 2007-2009 Vincent ROGIER |
+----------------------------------------------------------------------+
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Library General Public |
| License as published by the Free Software Foundation; either |
| version 2 of the License, or (at your option) any later version. |
| |
| This library is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| Library General Public License for more details. |
| |
| You should have received a copy of the GNU Library General Public |
| License along with this library; if not, write to the Free |
| Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
+----------------------------------------------------------------------+
| Author: Vincent ROGIER <vince.rogier@gmail.com> |
+----------------------------------------------------------------------+
*/
/* ------------------------------------------------------------------------ *
* $Id: ocilib_defs.h, v 3.2.0 2009/04/20 00:00 Vince $
* ------------------------------------------------------------------------ */
#ifndef OCILIB_OCILIB_DEFS_H_INCLUDED
#define OCILIB_OCILIB_DEFS_H_INCLUDED
#include "ocilib.h"
#include "oci_import.h"
/* ************************************************************************ *
ORACLE VERSION DETECTION
* ************************************************************************ */
#ifdef OCI_IMPORT_RUNTIME
/* for runtime loading, set compile time version to the highest minimum
version needed by OCILIB encapsulation of OCI */
#define OCI_VERSION_COMPILE OCI_11
/* set runtime version to unknown, it will be guessed from symbols loading */
#define OCI_VERSION_RUNTIME OCI_UNKNOWN
#else
/* oracle 10g introduced in oci.h this constant, so it means >= 10g */
#ifdef OCI_MAJOR_VERSION
#define OCI_VERSION_COMPILE OCI_MAJOR_VERSION
#define OCI_VERSION_RUNTIME OCI_MAJOR_VERSION
#elif defined(SQLT_PNTY)
/* if version < 10g and if SQLT_PNTY is defined, it means 9i */
#define OCI_VERSION_COMPILE OCI_9
#define OCI_VERSION_RUNTIME OCI_9
#else
/* so it must be 8i */
#define OCI_VERSION_COMPILE OCI_8
#define OCI_VERSION_RUNTIME OCI_8
#endif
#endif
/* tries to enable Oracle 10g support for lobs > 4Go with OCILobxxx2() calls */
#if defined(OCI_BIG_UINT_ENABLED) && defined(ORAXB8_DEFINED)
#define OCI_LOB2_API_ENABLED
#endif
/* ************************************************************************ *
CHARSET AND STRING TYPES DETECTION
* ************************************************************************ */
/* mtext and dtext are public character types for meta and user string types
We need to handle as well internal string types because :
- wchar_t is not the same type on all platforms (that is such a pain !),
- OCI, in Unicode mode, uses Fixed length UTF16 encoding (2 bytes)
So, omtext and odtext were added to represent internal meta and user string
types.
The following checks find out the real types and sizes of omtext and odtext
*/
#ifdef OCI_CHARSET_ANSI
/* easy ! */
#define omtext mtext
#define odtext dtext
#else
#define WCHAR_2_BYTES 0xFFFF
#define WCHAR_4_BYTES 0x7FFFFFFF
/*
Actually, the only need to use string conversion is when using wchar_t
on unixes systems. This test will probably change in future releases to
handle internally UTF8, by example
*/
#if WCHAR_MAX == WCHAR_4_BYTES
/* so, input/output conversion will be needed */
#define OCI_CHECK_STRINGS
#endif
#ifdef OCI_METADATA_UNICODE
#ifdef OCI_CHECK_STRINGS
/* conversion for meta string needed */
#define OCI_CHECK_METASTRINGS
#endif
/* internal meta string type is UTF16 (2 bytes) */
#define omtext unsigned short
#else
/* internal meta string type is char */
#define omtext char
#endif
#ifdef OCI_USERDATA_UNICODE
#ifdef OCI_CHECK_STRINGS
/* conversion for data string needed */
#define OCI_CHECK_DATASTRINGS
#endif
/* internal data string type is UTF16 (2 bytes) */
#define odtext unsigned short
#else
/* internal data string type is char */
#define odtext char
#endif
#endif
/* ************************************************************************ *
INTERNAL CONSTANTS
* ************************************************************************ */
/* ------------------------------------------------------------------------ *
* DEfault environnement mode
* ------------------------------------------------------------------------ */
#ifdef OCI_METADATA_UNICODE
#define OCI_ENV_MODE OCI_UTF16
#else
#define OCI_ENV_MODE OCI_DEFAULT
#endif
/* ------------------------------------------------------------------------ *
* Internal Pointer Codes
* ------------------------------------------------------------------------ */
/* -- external C pointers ---- */
#define OCI_IPC_VOID 1
#define OCI_IPC_SHORT 2
#define OCI_IPC_INT 3
#define OCI_IPC_BIGINT 4
#define OCI_IPC_DOUBLE 5
#define OCI_IPC_STRING 6
#define OCI_IPC_PROC 7
/* -- external OCILIB handles - */
#define OCI_IPC_ERROR 8
#define OCI_IPC_TYPE_INFO 9
#define OCI_IPC_CONNECTION 10
#define OCI_IPC_CONNPOOL 11
#define OCI_IPC_TRANSACTION 12
#define OCI_IPC_STATEMENT 13
#define OCI_IPC_RESULTSET 14
#define OCI_IPC_COLUMN 15
#define OCI_IPC_DATE 16
#define OCI_IPC_TIMESTAMP 17
#define OCI_IPC_INTERVAL 18
#define OCI_IPC_LOB 19
#define OCI_IPC_FILE 20
#define OCI_IPC_LONG 21
#define OCI_IPC_OBJECT 22
#define OCI_IPC_COLLECTION 23
#define OCI_IPC_ITERATOR 24
#define OCI_IPC_ELEMENT 25
#define OCI_IPC_HASHTABLE 26
#define OCI_IPC_THREAD 27
#define OCI_IPC_MUTEX 28
#define OCI_IPC_BIND 29
#define OCI_IPC_REF 30
#define OCI_IPC_DIRPATH 31
/* ---- Internal pointers ----- */
#define OCI_IPC_LIST 32
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -