Skip to content

Generate function entries for another batch of extensions #5352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 8 additions & 28 deletions ext/libxml/libxml.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ static HashTable php_libxml_exports;
static ZEND_DECLARE_MODULE_GLOBALS(libxml)
static PHP_GINIT_FUNCTION(libxml);

static PHP_FUNCTION(libxml_set_streams_context);
static PHP_FUNCTION(libxml_use_internal_errors);
static PHP_FUNCTION(libxml_get_last_error);
static PHP_FUNCTION(libxml_clear_errors);
static PHP_FUNCTION(libxml_get_errors);
static PHP_FUNCTION(libxml_set_external_entity_loader);
static PHP_FUNCTION(libxml_disable_entity_loader);

static zend_class_entry *libxmlerror_class_entry;

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

/* }}} */

/* {{{ extension definition structures */
static const zend_function_entry libxml_functions[] = {
PHP_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context)
PHP_FE(libxml_use_internal_errors, arginfo_libxml_use_internal_errors)
PHP_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
PHP_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
PHP_FE(libxml_get_errors, arginfo_libxml_get_errors)
PHP_FE(libxml_disable_entity_loader, arginfo_libxml_disable_entity_loader)
PHP_FE(libxml_set_external_entity_loader, arginfo_libxml_set_external_entity_loader)
PHP_FE_END
};

