Skip to content

Commit 21cfa03

Browse files
committed
Generate function entries for another batch of extensions
Closes GH-5352
1 parent c0cbab6 commit 21cfa03

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+1501
-1257
lines changed

ext/libxml/libxml.c

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,6 @@ static HashTable php_libxml_exports;
6161
static ZEND_DECLARE_MODULE_GLOBALS(libxml)
6262
static PHP_GINIT_FUNCTION(libxml);
6363

64-
static PHP_FUNCTION(libxml_set_streams_context);
65-
static PHP_FUNCTION(libxml_use_internal_errors);
66-
static PHP_FUNCTION(libxml_get_last_error);
67-
static PHP_FUNCTION(libxml_clear_errors);
68-
static PHP_FUNCTION(libxml_get_errors);
69-
static PHP_FUNCTION(libxml_set_external_entity_loader);
70-
static PHP_FUNCTION(libxml_disable_entity_loader);
71-
7264
static zend_class_entry *libxmlerror_class_entry;
7365

7466
/* {{{ dynamically loadable module stuff */
@@ -90,22 +82,10 @@ static int php_libxml_post_deactivate(void);
9082

9183
/* }}} */
9284

93-
/* {{{ extension definition structures */
94-
static const zend_function_entry libxml_functions[] = {
95-
PHP_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context)
96-
PHP_FE(libxml_use_internal_errors, arginfo_libxml_use_internal_errors)
97-
PHP_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
98-
PHP_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
99-
PHP_FE(libxml_get_errors, arginfo_libxml_get_errors)
100-
PHP_FE(libxml_disable_entity_loader, arginfo_libxml_disable_entity_loader)
101-
PHP_FE(libxml_set_external_entity_loader, arginfo_libxml_set_external_entity_loader)
102-
PHP_FE_END
103-
};
104-
10585
zend_module_entry libxml_module_entry = {
10686
STANDARD_MODULE_HEADER,
10787
"libxml", /* extension name */
108-
libxml_functions, /* extension function list */
88+
ext_functions, /* extension function list */
10989
PHP_MINIT(libxml), /* extension-wide startup function */
11090
PHP_MSHUTDOWN(libxml), /* extension-wide shutdown function */
11191
PHP_RINIT(libxml), /* per-request startup function */
@@ -913,7 +893,7 @@ static PHP_MINFO_FUNCTION(libxml)
913893

914894
/* {{{ proto void libxml_set_streams_context(resource streams_context)
915895
Set the streams context for the next libxml document load or write */
916-
static PHP_FUNCTION(libxml_set_streams_context)
896+
PHP_FUNCTION(libxml_set_streams_context)
917897
{
918898
zval *arg;
919899

@@ -931,7 +911,7 @@ static PHP_FUNCTION(libxml_set_streams_context)
931911

932912
/* {{{ proto bool libxml_use_internal_errors([boolean use_errors])
933913
Disable libxml errors and allow user to fetch error information as needed */
934-
static PHP_FUNCTION(libxml_use_internal_errors)
914+
PHP_FUNCTION(libxml_use_internal_errors)
935915
{
936916
xmlStructuredErrorFunc current_handler;
937917
zend_bool use_errors=0, retval;
@@ -972,7 +952,7 @@ static PHP_FUNCTION(libxml_use_internal_errors)
972952

973953
/* {{{ proto object libxml_get_last_error()
974954
Retrieve last error from libxml */
975-
static PHP_FUNCTION(libxml_get_last_error)
955+
PHP_FUNCTION(libxml_get_last_error)
976956
{
977957
xmlErrorPtr error;
978958

@@ -1004,7 +984,7 @@ static PHP_FUNCTION(libxml_get_last_error)
1004984

1005985
/* {{{ proto object libxml_get_errors()
1006986
Retrieve array of errors */
1007-
static PHP_FUNCTION(libxml_get_errors)
987+
PHP_FUNCTION(libxml_get_errors)
1008988
{
1009989

1010990
xmlErrorPtr error;
@@ -1046,7 +1026,7 @@ static PHP_FUNCTION(libxml_get_errors)
10461026

10471027
/* {{{ proto void libxml_clear_errors()
10481028
Clear last error from libxml */
1049-
static PHP_FUNCTION(libxml_clear_errors)
1029+
PHP_FUNCTION(libxml_clear_errors)
10501030
{
10511031
ZEND_PARSE_PARAMETERS_NONE();
10521032

@@ -1067,7 +1047,7 @@ PHP_LIBXML_API zend_bool php_libxml_disable_entity_loader(zend_bool disable) /*
10671047

10681048
/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
10691049
Disable/Enable ability to load external entities */
1070-
static PHP_FUNCTION(libxml_disable_entity_loader)
1050+
PHP_FUNCTION(libxml_disable_entity_loader)
10711051
{
10721052
zend_bool disable = 1;
10731053

@@ -1082,7 +1062,7 @@ static PHP_FUNCTION(libxml_disable_entity_loader)
10821062

10831063
/* {{{ proto void libxml_set_external_entity_loader(callback resolver_function)
10841064
Changes the default external entity loader */
1085-
static PHP_FUNCTION(libxml_set_external_entity_loader)
1065+
PHP_FUNCTION(libxml_set_external_entity_loader)
10861066
{
10871067
zend_fcall_info fci;
10881068
zend_fcall_info_cache fcc;

ext/libxml/libxml.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
/** @param resource $context */
46
function libxml_set_streams_context($context): void {}
57

ext/libxml/libxml_arginfo.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,24 @@ ZEND_END_ARG_INFO()
2424
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_libxml_set_external_entity_loader, 0, 1, _IS_BOOL, 0)
2525
ZEND_ARG_TYPE_INFO(0, resolver_function, IS_CALLABLE, 1)
2626
ZEND_END_ARG_INFO()
27+
28+
29+
ZEND_FUNCTION(libxml_set_streams_context);
30+
ZEND_FUNCTION(libxml_use_internal_errors);
31+
ZEND_FUNCTION(libxml_get_last_error);
32+
ZEND_FUNCTION(libxml_get_errors);
33+
ZEND_FUNCTION(libxml_clear_errors);
34+
ZEND_FUNCTION(libxml_disable_entity_loader);
35+
ZEND_FUNCTION(libxml_set_external_entity_loader);
36+
37+
38+
static const zend_function_entry ext_functions[] = {
39+
ZEND_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context)
40+
ZEND_FE(libxml_use_internal_errors, arginfo_libxml_use_internal_errors)
41+
ZEND_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
42+
ZEND_FE(libxml_get_errors, arginfo_libxml_get_errors)
43+
ZEND_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
44+
ZEND_FE(libxml_disable_entity_loader, arginfo_libxml_disable_entity_loader)
45+
ZEND_FE(libxml_set_external_entity_loader, arginfo_libxml_set_external_entity_loader)
46+
ZEND_FE_END
47+
};

ext/mbstring/mbstring.c

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -182,63 +182,11 @@ static const php_mb_nls_ident_list php_mb_default_identify_list[] = {
182182

183183
/* }}} */
184184

185-
/* {{{ zend_function_entry mbstring_functions[] */
186-
static const zend_function_entry mbstring_functions[] = {
187-
PHP_FE(mb_convert_case, arginfo_mb_convert_case)
188-
PHP_FE(mb_strtoupper, arginfo_mb_strtoupper)
189-
PHP_FE(mb_strtolower, arginfo_mb_strtolower)
190-
PHP_FE(mb_language, arginfo_mb_language)
191-
PHP_FE(mb_internal_encoding, arginfo_mb_internal_encoding)
192-
PHP_FE(mb_http_input, arginfo_mb_http_input)
193-
PHP_FE(mb_http_output, arginfo_mb_http_output)
194-
PHP_FE(mb_detect_order, arginfo_mb_detect_order)
195-
PHP_FE(mb_substitute_character, arginfo_mb_substitute_character)
196-
PHP_FE(mb_parse_str, arginfo_mb_parse_str)
197-
PHP_FE(mb_output_handler, arginfo_mb_output_handler)
198-
PHP_FE(mb_preferred_mime_name, arginfo_mb_preferred_mime_name)
199-
PHP_FE(mb_str_split, arginfo_mb_str_split)
200-
PHP_FE(mb_strlen, arginfo_mb_strlen)
201-
PHP_FE(mb_strpos, arginfo_mb_strpos)
202-
PHP_FE(mb_strrpos, arginfo_mb_strrpos)
203-
PHP_FE(mb_stripos, arginfo_mb_stripos)
204-
PHP_FE(mb_strripos, arginfo_mb_strripos)
205-
PHP_FE(mb_strstr, arginfo_mb_strstr)
206-
PHP_FE(mb_strrchr, arginfo_mb_strrchr)
207-
PHP_FE(mb_stristr, arginfo_mb_stristr)
208-
PHP_FE(mb_strrichr, arginfo_mb_strrichr)
209-
PHP_FE(mb_substr_count, arginfo_mb_substr_count)
210-
PHP_FE(mb_substr, arginfo_mb_substr)
211-
PHP_FE(mb_strcut, arginfo_mb_strcut)
212-
PHP_FE(mb_strwidth, arginfo_mb_strwidth)
213-
PHP_FE(mb_strimwidth, arginfo_mb_strimwidth)
214-
PHP_FE(mb_convert_encoding, arginfo_mb_convert_encoding)
215-
PHP_FE(mb_detect_encoding, arginfo_mb_detect_encoding)
216-
PHP_FE(mb_list_encodings, arginfo_mb_list_encodings)
217-
PHP_FE(mb_encoding_aliases, arginfo_mb_encoding_aliases)
218-
PHP_FE(mb_convert_kana, arginfo_mb_convert_kana)
219-
PHP_FE(mb_encode_mimeheader, arginfo_mb_encode_mimeheader)
220-
PHP_FE(mb_decode_mimeheader, arginfo_mb_decode_mimeheader)
221-
PHP_FE(mb_convert_variables, arginfo_mb_convert_variables)
222-
PHP_FE(mb_encode_numericentity, arginfo_mb_encode_numericentity)
223-
PHP_FE(mb_decode_numericentity, arginfo_mb_decode_numericentity)
224-
PHP_FE(mb_send_mail, arginfo_mb_send_mail)
225-
PHP_FE(mb_get_info, arginfo_mb_get_info)
226-
PHP_FE(mb_check_encoding, arginfo_mb_check_encoding)
227-
PHP_FE(mb_ord, arginfo_mb_ord)
228-
PHP_FE(mb_chr, arginfo_mb_chr)
229-
PHP_FE(mb_scrub, arginfo_mb_scrub)
230-
#if HAVE_MBREGEX
231-
PHP_MBREGEX_FUNCTION_ENTRIES
232-
#endif
233-
PHP_FE_END
234-
};
235-
/* }}} */
236-
237185
/* {{{ zend_module_entry mbstring_module_entry */
238186
zend_module_entry mbstring_module_entry = {
239187
STANDARD_MODULE_HEADER,
240188
"mbstring",
241-
mbstring_functions,
189+
ext_functions,
242190
PHP_MINIT(mbstring),
243191
PHP_MSHUTDOWN(mbstring),
244192
PHP_RINIT(mbstring),

ext/mbstring/mbstring.h

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -61,54 +61,6 @@ PHP_RINIT_FUNCTION(mbstring);
6161
PHP_RSHUTDOWN_FUNCTION(mbstring);
6262
PHP_MINFO_FUNCTION(mbstring);
6363

64-
/* functions in php_unicode.c */
65-
PHP_FUNCTION(mb_convert_case);
66-
PHP_FUNCTION(mb_strtoupper);
67-
PHP_FUNCTION(mb_strtolower);
68-
69-
/* php function registration */
70-
PHP_FUNCTION(mb_language);
71-
PHP_FUNCTION(mb_internal_encoding);
72-
PHP_FUNCTION(mb_http_input);
73-
PHP_FUNCTION(mb_http_output);
74-
PHP_FUNCTION(mb_detect_order);
75-
PHP_FUNCTION(mb_substitute_character);
76-
PHP_FUNCTION(mb_preferred_mime_name);
77-
PHP_FUNCTION(mb_parse_str);
78-
PHP_FUNCTION(mb_output_handler);
79-
PHP_FUNCTION(mb_str_split);
80-
PHP_FUNCTION(mb_strlen);
81-
PHP_FUNCTION(mb_strpos);
82-
PHP_FUNCTION(mb_strrpos);
83-
PHP_FUNCTION(mb_stripos);
84-
PHP_FUNCTION(mb_strripos);
85-
PHP_FUNCTION(mb_strstr);
86-
PHP_FUNCTION(mb_strrchr);
87-
PHP_FUNCTION(mb_stristr);
88-
PHP_FUNCTION(mb_strrichr);
89-
PHP_FUNCTION(mb_substr_count);
90-
PHP_FUNCTION(mb_substr);
91-
PHP_FUNCTION(mb_strcut);
92-
PHP_FUNCTION(mb_strwidth);
93-
PHP_FUNCTION(mb_strimwidth);
94-
PHP_FUNCTION(mb_convert_encoding);
95-
PHP_FUNCTION(mb_detect_encoding);
96-
PHP_FUNCTION(mb_list_encodings);
97-
PHP_FUNCTION(mb_encoding_aliases);
98-
PHP_FUNCTION(mb_convert_kana);
99-
PHP_FUNCTION(mb_encode_mimeheader);
100-
PHP_FUNCTION(mb_decode_mimeheader);
101-
PHP_FUNCTION(mb_convert_variables);
102-
PHP_FUNCTION(mb_encode_numericentity);
103-
PHP_FUNCTION(mb_decode_numericentity);
104-
PHP_FUNCTION(mb_send_mail);
105-
PHP_FUNCTION(mb_get_info);
106-
PHP_FUNCTION(mb_check_encoding);
107-
PHP_FUNCTION(mb_ord);
108-
PHP_FUNCTION(mb_chr);
109-
PHP_FUNCTION(mb_scrub);
110-
111-
11264
MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
11365
size_t nbytes, const mbfl_encoding *enc);
11466
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,

ext/mbstring/mbstring.stub.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
/** @generate-function-entries */
4+
35
function mb_language(string $language = UNKNOWN): string|bool {}
46

57
function mb_internal_encoding(string $encoding = UNKNOWN): string|bool {}

0 commit comments

Comments
 (0)