php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_pdo_odbc_int.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Copyright (c) The PHP Group |
4 +----------------------------------------------------------------------+
5 | This source file is subject to version 3.01 of the PHP license, |
6 | that is bundled with this package in the file LICENSE, and is |
7 | available through the world-wide-web at the following url: |
8 | https://www.php.net/license/3_01.txt |
9 | If you did not receive a copy of the PHP license and are unable to |
10 | obtain it through the world-wide-web, please send a note to |
11 | license@php.net so we can mail you a copy immediately. |
12 +----------------------------------------------------------------------+
13 | Author: Wez Furlong <wez@php.net> |
14 +----------------------------------------------------------------------+
15*/
16
17/* internal header; not supposed to be installed */
18
19#ifdef PHP_WIN32
20# define PDO_ODBC_TYPE "Win32"
21#endif
22
23#ifndef PDO_ODBC_TYPE
24# warning Please fix configure to give your ODBC libraries a name
25# define PDO_ODBC_TYPE "Unknown"
26#endif
27
28/* {{{ Roll a dice, pick a header at random... */
29#ifdef HAVE_SQLCLI1_H
30# include <sqlcli1.h>
31# if defined(DB268K) && HAVE_LIBRARYMANAGER_H
32# include <LibraryManager.h>
33# endif
34#endif
35
36#ifdef HAVE_ODBC_H
37# include <odbc.h>
38#endif
39
40#ifdef HAVE_IODBC_H
41# include <iodbc.h>
42#endif
43
44#if defined(HAVE_SQLUNIX_H) && !defined(PHP_WIN32)
45# include <sqlunix.h>
46#endif
47
48#ifdef HAVE_SQLTYPES_H
49# include <sqltypes.h>
50#endif
51
52#ifdef HAVE_SQLUCODE_H
53# include <sqlucode.h>
54#endif
55
56#ifdef HAVE_SQL_H
57# include <sql.h>
58#endif
59
60#ifdef HAVE_ISQL_H
61# include <isql.h>
62#endif
63
64#ifdef HAVE_SQLEXT_H
65# include <sqlext.h>
66#endif
67
68#ifdef HAVE_ISQLEXT_H
69# include <isqlext.h>
70#endif
71
72#ifdef HAVE_UDBCEXT_H
73# include <udbcext.h>
74#endif
75
76#ifdef HAVE_CLI0CORE_H
77# include <cli0core.h>
78#endif
79
80#ifdef HAVE_CLI0EXT1_H
81# include <cli0ext.h>
82#endif
83
84#ifdef HAVE_CLI0CLI_H
85# include <cli0cli.h>
86#endif
87
88#ifdef HAVE_CLI0DEFS_H
89# include <cli0defs.h>
90#endif
91
92#ifdef HAVE_CLI0ENV_H
93# include <cli0env.h>
94#endif
95
96/* }}} */
97
98/* {{{ Figure out the type for handles */
99#if !defined(HENV) && !defined(SQLHENV) && defined(SQLHANDLE)
100# define PDO_ODBC_HENV SQLHANDLE
101# define PDO_ODBC_HDBC SQLHANDLE
102# define PDO_ODBC_HSTMT SQLHANDLE
103#elif !defined(HENV) && (defined(SQLHENV) || defined(DB2CLI_VER))
104# define PDO_ODBC_HENV SQLHENV
105# define PDO_ODBC_HDBC SQLHDBC
106# define PDO_ODBC_HSTMT SQLHSTMT
107#else
108# define PDO_ODBC_HENV HENV
109# define PDO_ODBC_HDBC HDBC
110# define PDO_ODBC_HSTMT HSTMT
111#endif
112/* }}} */
113
114typedef struct {
115 char last_state[6];
116 char last_err_msg[SQL_MAX_MESSAGE_LENGTH];
117 SQLINTEGER last_error;
118 const char *file, *what;
119 int line;
121
129
130typedef struct {
131 char *data;
134 SQLSMALLINT coltype;
135 char colname[128];
136 unsigned is_long;
137 unsigned is_unicode:1;
138 unsigned _spare:31;
140
153
154typedef struct {
155 SQLLEN len;
156 SQLSMALLINT paramtype;
157 char *outbuf;
158 unsigned is_unicode:1;
159 unsigned _spare:31;
161
162extern const pdo_driver_t pdo_odbc_driver;
163extern const struct pdo_stmt_methods odbc_stmt_methods;
164
165void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line);
166#define pdo_odbc_drv_error(what) pdo_odbc_error(dbh, NULL, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
167#define pdo_odbc_stmt_error(what) pdo_odbc_error(stmt->dbh, stmt, SQL_NULL_HSTMT, what, __FILE__, __LINE__)
168#define pdo_odbc_doer_error(what) pdo_odbc_error(dbh, NULL, stmt, what, __FILE__, __LINE__)
169
172
173#ifdef SQL_ATTR_CONNECTION_POOLING
174extern zend_ulong pdo_odbc_pool_on;
175extern zend_ulong pdo_odbc_pool_mode;
176#endif
177
178enum {
180 PDO_ODBC_ATTR_ASSUME_UTF8 /* assume that input strings are UTF-8 when feeding data to unicode columns */
181};
file(string $filename, int $flags=0, $context=null)
const pdo_driver_t pdo_odbc_driver
const struct pdo_stmt_methods odbc_stmt_methods
Definition odbc_stmt.c:866
int line
Definition php_ffi.h:54
struct _pdo_dbh_t pdo_dbh_t
struct _pdo_stmt_t pdo_stmt_t
@ PDO_ATTR_DRIVER_SPECIFIC
#define PDO_ODBC_HSTMT
void pdo_odbc_fini_error_table(void)
@ PDO_ODBC_ATTR_ASSUME_UTF8
@ PDO_ODBC_ATTR_USE_CURSOR_LIBRARY
#define PDO_ODBC_HDBC
void pdo_odbc_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, PDO_ODBC_HSTMT statement, char *what, const char *file, int line)
Definition odbc_driver.c:55
#define PDO_ODBC_HENV
void pdo_odbc_init_error_table(void)
pdo_odbc_errinfo einfo
char last_err_msg[SQL_MAX_MESSAGE_LENGTH]
SQLSMALLINT paramtype
pdo_odbc_db_handle * H
pdo_odbc_errinfo einfo
PDO_ODBC_HSTMT stmt
pdo_odbc_column * cols
zend_ulong convbufsize
uint32_t zend_ulong
Definition zend_long.h:43