zend_module_entry libxml_module_entry = {
STANDARD_MODULE_HEADER,
"libxml", /* extension name */
libxml_functions, /* extension function list */
ext_functions, /* extension function list */
PHP_MINIT(libxml), /* extension-wide startup function */
PHP_MSHUTDOWN(libxml), /* extension-wide shutdown function */
PHP_RINIT(libxml), /* per-request startup function */
Expand Down Expand Up @@ -913,7 +893,7 @@ static PHP_MINFO_FUNCTION(libxml)

/* {{{ proto void libxml_set_streams_context(resource streams_context)
Set the streams context for the next libxml document load or write */
static PHP_FUNCTION(libxml_set_streams_context)
PHP_FUNCTION(libxml_set_streams_context)
{
zval *arg;

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

/* {{{ proto bool libxml_use_internal_errors([boolean use_errors])
Disable libxml errors and allow user to fetch error information as needed */
static PHP_FUNCTION(libxml_use_internal_errors)
PHP_FUNCTION(libxml_use_internal_errors)
{
xmlStructuredErrorFunc current_handler;
zend_bool use_errors=0, retval;
Expand Down Expand Up @@ -972,7 +952,7 @@ static PHP_FUNCTION(libxml_use_internal_errors)

/* {{{ proto object libxml_get_last_error()
Retrieve last error from libxml */
static PHP_FUNCTION(libxml_get_last_error)
PHP_FUNCTION(libxml_get_last_error)
{
xmlErrorPtr error;

Expand Down Expand Up @@ -1004,7 +984,7 @@ static PHP_FUNCTION(libxml_get_last_error)

/* {{{ proto object libxml_get_errors()
Retrieve array of errors */
static PHP_FUNCTION(libxml_get_errors)
PHP_FUNCTION(libxml_get_errors)
{

xmlErrorPtr error;
Expand Down Expand Up @@ -1046,7 +1026,7 @@ static PHP_FUNCTION(libxml_get_errors)

/* {{{ proto void libxml_clear_errors()
Clear last error from libxml */
static PHP_FUNCTION(libxml_clear_errors)
PHP_FUNCTION(libxml_clear_errors)
{
ZEND_PARSE_PARAMETERS_NONE();

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

/* {{{ proto bool libxml_disable_entity_loader([boolean disable])
Disable/Enable ability to load external entities */
static PHP_FUNCTION(libxml_disable_entity_loader)
PHP_FUNCTION(libxml_disable_entity_loader)
{
zend_bool disable = 1;

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

/* {{{ proto void libxml_set_external_entity_loader(callback resolver_function)
Changes the default external entity loader */
static PHP_FUNCTION(libxml_set_external_entity_loader)
PHP_FUNCTION(libxml_set_external_entity_loader)
{
zend_fcall_info fci;
zend_fcall_info_cache fcc;
Expand Down
2 changes: 2 additions & 0 deletions ext/libxml/libxml.stub.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @generate-function-entries */

/** @param resource $context */
function libxml_set_streams_context($context): void {}

Expand Down
21 changes: 21 additions & 0 deletions ext/libxml/libxml_arginfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,24 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_libxml_set_external_entity_loader, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, resolver_function, IS_CALLABLE, 1)
ZEND_END_ARG_INFO()


ZEND_FUNCTION(libxml_set_streams_context);
ZEND_FUNCTION(libxml_use_internal_errors);
ZEND_FUNCTION(libxml_get_last_error);
ZEND_FUNCTION(libxml_get_errors);
ZEND_FUNCTION(libxml_clear_errors);
ZEND_FUNCTION(libxml_disable_entity_loader);
ZEND_FUNCTION(libxml_set_external_entity_loader);


static const zend_function_entry ext_functions[] = {
ZEND_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context)
ZEND_FE(libxml_use_internal_errors, arginfo_libxml_use_internal_errors)
ZEND_FE(libxml_get_last_error, arginfo_libxml_get_last_error)
ZEND_FE(libxml_get_errors, arginfo_libxml_get_errors)
ZEND_FE(libxml_clear_errors, arginfo_libxml_clear_errors)
ZEND_FE(libxml_disable_entity_loader, arginfo_libxml_disable_entity_loader)
ZEND_FE(libxml_set_external_entity_loader, arginfo_libxml_set_external_entity_loader)
ZEND_FE_END
};
54 changes: 1 addition & 53 deletions ext/mbstring/mbstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,63 +182,11 @@ static const php_mb_nls_ident_list php_mb_default_identify_list[] = {

/* }}} */

/* {{{ zend_function_entry mbstring_functions[] */
static const zend_function_entry mbstring_functions[] = {
PHP_FE(mb_convert_case, arginfo_mb_convert_case)
PHP_FE(mb_strtoupper, arginfo_mb_strtoupper)
PHP_FE(mb_strtolower, arginfo_mb_strtolower)
PHP_FE(mb_language, arginfo_mb_language)
PHP_FE(mb_internal_encoding, arginfo_mb_internal_encoding)
PHP_FE(mb_http_input, arginfo_mb_http_input)
PHP_FE(mb_http_output, arginfo_mb_http_output)
PHP_FE(mb_detect_order, arginfo_mb_detect_order)
PHP_FE(mb_substitute_character, arginfo_mb_substitute_character)
PHP_FE(mb_parse_str, arginfo_mb_parse_str)
PHP_FE(mb_output_handler, arginfo_mb_output_handler)
PHP_FE(mb_preferred_mime_name, arginfo_mb_preferred_mime_name)
PHP_FE(mb_str_split, arginfo_mb_str_split)
PHP_FE(mb_strlen, arginfo_mb_strlen)
PHP_FE(mb_strpos, arginfo_mb_strpos)
PHP_FE(mb_strrpos, arginfo_mb_strrpos)
PHP_FE(mb_stripos, arginfo_mb_stripos)
PHP_FE(mb_strripos, arginfo_mb_strripos)
PHP_FE(mb_strstr, arginfo_mb_strstr)
PHP_FE(mb_strrchr, arginfo_mb_strrchr)
PHP_FE(mb_stristr, arginfo_mb_stristr)
PHP_FE(mb_strrichr, arginfo_mb_strrichr)
PHP_FE(mb_substr_count, arginfo_mb_substr_count)
PHP_FE(mb_substr, arginfo_mb_substr)
PHP_FE(mb_strcut, arginfo_mb_strcut)
PHP_FE(mb_strwidth, arginfo_mb_strwidth)
PHP_FE(mb_strimwidth, arginfo_mb_strimwidth)
PHP_FE(mb_convert_encoding, arginfo_mb_convert_encoding)
PHP_FE(mb_detect_encoding, arginfo_mb_detect_encoding)
PHP_FE(mb_list_encodings, arginfo_mb_list_encodings)
PHP_FE(mb_encoding_aliases, arginfo_mb_encoding_aliases)
PHP_FE(mb_convert_kana, arginfo_mb_convert_kana)
PHP_FE(mb_encode_mimeheader, arginfo_mb_encode_mimeheader)
PHP_FE(mb_decode_mimeheader, arginfo_mb_decode_mimeheader)
PHP_FE(mb_convert_variables, arginfo_mb_convert_variables)
PHP_FE(mb_encode_numericentity, arginfo_mb_encode_numericentity)
PHP_FE(mb_decode_numericentity, arginfo_mb_decode_numericentity)
PHP_FE(mb_send_mail, arginfo_mb_send_mail)
PHP_FE(mb_get_info, arginfo_mb_get_info)
PHP_FE(mb_check_encoding, arginfo_mb_check_encoding)
PHP_FE(mb_ord, arginfo_mb_ord)
PHP_FE(mb_chr, arginfo_mb_chr)
PHP_FE(mb_scrub, arginfo_mb_scrub)
#if HAVE_MBREGEX
PHP_MBREGEX_FUNCTION_ENTRIES
#endif
PHP_FE_END
};
/* }}} */

/* {{{ zend_module_entry mbstring_module_entry */
zend_module_entry mbstring_module_entry = {
STANDARD_MODULE_HEADER,
"mbstring",
mbstring_functions,
ext_functions,
PHP_MINIT(mbstring),
PHP_MSHUTDOWN(mbstring),
PHP_RINIT(mbstring),
Expand Down
48 changes: 0 additions & 48 deletions ext/mbstring/mbstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,54 +61,6 @@ PHP_RINIT_FUNCTION(mbstring);
PHP_RSHUTDOWN_FUNCTION(mbstring);
PHP_MINFO_FUNCTION(mbstring);

/* functions in php_unicode.c */
PHP_FUNCTION(mb_convert_case);
PHP_FUNCTION(mb_strtoupper);
PHP_FUNCTION(mb_strtolower);

/* php function registration */
PHP_FUNCTION(mb_language);
PHP_FUNCTION(mb_internal_encoding);
PHP_FUNCTION(mb_http_input);
PHP_FUNCTION(mb_http_output);
PHP_FUNCTION(mb_detect_order);
PHP_FUNCTION(mb_substitute_character);
PHP_FUNCTION(mb_preferred_mime_name);
PHP_FUNCTION(mb_parse_str);
PHP_FUNCTION(mb_output_handler);
PHP_FUNCTION(mb_str_split);
PHP_FUNCTION(mb_strlen);
PHP_FUNCTION(mb_strpos);
PHP_FUNCTION(mb_strrpos);
PHP_FUNCTION(mb_stripos);
PHP_FUNCTION(mb_strripos);
PHP_FUNCTION(mb_strstr);
PHP_FUNCTION(mb_strrchr);
PHP_FUNCTION(mb_stristr);
PHP_FUNCTION(mb_strrichr);
PHP_FUNCTION(mb_substr_count);
PHP_FUNCTION(mb_substr);
PHP_FUNCTION(mb_strcut);
PHP_FUNCTION(mb_strwidth);
PHP_FUNCTION(mb_strimwidth);
PHP_FUNCTION(mb_convert_encoding);
PHP_FUNCTION(mb_detect_encoding);
PHP_FUNCTION(mb_list_encodings);
PHP_FUNCTION(mb_encoding_aliases);
PHP_FUNCTION(mb_convert_kana);
PHP_FUNCTION(mb_encode_mimeheader);
PHP_FUNCTION(mb_decode_mimeheader);
PHP_FUNCTION(mb_convert_variables);
PHP_FUNCTION(mb_encode_numericentity);
PHP_FUNCTION(mb_decode_numericentity);
PHP_FUNCTION(mb_send_mail);
PHP_FUNCTION(mb_get_info);
PHP_FUNCTION(mb_check_encoding);
PHP_FUNCTION(mb_ord);
PHP_FUNCTION(mb_chr);
PHP_FUNCTION(mb_scrub);


MBSTRING_API char *php_mb_safe_strrchr_ex(const char *s, unsigned int c,
size_t nbytes, const mbfl_encoding *enc);
MBSTRING_API char *php_mb_safe_strrchr(const char *s, unsigned int c,
Expand Down
2 changes: 2 additions & 0 deletions ext/mbstring/mbstring.stub.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

/** @generate-function-entries */

function mb_language(string $language = UNKNOWN): string|bool {}

function mb_internal_encoding(string $encoding = UNKNOWN): string|bool {}
Expand Down
Loading