php-internal-docs
8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
skeleton.c
Go to the documentation of this file.
1
%HEADER%
2
3
#ifdef HAVE_CONFIG_H
4
# include <config.h>
5
#endif
6
7
#include "
php.h
"
8
#include "
ext/standard/info.h
"
9
#include "php_%EXTNAME%.h"
10
#include "%EXTNAME%_arginfo.h"
11
12
/* For compatibility with older PHP versions */
13
#ifndef ZEND_PARSE_PARAMETERS_NONE
14
#define ZEND_PARSE_PARAMETERS_NONE() \
15
ZEND_PARSE_PARAMETERS_START(0, 0) \
16
ZEND_PARSE_PARAMETERS_END()
17
#endif
18
19
/* {{{ void test1() */
20
PHP_FUNCTION
(
test1
)
21
{
22
ZEND_PARSE_PARAMETERS_NONE
();
23
24
php_printf
(
"The extension %s is loaded and working!\r\n"
,
"%EXTNAME%"
);
25
}
26
/* }}} */
27
28
/* {{{ string test2( [ string $var ] ) */
29
PHP_FUNCTION
(
test2
)
30
{
31
char
*var =
"World"
;
32
size_t
var_len =
sizeof
(
"World"
) - 1;
33
zend_string
*
retval
;
34
35
ZEND_PARSE_PARAMETERS_START
(0, 1)
36
Z_PARAM_OPTIONAL
37
Z_PARAM_STRING
(var, var_len)
38
ZEND_PARSE_PARAMETERS_END
();
39
40
retval
=
strpprintf
(0,
"Hello %s"
, var);
41
42
RETURN_STR
(
retval
);
43
}
44
/* }}}*/
45
46
/* {{{ PHP_RINIT_FUNCTION */
47
PHP_RINIT_FUNCTION
(%EXTNAME%)
48
{
49
#if defined(ZTS) && defined(COMPILE_DL_%EXTNAMECAPS%)
50
ZEND_TSRMLS_CACHE_UPDATE
();
51
#endif
52
53
return
SUCCESS
;
54
}
55
/* }}} */
56
57
/* {{{ PHP_MINFO_FUNCTION */
58
PHP_MINFO_FUNCTION
(%EXTNAME%)
59
{
60
php_info_print_table_start
();
61
php_info_print_table_row
(2,
"%EXTNAME% support"
,
"enabled"
);
62
php_info_print_table_end
();
63
}
64
/* }}} */
65
66
/* {{{ %EXTNAME%_module_entry */
67
zend_module_entry
%EXTNAME%
_module_entry
= {
68
STANDARD_MODULE_HEADER
,
69
"%EXTNAME%"
,
/* Extension name */
70
ext_functions,
/* zend_function_entry */
71
NULL
,
/* PHP_MINIT - Module initialization */
72
NULL
,
/* PHP_MSHUTDOWN - Module shutdown */
73
PHP_RINIT
(%EXTNAME%),
/* PHP_RINIT - Request initialization */
74
NULL
,
/* PHP_RSHUTDOWN - Request shutdown */
75
PHP_MINFO
(%EXTNAME%),
/* PHP_MINFO - Module info */
76
PHP_%EXTNAMECAPS%_VERSION,
/* Version */
77
STANDARD_MODULE_PROPERTIES
78
};
79
/* }}} */
80
81
#ifdef COMPILE_DL_%EXTNAMECAPS%
82
# ifdef ZTS
83
ZEND_TSRMLS_CACHE_DEFINE
()
84
# endif
85
ZEND_GET_MODULE
(%EXTNAME%)
86
#endif
NULL
#define NULL
Definition
gdcache.h:45
SUCCESS
#define SUCCESS
Definition
hash_sha3.c:261
info.h
php_printf
PHPAPI size_t php_printf(const char *format,...)
Definition
main.c:938
php_info_print_table_start
php_info_print_table_start()
Definition
info.c:1064
php_info_print_table_row
php_info_print_table_row(2, "PDO Driver for Firebird", "enabled")
php_info_print_table_end
php_info_print_table_end()
Definition
info.c:1074
php.h
PHP_FUNCTION
#define PHP_FUNCTION
Definition
php.h:364
PHP_MINFO
#define PHP_MINFO
Definition
php.h:396
PHP_RINIT
#define PHP_RINIT
Definition
php.h:394
PHP_MINFO_FUNCTION
#define PHP_MINFO_FUNCTION
Definition
php.h:404
PHP_RINIT_FUNCTION
#define PHP_RINIT_FUNCTION
Definition
php.h:402
ZEND_PARSE_PARAMETERS_NONE
#define ZEND_PARSE_PARAMETERS_NONE()
Definition
skeleton.c:14
_module_entry
zend_module_entry EXTNAME _module_entry
Definition
skeleton.c:67
test2
test2(string $str="")
Definition
skeleton.stub.php:10
test1
test1()
Definition
skeleton.stub.php:8
strpprintf
#define strpprintf
Definition
spprintf.h:30
ZEND_TSRMLS_CACHE_UPDATE
#define ZEND_TSRMLS_CACHE_UPDATE()
Definition
zend.h:69
ZEND_TSRMLS_CACHE_DEFINE
#define ZEND_TSRMLS_CACHE_DEFINE()
Definition
zend.h:68
ZEND_PARSE_PARAMETERS_END
#define ZEND_PARSE_PARAMETERS_END()
Definition
zend_API.h:1641
Z_PARAM_OPTIONAL
#define Z_PARAM_OPTIONAL
Definition
zend_API.h:1667
ZEND_GET_MODULE
#define ZEND_GET_MODULE(name)
Definition
zend_API.h:241
Z_PARAM_STRING
#define Z_PARAM_STRING(dest, dest_len)
Definition
zend_API.h:2071
ZEND_PARSE_PARAMETERS_START
#define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args)
Definition
zend_API.h:1620
RETURN_STR
#define RETURN_STR(s)
Definition
zend_API.h:1039
zend_string
struct _zend_string zend_string
Definition
zend_map_ptr.h:24
STANDARD_MODULE_HEADER
#define STANDARD_MODULE_HEADER
Definition
zend_modules.h:42
zend_module_entry
struct _zend_module_entry zend_module_entry
Definition
zend_modules.h:68
STANDARD_MODULE_PROPERTIES
#define STANDARD_MODULE_PROPERTIES
Definition
zend_modules.h:59
retval
zval retval
Definition
zend_vm_def.h:4055
ext
skeleton
skeleton.c
Generated on Sat Aug 23 2025 01:46:11 for php-internal-docs by
1.13.2