-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathhello_php.c
More file actions
54 lines (47 loc) · 913 Bytes
/
hello_php.c
File metadata and controls
54 lines (47 loc) · 913 Bytes
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
/*
* Include the php api so we can talk to it
*/
#include <php.h>
/*
* Module constants
*/
#define PHP_HELLO_PHP_EXTNAME "hello_php"
#define PHP_HELLO_PHP_VERSION "0.0.1"
/*
* Here we declare our function
*/
PHP_FUNCTION(hello_php);
/*
* Introduce our function to the PHP API
*/
zend_function_entry hello_php_functions[] = {
PHP_FE(hello_php, NULL)
{NULL, NULL, NULL}
};
/*
* Info about our module
*/
zend_module_entry hello_php_module_entry = {
STANDARD_MODULE_HEADER,
PHP_HELLO_PHP_EXTNAME,
hello_php_functions,
NULL,
NULL,
NULL,
NULL,
NULL,
PHP_HELLO_PHP_VERSION,
STANDARD_MODULE_PROPERTIES
};
/*
* This macro will output additional C
* code necessary for making this ext
* dynamically loadable
*/
ZEND_GET_MODULE(hello_php)
/**
* Hooray! Here's our function definition!
*/
PHP_FUNCTION(hello_php) {
php_printf("Hello PHP!\n");
}