Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 142 lines (117 sloc) 5.094 kB
573b460 @andigutmans Zend Library
andigutmans authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
0203cc3 @felipensp - Year++
felipensp authored
5 | Copyright (c) 1998-2011 Zend Technologies Ltd. (http://www.zend.com) |
573b460 @andigutmans Zend Library
andigutmans authored
6 +----------------------------------------------------------------------+
d863d52 Update headers.
Sebastian Bergmann authored
7 | This source file is subject to version 2.00 of the Zend license, |
637a404 - MFH as discussed
Marcus Boerger authored
8 | that is bundled with this package in the file LICENSE, and is |
f68c7ff updating license information in the headers.
James Cox authored
9 | available through the world-wide-web at the following url: |
d863d52 Update headers.
Sebastian Bergmann authored
10 | http://www.zend.com/license/2_00.txt. |
b5b1117 @zsuraski License update
zsuraski authored
11 | If you did not receive a copy of the Zend license and are unable to |
12 | obtain it through the world-wide-web, please send a note to |
13 | license@zend.com so we can mail you a copy immediately. |
573b460 @andigutmans Zend Library
andigutmans authored
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@zend.com> |
16 | Zeev Suraski <zeev@zend.com> |
17 +----------------------------------------------------------------------+
18 */
19
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored
20 /* $Id$ */
b5b1117 @zsuraski License update
zsuraski authored
21
b982307 Change header protection macros to conform to standard.
Sascha Schumann authored
22 #ifndef MODULES_H
23 #define MODULES_H
573b460 @andigutmans Zend Library
andigutmans authored
24
7513a2f @andigutmans - Fix dll linkage warnings
andigutmans authored
25 #include "zend.h"
d608f1a including zend_compile.h for NetWare as NetWare uses MetroWerks Code …
Anantha Kesari H Y authored
26 #include "zend_compile.h"
5d8c9f8 @smalyshev Build IDs
smalyshev authored
27 #include "zend_build.h"
de9206a @andigutmans - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to…
andigutmans authored
28
2c254ba @zsuraski Get rid of ELS_*(), and use TSRMLS_*() instead.
zsuraski authored
29 #define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC
30 #define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
e8ac55d @zsuraski More TSRMLS_FETCH work
zsuraski authored
31 #define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC
32 #define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
33 #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
34 #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
573b460 @andigutmans Zend Library
andigutmans authored
35
f7ce695 - Interned string related callbacks moved turned from compiler_global…
Dmitry Stogov authored
36 #define ZEND_MODULE_API_NO 20100525
3bd9e02 @andigutmans - Save ZEND_DEBUG, ZTS, ZEND_API information
andigutmans authored
37 #ifdef ZTS
38 #define USING_ZTS 1
39 #else
40 #define USING_ZTS 0
41 #endif
42
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
43 #define STANDARD_MODULE_HEADER_EX sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS
44 #define STANDARD_MODULE_HEADER \
45 STANDARD_MODULE_HEADER_EX, NULL, NULL
46 #define ZE2_STANDARD_MODULE_HEADER \
47 STANDARD_MODULE_HEADER_EX, ini_entries, NULL
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
48
5d8c9f8 @smalyshev Build IDs
smalyshev authored
49 #define ZEND_MODULE_BUILD_ID "API" ZEND_TOSTR(ZEND_MODULE_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA
50
51 #define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0, ZEND_MODULE_BUILD_ID
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
52
1757bf8 @tony2001 fix typo
tony2001 authored
53 #define NO_MODULE_GLOBALS 0, NULL, NULL, NULL
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
54
55 #ifdef ZTS
56 # define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id
57 #else
58 # define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals
59 #endif
573b460 @andigutmans Zend Library
andigutmans authored
60
690575e Add global startup/shutdown functions
Sascha Schumann authored
61 #define STANDARD_MODULE_PROPERTIES \
1757bf8 @tony2001 fix typo
tony2001 authored
62 NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX
573b460 @andigutmans Zend Library
andigutmans authored
63
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
64 #define NO_VERSION_YET NULL
65
573b460 @andigutmans Zend Library
andigutmans authored
66 #define MODULE_PERSISTENT 1
67 #define MODULE_TEMPORARY 2
68
2f7f1dd #@!$$grml*$%
Harald Radi authored
69 struct _zend_ini_entry;
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
70 typedef struct _zend_module_entry zend_module_entry;
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
71 typedef struct _zend_module_dep zend_module_dep;
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
72
73 struct _zend_module_entry {
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
74 unsigned short size;
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
75 unsigned int zend_api;
76 unsigned char zend_debug;
77 unsigned char zts;
6c810b0 Improved memory usage by movig constants to read only memory. (Dmitry…
Dmitry Stogov authored
78 const struct _zend_ini_entry *ini_entry;
79 const struct _zend_module_dep *deps;
80 const char *name;
81 const struct _zend_function_entry *functions;
573b460 @andigutmans Zend Library
andigutmans authored
82 int (*module_startup_func)(INIT_FUNC_ARGS);
9d8e0db @zsuraski * Add arguments to shutdown functions
zsuraski authored
83 int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS);
573b460 @andigutmans Zend Library
andigutmans authored
84 int (*request_startup_func)(INIT_FUNC_ARGS);
9d8e0db @zsuraski * Add arguments to shutdown functions
zsuraski authored
85 int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
86 void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
6c810b0 Improved memory usage by movig constants to read only memory. (Dmitry…
Dmitry Stogov authored
87 const char *version;
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
88 size_t globals_size;
89 #ifdef ZTS
90 ts_rsrc_id* globals_id_ptr;
91 #else
92 void* globals_ptr;
93 #endif
94 void (*globals_ctor)(void *global TSRMLS_DC);
95 void (*globals_dtor)(void *global TSRMLS_DC);
6535933 - Replaced the exec_finished hook by the zend_post_deactive hook for
Derick Rethans authored
96 int (*post_deactivate_func)(void);
94b5119 @zsuraski Remove request_started, increase thread safety
zsuraski authored
97 int module_started;
573b460 @andigutmans Zend Library
andigutmans authored
98 unsigned char type;
99 void *handle;
100 int module_number;
aaa2f1c marked char pointer arguments as const in lots of
Hartmut Holzgraefe authored
101 const char *build_id;
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
102 };
573b460 @andigutmans Zend Library
andigutmans authored
103
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
104 #define MODULE_DEP_REQUIRED 1
105 #define MODULE_DEP_CONFLICTS 2
106 #define MODULE_DEP_OPTIONAL 3
107
108 #define ZEND_MOD_REQUIRED_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_REQUIRED },
109 #define ZEND_MOD_CONFLICTS_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_CONFLICTS },
110 #define ZEND_MOD_OPTIONAL_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_OPTIONAL },
111
112 #define ZEND_MOD_REQUIRED(name) ZEND_MOD_REQUIRED_EX(name, NULL, NULL)
113 #define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL)
114 #define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL)
115
9480eac @felipensp - Added ZEND_MOD_END macro to use in the end of zend_module_dep[]
felipensp authored
116 #define ZEND_MOD_END { NULL, NULL, NULL, 0 }
117
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
118 struct _zend_module_dep {
6c810b0 Improved memory usage by movig constants to read only memory. (Dmitry…
Dmitry Stogov authored
119 const char *name; /* module name */
120 const char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
121 const char *version; /* version */
122 unsigned char type; /* dependency type */
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
123 };
573b460 @andigutmans Zend Library
andigutmans authored
124
2946f87 @andigutmans - Fix new -m on Windows
andigutmans authored
125 extern ZEND_API HashTable module_registry;
573b460 @andigutmans Zend Library
andigutmans authored
126
3feb4b3 @zsuraski Add new API for resources
zsuraski authored
127 void module_destructor(zend_module_entry *module);
d76cf1d @zsuraski More TSRMLS_FETCH work
zsuraski authored
128 int module_registry_cleanup(zend_module_entry *module TSRMLS_DC);
129 int module_registry_request_startup(zend_module_entry *module TSRMLS_DC);
cf7384a @felipensp - MFH: Constness (Added const qualifier to several function parameters)
felipensp authored
130 int module_registry_unload_temp(const zend_module_entry *module TSRMLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
131
62114c1 @zsuraski Destructors no longer return ints, the low level problem it was inten…
zsuraski authored
132 #define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
573b460 @andigutmans Zend Library
andigutmans authored
133 #endif
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored
134
135 /*
136 * Local variables:
137 * tab-width: 4
138 * c-basic-offset: 4
139 * indent-tabs-mode: t
140 * End:
141 */
Something went wrong with that request. Please try again.