Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 143 lines (119 sloc) 5.111 kB
573b460 @andigutmans Zend Library
andigutmans authored
1 /*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
61e93cc @andigutmans - Update copyright notices to 2006
andigutmans authored
5 | Copyright (c) 1998-2006 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"
de9206a @andigutmans - Need zend_Compile.h for struct _zend_arg_info definiton (thanks to…
andigutmans authored
27
2c254ba @zsuraski Get rid of ELS_*(), and use TSRMLS_*() instead.
zsuraski authored
28 #define INIT_FUNC_ARGS int type, int module_number TSRMLS_DC
29 #define INIT_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
e8ac55d @zsuraski More TSRMLS_FETCH work
zsuraski authored
30 #define SHUTDOWN_FUNC_ARGS int type, int module_number TSRMLS_DC
31 #define SHUTDOWN_FUNC_ARGS_PASSTHRU type, module_number TSRMLS_CC
32 #define ZEND_MODULE_INFO_FUNC_ARGS zend_module_entry *zend_module TSRMLS_DC
33 #define ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU zend_module TSRMLS_CC
573b460 @andigutmans Zend Library
andigutmans authored
34
f1b80b9 @zsuraski Attempt at fixing the linkage problem in Win32
zsuraski authored
35 extern struct _zend_arg_info first_arg_force_ref[2];
36 extern struct _zend_arg_info second_arg_force_ref[3];
37 extern struct _zend_arg_info third_arg_force_ref[4];
38 extern struct _zend_arg_info fourth_arg_force_ref[5];
d288f66 Fix a bug that would not fill in the fifth argument to preg_replace()
Andrei Zmievski authored
39 extern struct _zend_arg_info fifth_arg_force_ref[6];
f1b80b9 @zsuraski Attempt at fixing the linkage problem in Win32
zsuraski authored
40 extern struct _zend_arg_info all_args_by_ref[1];
05cf442 @zsuraski -
zsuraski authored
41
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
42 #define ZEND_MODULE_API_NO 20060613
3bd9e02 @andigutmans - Save ZEND_DEBUG, ZTS, ZEND_API information
andigutmans authored
43 #ifdef ZTS
44 #define USING_ZTS 1
45 #else
46 #define USING_ZTS 0
47 #endif
48
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
49 #define STANDARD_MODULE_HEADER_EX sizeof(zend_module_entry), ZEND_MODULE_API_NO, ZEND_DEBUG, USING_ZTS
50 #define STANDARD_MODULE_HEADER \
51 STANDARD_MODULE_HEADER_EX, NULL, NULL
52 #define ZE2_STANDARD_MODULE_HEADER \
53 STANDARD_MODULE_HEADER_EX, ini_entries, NULL
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
54
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
55 #define STANDARD_MODULE_PROPERTIES_EX 0, 0, NULL, 0
56
1757bf8 @tony2001 fix typo
tony2001 authored
57 #define NO_MODULE_GLOBALS 0, NULL, NULL, NULL
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
58
59 #ifdef ZTS
60 # define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals_id
61 #else
62 # define ZEND_MODULE_GLOBALS(module_name) sizeof(zend_##module_name##_globals), &module_name##_globals
63 #endif
573b460 @andigutmans Zend Library
andigutmans authored
64
690575e Add global startup/shutdown functions
Sascha Schumann authored
65 #define STANDARD_MODULE_PROPERTIES \
1757bf8 @tony2001 fix typo
tony2001 authored
66 NO_MODULE_GLOBALS, NULL, STANDARD_MODULE_PROPERTIES_EX
573b460 @andigutmans Zend Library
andigutmans authored
67
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
68 #define NO_VERSION_YET NULL
69
573b460 @andigutmans Zend Library
andigutmans authored
70 #define MODULE_PERSISTENT 1
71 #define MODULE_TEMPORARY 2
72
2f7f1dd #@!$$grml*$%
Harald Radi authored
73 struct _zend_ini_entry;
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
74 typedef struct _zend_module_entry zend_module_entry;
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
75 typedef struct _zend_module_dep zend_module_dep;
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
76
77 struct _zend_module_entry {
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
78 unsigned short size;
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
79 unsigned int zend_api;
80 unsigned char zend_debug;
81 unsigned char zts;
2f7f1dd #@!$$grml*$%
Harald Radi authored
82 struct _zend_ini_entry *ini_entry;
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
83 struct _zend_module_dep *deps;
573b460 @andigutmans Zend Library
andigutmans authored
84 char *name;
f8bbafd @zsuraski ntroduce infrastructure for supplying information about arguments,
zsuraski authored
85 struct _zend_function_entry *functions;
573b460 @andigutmans Zend Library
andigutmans authored
86 int (*module_startup_func)(INIT_FUNC_ARGS);
9d8e0db @zsuraski * Add arguments to shutdown functions
zsuraski authored
87 int (*module_shutdown_func)(SHUTDOWN_FUNC_ARGS);
573b460 @andigutmans Zend Library
andigutmans authored
88 int (*request_startup_func)(INIT_FUNC_ARGS);
9d8e0db @zsuraski * Add arguments to shutdown functions
zsuraski authored
89 int (*request_shutdown_func)(SHUTDOWN_FUNC_ARGS);
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
90 void (*info_func)(ZEND_MODULE_INFO_FUNC_ARGS);
0185071 MFZE1: Introduced extension version numbers (Stig)
Sebastian Bergmann authored
91 char *version;
ada4e50 MFH: Added automatic module globals management.
Dmitry Stogov authored
92 size_t globals_size;
93 #ifdef ZTS
94 ts_rsrc_id* globals_id_ptr;
95 #else
96 void* globals_ptr;
97 #endif
98 void (*globals_ctor)(void *global TSRMLS_DC);
99 void (*globals_dtor)(void *global TSRMLS_DC);
6535933 - Replaced the exec_finished hook by the zend_post_deactive hook for
Derick Rethans authored
100 int (*post_deactivate_func)(void);
94b5119 @zsuraski Remove request_started, increase thread safety
zsuraski authored
101 int module_started;
573b460 @andigutmans Zend Library
andigutmans authored
102 unsigned char type;
103 void *handle;
104 int module_number;
bfbe861 @zsuraski Almost forgot to commit those
zsuraski authored
105 };
573b460 @andigutmans Zend Library
andigutmans authored
106
c0c7a9f Improved PHP extension loading mechanism with support for module depe…
Dmitry Stogov authored
107 #define MODULE_DEP_REQUIRED 1
108 #define MODULE_DEP_CONFLICTS 2
109 #define MODULE_DEP_OPTIONAL 3
110
111 #define ZEND_MOD_REQUIRED_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_REQUIRED },
112 #define ZEND_MOD_CONFLICTS_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_CONFLICTS },
113 #define ZEND_MOD_OPTIONAL_EX(name, rel, ver) { name, rel, ver, MODULE_DEP_OPTIONAL },
114
115 #define ZEND_MOD_REQUIRED(name) ZEND_MOD_REQUIRED_EX(name, NULL, NULL)
116 #define ZEND_MOD_CONFLICTS(name) ZEND_MOD_CONFLICTS_EX(name, NULL, NULL)
117 #define ZEND_MOD_OPTIONAL(name) ZEND_MOD_OPTIONAL_EX(name, NULL, NULL)
118
119 struct _zend_module_dep {
120 char *name; /* module name */
121 char *rel; /* version relationship: NULL (exists), lt|le|eq|ge|gt (to given version) */
122 char *version; /* version */
123 unsigned char type; /* dependency type */
124 };
573b460 @andigutmans Zend Library
andigutmans authored
125
2946f87 @andigutmans - Fix new -m on Windows
andigutmans authored
126 extern ZEND_API HashTable module_registry;
573b460 @andigutmans Zend Library
andigutmans authored
127
3feb4b3 @zsuraski Add new API for resources
zsuraski authored
128 void module_destructor(zend_module_entry *module);
d76cf1d @zsuraski More TSRMLS_FETCH work
zsuraski authored
129 int module_registry_cleanup(zend_module_entry *module TSRMLS_DC);
130 int module_registry_request_startup(zend_module_entry *module TSRMLS_DC);
35b0b8d @wez fix shutdown so that dl()'d modules are unloaded after all the dtors …
wez authored
131 int module_registry_unload_temp(zend_module_entry *module TSRMLS_DC);
573b460 @andigutmans Zend Library
andigutmans authored
132
62114c1 @zsuraski Destructors no longer return ints, the low level problem it was inten…
zsuraski authored
133 #define ZEND_MODULE_DTOR (void (*)(void *)) module_destructor
573b460 @andigutmans Zend Library
andigutmans authored
134 #endif
333406b - Added some missing CVS $Id$ tags, headers and footers.
foobar authored
135
136 /*
137 * Local variables:
138 * tab-width: 4
139 * c-basic-offset: 4
140 * indent-tabs-mode: t
141 * End:
142 */
Something went wrong with that request. Please try again.