summaryrefslogtreecommitdiff
path: root/ext/iconv
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-04-04 23:51:10 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-04-05 00:59:44 +0200
commit5322de1ba8428c0231c972586217f9b1b705c45d (patch)
tree0cedf1dbe6b67a5e49382480f996f7456bc46f61 /ext/iconv
parentd5bbb28f7d9d0621263be5073102cd1a32170cd1 (diff)
downloadphp-git-5322de1ba8428c0231c972586217f9b1b705c45d.tar.gz
Generate functions entries from stubs for another set of extensions
Closes GH-5351
Diffstat (limited to 'ext/iconv')
-rw-r--r--ext/iconv/iconv.c21
-rw-r--r--ext/iconv/iconv.stub.php2
-rw-r--r--ext/iconv/iconv_arginfo.h27
3 files changed, 31 insertions, 19 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 80af1dc8b9..7cda884a65 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -56,23 +56,6 @@
#define _php_iconv_memequal(a, b, c) \
(memcmp(a, b, c) == 0)
-/* {{{ iconv_functions[]
- */
-static const zend_function_entry iconv_functions[] = {
- PHP_RAW_NAMED_FE(iconv,php_if_iconv, arginfo_iconv)
- PHP_FE(iconv_get_encoding, arginfo_iconv_get_encoding)
- PHP_FE(iconv_set_encoding, arginfo_iconv_set_encoding)
- PHP_FE(iconv_strlen, arginfo_iconv_strlen)
- PHP_FE(iconv_substr, arginfo_iconv_substr)
- PHP_FE(iconv_strpos, arginfo_iconv_strpos)
- PHP_FE(iconv_strrpos, arginfo_iconv_strrpos)
- PHP_FE(iconv_mime_encode, arginfo_iconv_mime_encode)
- PHP_FE(iconv_mime_decode, arginfo_iconv_mime_decode)
- PHP_FE(iconv_mime_decode_headers, arginfo_iconv_mime_decode_headers)
- PHP_FE_END
-};
-/* }}} */
-
ZEND_DECLARE_MODULE_GLOBALS(iconv)
static PHP_GINIT_FUNCTION(iconv);
@@ -81,7 +64,7 @@ static PHP_GINIT_FUNCTION(iconv);
zend_module_entry iconv_module_entry = {
STANDARD_MODULE_HEADER,
"iconv",
- iconv_functions,
+ ext_functions,
PHP_MINIT(miconv),
PHP_MSHUTDOWN(miconv),
NULL,
@@ -2249,7 +2232,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
/* {{{ proto string iconv(string in_charset, string out_charset, string str)
Returns str converted to the out_charset character set */
-PHP_NAMED_FUNCTION(php_if_iconv)
+PHP_FUNCTION(iconv)
{
char *in_charset, *out_charset;
zend_string *in_buffer;
diff --git a/ext/iconv/iconv.stub.php b/ext/iconv/iconv.stub.php
index cd9bab3ad0..ae2a0fa0cb 100644
--- a/ext/iconv/iconv.stub.php
+++ b/ext/iconv/iconv.stub.php
@@ -1,5 +1,7 @@
<?php
+/** @generate-function-entries */
+
function iconv_strlen(string $str, string $charset = UNKNOWN): int|false {}
function iconv_substr(string $str, int $offset, ?int $length = null, string $charset = UNKNOWN): string|false {}
diff --git a/ext/iconv/iconv_arginfo.h b/ext/iconv/iconv_arginfo.h
index 51f11cf794..3a05ba633f 100644
--- a/ext/iconv/iconv_arginfo.h
+++ b/ext/iconv/iconv_arginfo.h
@@ -57,3 +57,30 @@ ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_iconv_get_encoding, 0, 0, MAY_BE_ARRAY|MAY_BE_STRING|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, type, IS_STRING, 0)
ZEND_END_ARG_INFO()
+
+
+ZEND_FUNCTION(iconv_strlen);
+ZEND_FUNCTION(iconv_substr);
+ZEND_FUNCTION(iconv_strpos);
+ZEND_FUNCTION(iconv_strrpos);
+ZEND_FUNCTION(iconv_mime_encode);
+ZEND_FUNCTION(iconv_mime_decode);
+ZEND_FUNCTION(iconv_mime_decode_headers);
+ZEND_FUNCTION(iconv);
+ZEND_FUNCTION(iconv_set_encoding);
+ZEND_FUNCTION(iconv_get_encoding);
+
+
+static const zend_function_entry ext_functions[] = {
+ ZEND_FE(iconv_strlen, arginfo_iconv_strlen)
+ ZEND_FE(iconv_substr, arginfo_iconv_substr)
+ ZEND_FE(iconv_strpos, arginfo_iconv_strpos)
+ ZEND_FE(iconv_strrpos, arginfo_iconv_strrpos)
+ ZEND_FE(iconv_mime_encode, arginfo_iconv_mime_encode)
+ ZEND_FE(iconv_mime_decode, arginfo_iconv_mime_decode)
+ ZEND_FE(iconv_mime_decode_headers, arginfo_iconv_mime_decode_headers)
+ ZEND_FE(iconv, arginfo_iconv)
+ ZEND_FE(iconv_set_encoding, arginfo_iconv_set_encoding)
+ ZEND_FE(iconv_get_encoding, arginfo_iconv_get_encoding)
+ ZEND_FE_END
+};