php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
php_pdo_firebird_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: Ard Biesheuvel <abies@php.net> |
14 +----------------------------------------------------------------------+
15*/
16
17/* internal header; not supposed to be installed */
18
19#ifndef PHP_PDO_FIREBIRD_INT_H
20#define PHP_PDO_FIREBIRD_INT_H
21
22#include <ibase.h>
23
24#ifdef SQLDA_VERSION
25#define PDO_FB_SQLDA_VERSION SQLDA_VERSION
26#else
27#define PDO_FB_SQLDA_VERSION 1
28#endif
29
30#define PDO_FB_DIALECT 3
31
32#define PDO_FB_DEF_DATE_FMT "%Y-%m-%d"
33#define PDO_FB_DEF_TIME_FMT "%H:%M:%S"
34#define PDO_FB_DEF_TIMESTAMP_FMT PDO_FB_DEF_DATE_FMT " " PDO_FB_DEF_TIME_FMT
35
36#define SHORT_MAX (1 << (8*sizeof(short)-1))
37
38#if SIZEOF_ZEND_LONG == 8 && !defined(PHP_WIN32)
39# define LL_LIT(lit) lit ## L
40#else
41# define LL_LIT(lit) lit ## LL
42#endif
43#define LL_MASK "ll"
44
45/* Firebird API has a couple of missing const decls in its API */
46#define const_cast(s) ((char*)(s))
47
48#ifdef PHP_WIN32
49typedef void (__stdcall *info_func_t)(char*);
50#else
51typedef void (*info_func_t)(char*);
52#endif
53
54#ifndef min
55#define min(a,b) ((a)<(b)?(a):(b))
56#endif
57
58#if defined(_LP64) || defined(__LP64__) || defined(__arch64__) || defined(_WIN64)
59# define PDO_FIREBIRD_HANDLE_INITIALIZER 0U
60#else
61# define PDO_FIREBIRD_HANDLE_INITIALIZER NULL
62#endif
63
64typedef struct {
66 char *errmsg;
69
70typedef struct {
71 /* the result of the last API call */
72 ISC_STATUS isc_status[20];
73
74 /* the connection handle */
75 isc_db_handle db;
76
77 /* the transaction handle */
78 isc_tr_handle tr;
82
83 /* date and time format strings, can be set by the set_attribute method */
87
88 unsigned sql_dialect:2;
89
90 /* prepend table names on column names in fetch */
92
93 unsigned _reserved:29;
94
97
98
99typedef struct {
100 /* the link that owns this statement */
102
103 /* the statement handle */
104 isc_stmt_handle stmt;
105
106 /* the name of the cursor (if it has one) */
107 char name[32];
108
109 /* the type of statement that was issued */
111
112 /* whether EOF was reached for this statement */
113 unsigned exhausted:1;
114
115 /* successful isc_dsql_execute opens a cursor */
116 unsigned cursor_open:1;
117
118 unsigned _reserved:22;
119
120 /* the named params that were converted to ?'s by the driver */
122
123 /* the input SQLDA */
124 XSQLDA *in_sqlda;
125
126 /* the output SQLDA */
127 XSQLDA out_sqlda; /* last member */
129
131
132extern const struct pdo_stmt_methods firebird_stmt_methods;
133
134extern void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state, const size_t state_len,
135 const char *msg, const size_t msg_len);
136#define php_firebird_error(d) php_firebird_set_error(d, NULL, NULL, 0, NULL, 0)
137#define php_firebird_error_stmt(s) php_firebird_set_error(s->dbh, s, NULL, 0, NULL, 0)
138#define php_firebird_error_with_info(d,e,el,m,ml) php_firebird_set_error(d, NULL, e, el, m, ml)
139#define php_firebird_error_stmt_with_info(s,e,el,m,ml) php_firebird_set_error(s->dbh, s, e, el, m, ml)
140
141extern bool php_firebird_commit_transaction(pdo_dbh_t *dbh, bool retain);
142
143enum {
147
148 /*
149 * transaction isolation level
150 * firebird does not have a level equivalent to read uncommited.
151 */
156
157 /* transaction access mode */
159};
160
161#endif /* PHP_PDO_FIREBIRD_INT_H */
const pdo_driver_t pdo_firebird_driver
const struct pdo_stmt_methods firebird_stmt_methods
struct _pdo_dbh_t pdo_dbh_t
struct _pdo_stmt_t pdo_stmt_t
@ PDO_ATTR_DRIVER_SPECIFIC
bool php_firebird_commit_transaction(pdo_dbh_t *dbh, bool retain)
@ PDO_FB_ATTR_TIME_FORMAT
@ PDO_FB_SERIALIZABLE
@ PDO_FB_READ_COMMITTED
@ PDO_FB_TRANSACTION_ISOLATION_LEVEL
@ PDO_FB_ATTR_TIMESTAMP_FORMAT
@ PDO_FB_WRITABLE_TRANSACTION
@ PDO_FB_REPEATABLE_READ
@ PDO_FB_ATTR_DATE_FORMAT
void php_firebird_set_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt, const char *state, const size_t state_len, const char *msg, const size_t msg_len)
char * msg
Definition phpdbg.h:289
pdo_firebird_error_info einfo
pdo_firebird_db_handle * H
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
uint32_t(* info_func_t)(const zend_call_info *call_info, const zend_ssa *ssa)
uint32_t zend_ulong
Definition zend_long.h:43
struct _zend_array HashTable
Definition zend_types.h:386