php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
zend_extensions.h
Go to the documentation of this file.
1/*
2 +----------------------------------------------------------------------+
3 | Zend Engine |
4 +----------------------------------------------------------------------+
5 | Copyright (c) Zend Technologies Ltd. (http://www.zend.com) |
6 +----------------------------------------------------------------------+
7 | This source file is subject to version 2.00 of the Zend license, |
8 | that is bundled with this package in the file LICENSE, and is |
9 | available through the world-wide-web at the following url: |
10 | http://www.zend.com/license/2_00.txt. |
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. |
14 +----------------------------------------------------------------------+
15 | Authors: Andi Gutmans <andi@php.net> |
16 | Zeev Suraski <zeev@php.net> |
17 +----------------------------------------------------------------------+
18*/
19
20#ifndef ZEND_EXTENSIONS_H
21#define ZEND_EXTENSIONS_H
22
23#include "zend_compile.h"
24#include "zend_build.h"
25
26/*
27The constants below are derived from ext/opcache/ZendAccelerator.h
28
29You can use the following macro to check the extension API version for compatibilities:
30
31#define ZEND_EXTENSION_API_NO_5_0_X 220040412
32#define ZEND_EXTENSION_API_NO_5_1_X 220051025
33#define ZEND_EXTENSION_API_NO_5_2_X 220060519
34#define ZEND_EXTENSION_API_NO_5_3_X 220090626
35#define ZEND_EXTENSION_API_NO_5_4_X 220100525
36#define ZEND_EXTENSION_API_NO_5_5_X 220121212
37#define ZEND_EXTENSION_API_NO_5_6_X 220131226
38#define ZEND_EXTENSION_API_NO_7_0_X 320151012
39
40#if ZEND_EXTENSION_API_NO < ZEND_EXTENSION_API_NO_5_5_X
41 // do something for php versions lower than 5.5.x
42#endif
43*/
44
45/* The first number is the engine version and the rest is the date (YYYYMMDD).
46 * This way engine 2/3 API no. is always greater than engine 1 API no.. */
47#define ZEND_EXTENSION_API_NO 420240924
48
53
54#define ZEND_EXTENSION_BUILD_ID "API" ZEND_TOSTR(ZEND_EXTENSION_API_NO) ZEND_BUILD_TS ZEND_BUILD_DEBUG ZEND_BUILD_SYSTEM ZEND_BUILD_EXTRA
55
57
58/* Typedef's for zend_extension function pointers */
59typedef int (*startup_func_t)(zend_extension *extension);
60typedef void (*shutdown_func_t)(zend_extension *extension);
63
64typedef void (*message_handler_func_t)(int message, void *arg);
65
67
71
74typedef size_t (*op_array_persist_calc_func_t)(zend_op_array *op_array);
75typedef size_t (*op_array_persist_func_t)(zend_op_array *op_array, void *mem);
76
112
115
116ZEND_API int zend_get_resource_handle(const char *module_name);
117ZEND_API int zend_get_op_array_extension_handle(const char *module_name);
118ZEND_API int zend_get_op_array_extension_handles(const char *module_name, int handles);
119ZEND_API int zend_get_internal_function_extension_handle(const char *module_name);
120ZEND_API int zend_get_internal_function_extension_handles(const char *module_name, int handles);
121ZEND_API void zend_extension_dispatch_message(int message, void *arg);
123
124#define ZEND_EXTMSG_NEW_EXTENSION 1
125
126
127#define ZEND_EXTENSION() \
128 ZEND_EXT_API zend_extension_version_info extension_version_info = { ZEND_EXTENSION_API_NO, ZEND_EXTENSION_BUILD_ID }
129
130#define STANDARD_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
131#define COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
132#define BUILD_COMPAT_ZEND_EXTENSION_PROPERTIES NULL, NULL, NULL, NULL, NULL, NULL, NULL, -1
133
134
136ZEND_API extern uint32_t zend_extension_flags;
137
138#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_CTOR (1<<0)
139#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_DTOR (1<<1)
140#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_HANDLER (1<<2)
141#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_PERSIST_CALC (1<<3)
142#define ZEND_EXTENSIONS_HAVE_OP_ARRAY_PERSIST (1<<4)
143
144void zend_extension_dtor(zend_extension *extension);
147void zend_startup_extensions(void);
148void zend_shutdown_extensions(void);
149
153
158ZEND_API zend_extension *zend_get_extension(const char *extension_name);
160ZEND_API size_t zend_extensions_op_array_persist(zend_op_array *op_array, void *mem);
162
163#endif /* ZEND_EXTENSIONS_H */
DL_HANDLE handle
Definition ffi.c:3028
zval * arg
Definition ffi.c:3975
phpdbg_frame_t frame
Definition phpdbg.h:236
message_handler_func_t message_handler
op_array_persist_calc_func_t op_array_persist_calc
const char * version
op_array_persist_func_t op_array_persist
int(* build_id_check)(const char *build_id)
fcall_end_handler_func_t fcall_end_handler
op_array_dtor_func_t op_array_dtor
shutdown_func_t shutdown
activate_func_t activate
fcall_begin_handler_func_t fcall_begin_handler
const char * URL
op_array_ctor_func_t op_array_ctor
statement_handler_func_t statement_handler
op_array_handler_func_t op_array_handler
const char * name
const char * author
deactivate_func_t deactivate
int(* api_no_check)(int api_no)
const char * copyright
startup_func_t startup
struct _zend_op_array zend_op_array
#define ZEND_API
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)
ZEND_API int zend_get_internal_function_extension_handles(const char *module_name, int handles)
void zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
zend_result zend_load_extension(const char *path)
ZEND_API uint32_t zend_extension_flags
ZEND_API size_t zend_extensions_op_array_persist(zend_op_array *op_array, void *mem)
ZEND_API int zend_get_resource_handle(const char *module_name)
ZEND_API size_t zend_extensions_op_array_persist_calc(zend_op_array *op_array)
ZEND_API zend_extension * zend_get_extension(const char *extension_name)
ZEND_API int zend_get_internal_function_extension_handle(const char *module_name)
ZEND_API int zend_get_op_array_extension_handles(const char *module_name, int handles)
ZEND_API zend_llist zend_extensions
zend_result zend_load_extension_handle(DL_HANDLE handle, const char *path)
ZEND_API void zend_extension_dispatch_message(int message, void *arg)
ZEND_API int zend_get_op_array_extension_handle(const char *module_name)
ZEND_API int zend_op_array_extension_handles
void zend_startup_extensions(void)
struct _zend_extension_version_info zend_extension_version_info
void(* fcall_begin_handler_func_t)(zend_execute_data *frame)
ZEND_API void zend_init_internal_run_time_cache(void)
void(* fcall_end_handler_func_t)(zend_execute_data *frame)
void(* op_array_handler_func_t)(zend_op_array *op_array)
void(* deactivate_func_t)(void)
void zend_shutdown_extensions(void)
void(* message_handler_func_t)(int message, void *arg)
ZEND_API void zend_reset_internal_run_time_cache(void)
void(* op_array_ctor_func_t)(zend_op_array *op_array)
size_t(* op_array_persist_calc_func_t)(zend_op_array *op_array)
void(* statement_handler_func_t)(zend_execute_data *frame)
ZEND_API size_t zend_internal_run_time_cache_reserved_size(void)
void(* shutdown_func_t)(zend_extension *extension)
struct _zend_extension zend_extension
int(* startup_func_t)(zend_extension *extension)
void(* op_array_dtor_func_t)(zend_op_array *op_array)
void zend_startup_extensions_mechanism(void)
ZEND_API void zend_append_version_info(const zend_extension *extension)
Definition zend.c:1284
void(* activate_func_t)(void)
void zend_extension_dtor(zend_extension *extension)
size_t(* op_array_persist_func_t)(zend_op_array *op_array, void *mem)
struct _zend_llist zend_llist
#define END_EXTERN_C()
#define DL_HANDLE
#define BEGIN_EXTERN_C()
ZEND_RESULT_CODE zend_result
Definition zend_types.h:64
struct _zend_execute_data zend_execute_data
Definition zend_types.h:91