-
Notifications
You must be signed in to change notification settings - Fork 1
/
zend_example_pie_extension.c
87 lines (75 loc) · 2.34 KB
/
zend_example_pie_extension.c
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
/* Example extension for PHP */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "php.h"
#include "ext/standard/info.h"
#include "php_example_pie_extension.h"
/* For compatibility with older PHP versions */
#ifndef ZEND_PARSE_PARAMETERS_NONE
#define ZEND_PARSE_PARAMETERS_NONE() \
ZEND_PARSE_PARAMETERS_START(0, 0) \
ZEND_PARSE_PARAMETERS_END()
#endif
ZEND_DECLARE_MODULE_GLOBALS(example_pie_extension)
/* {{{ void example_pie_extension_test()
*/
PHP_FUNCTION(example_pie_extension_test)
{
ZEND_PARSE_PARAMETERS_NONE();
php_printf("Hello, %s!\r\n", HELLO_NAME);
}
/* }}} */
static PHP_GINIT_FUNCTION(example_pie_extension)
{
#if defined(COMPILE_DL_BCMATH) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
example_pie_extension_globals->scale= 1;
}
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(example_pie_extension)
{
php_info_print_table_start();
php_info_print_table_header(2, "example pie extension support", "enabled");
php_info_print_table_end();
}
/* }}} */
/* {{{ arginfo
*/
ZEND_BEGIN_ARG_INFO(arginfo_example_pie_extension_test, 0)
ZEND_END_ARG_INFO()
/* }}} */
/* {{{ example_pie_extension_functions[]
*/
static const zend_function_entry example_pie_extension_functions[] = {
PHP_FE(example_pie_extension_test, arginfo_example_pie_extension_test)
PHP_FE_END
};
/* }}} */
/* {{{ example_pie_extension_module_entry
*/
zend_module_entry example_pie_extension_module_entry = {
STANDARD_MODULE_HEADER,
"example_pie_extension", /* Extension name */
example_pie_extension_functions, /* zend_function_entry */
NULL, /* PHP_MINIT - Module initialization */
NULL, /* PHP_MSHUTDOWN - Module shutdown */
NULL, /* PHP_RINIT - Request initialization */
NULL, /* PHP_RSHUTDOWN - Request shutdown */
PHP_MINFO(example_pie_extension), /* PHP_MINFO - Module info */
PHP_EXAMPLE_PIE_EXTENSION_VERSION, /* Version */
PHP_MODULE_GLOBALS(example_pie_extension), /* Module globals */
PHP_GINIT(example_pie_extension), /* PHP_GINIT - Globals initialization */
NULL, /* PHP_GSHUTDOWN - Globals shutdown */
NULL,
STANDARD_MODULE_PROPERTIES_EX
};
/* }}} */
#ifdef COMPILE_DL_EXAMPLE_PIE_EXTENSION
# ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
# endif
ZEND_GET_MODULE(example_pie_extension)
#endif