-
-
Notifications
You must be signed in to change notification settings - Fork 2k
/
php_phalcon.h
226 lines (176 loc) · 6.36 KB
/
php_phalcon.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
/* This file was generated automatically by Zephir do not modify it! */
#ifndef PHP_PHALCON_H
#define PHP_PHALCON_H 1
#ifdef PHP_WIN32
#define ZEPHIR_RELEASE 1
#endif
/*
+------------------------------------------------------------------------+
| Zephir Language |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2017 Zephir Team (http://www.zephir-lang.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| If you did not receive a copy of the license and are unable to |
| obtain it through the world-wide-web, please send an email |
| to license@zephir-lang.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <andres@zephir-lang.com> |
| Eduar Carvajal <eduar@zephir-lang.com> |
| Vladimir Kolesnikov <vladimir@extrememember.com> |
+------------------------------------------------------------------------+
*/
#ifndef ZEPHIR_KERNEL_GLOBALS_H
#define ZEPHIR_KERNEL_GLOBALS_H
#include <php.h>
#define ZEPHIR_MAX_MEMORY_STACK 48
#define ZEPHIR_MAX_CACHE_SLOTS 512
/** Memory frame */
typedef struct _zephir_memory_entry {
size_t pointer;
size_t capacity;
zval **addresses;
size_t hash_pointer;
size_t hash_capacity;
zval **hash_addresses;
struct _zephir_memory_entry *prev;
struct _zephir_memory_entry *next;
#ifndef ZEPHIR_RELEASE
int permanent;
const char *func;
#endif
} zephir_memory_entry;
/** Virtual Symbol Table */
typedef struct _zephir_symbol_table {
struct _zephir_memory_entry *scope;
zend_array *symbol_table;
struct _zephir_symbol_table *prev;
} zephir_symbol_table;
typedef struct _zephir_function_cache {
zend_class_entry *ce;
zend_function *func;
} zephir_function_cache;
typedef zend_function zephir_fcall_cache_entry;
#define ZEPHIR_INIT_FUNCS(class_functions) static const zend_function_entry class_functions[] =
/** Define FASTCALL */
#if defined(__GNUC__) && ZEND_GCC_VERSION >= 3004 && defined(__i386__)
# define ZEPHIR_FASTCALL __attribute__((fastcall))
#elif defined(_MSC_VER) && defined(_M_IX86)
# define ZEPHIR_FASTCALL __fastcall
#else
# define ZEPHIR_FASTCALL
#endif
#define ZEPHIR_INIT_CLASS(name) \
int zephir_ ##name## _init(INIT_FUNC_ARGS)
#define ZEPHIR_INIT(name) \
if (zephir_ ##name## _init(INIT_FUNC_ARGS_PASSTHRU) == FAILURE) { \
return FAILURE; \
}
#if defined(__GNUC__) && (defined(__clang__) || ((__GNUC__ * 100 + __GNUC_MINOR__) >= 405))
# define UNREACHABLE() __builtin_unreachable()
# define ASSUME(x) if (x) {} else __builtin_unreachable()
#else
# define UNREACHABLE() assert(0)
# define ASSUME(x) assert(!!(x));
#endif
#if defined(__GNUC__) || defined(__clang__)
# define ZEPHIR_ATTR_NONNULL __attribute__((nonnull))
# define ZEPHIR_ATTR_NONNULL1(x) __attribute__((nonnull (x)))
# define ZEPHIR_ATTR_NONNULL2(x, y) __attribute__((nonnull (x, y)))
# define ZEPHIR_ATTR_NONNULL3(x, y, z) __attribute__((nonnull (x, y, z)))
# define ZEPHIR_ATTR_PURE __attribute__((pure))
# define ZEPHIR_ATTR_CONST __attribute__((const))
# define ZEPHIR_ATTR_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
#else
# define ZEPHIR_ATTR_NONNULL
# define ZEPHIR_ATTR_NONNULL1(x)
# define ZEPHIR_ATTR_NONNULL2(x, y)
# define ZEPHIR_ATTR_NONNULL3(x, y, z)
# define ZEPHIR_ATTR_PURE
# define ZEPHIR_ATTR_CONST
# define ZEPHIR_ATTR_WARN_UNUSED_RESULT
#endif
#if !defined(__GNUC__) && !(defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
# define __builtin_constant_p(s) (0)
#endif
#ifndef __func__
# define __func__ __FUNCTION__
#endif
#if defined(__GNUC__)
# define ZEPHIR_NO_OPT __attribute__((optimize("O0")))
#else
# define ZEPHIR_NO_OPT
#endif
#define likely(x) EXPECTED(x)
#define unlikely(x) UNEXPECTED(x)
#endif
#define PHP_PHALCON_NAME "phalcon"
#define PHP_PHALCON_VERSION "4.0.0-alpha.3"
#define PHP_PHALCON_EXTNAME "phalcon"
#define PHP_PHALCON_AUTHOR "Phalcon Team and contributors"
#define PHP_PHALCON_ZEPVERSION "0.11.11-b661a58"
#define PHP_PHALCON_DESCRIPTION "Web framework delivered as a C-extension for PHP"
typedef struct _zephir_struct_db {
zend_bool escape_identifiers;
zend_bool force_casting;
} zephir_struct_db;
typedef struct _zephir_struct_orm {
HashTable* parser_cache;
HashTable* ast_cache;
int cache_level;
int unique_cache_id;
zend_bool events;
zend_bool virtual_foreign_keys;
zend_bool column_renaming;
zend_bool not_null_validations;
zend_bool exception_on_failed_save;
zend_bool enable_literals;
zend_bool late_state_binding;
zend_bool enable_implicit_joins;
zend_bool cast_on_hydrate;
zend_bool ignore_unknown_columns;
zend_bool update_snapshot_on_save;
zend_bool disable_assign_setters;
zend_bool case_insensitive_column_map;
} zephir_struct_orm;
ZEND_BEGIN_MODULE_GLOBALS(phalcon)
int initialized;
/* Memory */
zephir_memory_entry *start_memory; /**< The first preallocated frame */
zephir_memory_entry *end_memory; /**< The last preallocate frame */
zephir_memory_entry *active_memory; /**< The current memory frame */
/* Virtual Symbol Tables */
zephir_symbol_table *active_symbol_table;
/** Function cache */
HashTable *fcache;
zephir_fcall_cache_entry *scache[ZEPHIR_MAX_CACHE_SLOTS];
/* Cache enabled */
unsigned int cache_enabled;
/* Max recursion control */
unsigned int recursive_lock;
zephir_struct_db db;
zephir_struct_orm orm;
ZEND_END_MODULE_GLOBALS(phalcon)
#ifdef ZTS
#include "TSRM.h"
#endif
ZEND_EXTERN_MODULE_GLOBALS(phalcon)
#ifdef ZTS
#define ZEPHIR_GLOBAL(v) ZEND_MODULE_GLOBALS_ACCESSOR(phalcon, v)
#else
#define ZEPHIR_GLOBAL(v) (phalcon_globals.v)
#endif
#ifdef ZTS
void ***tsrm_ls;
#define ZEPHIR_VGLOBAL ((zend_phalcon_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(phalcon_globals_id)])
#else
#define ZEPHIR_VGLOBAL &(phalcon_globals)
#endif
#define ZEPHIR_API ZEND_API
#define zephir_globals_def phalcon_globals
#define zend_zephir_globals_def zend_phalcon_globals
extern zend_module_entry phalcon_module_entry;
#define phpext_phalcon_ptr &phalcon_module_entry
#endif