summaryrefslogtreecommitdiff
path: root/ext/intl/php_intl.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2019-10-12 21:53:15 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-01-03 18:54:57 +0100
commite08ce4c13db6e9aecd3497cd270b72d06c649bc7 (patch)
tree63fe5d863089e59de4bea641b183fe4138d73fb3 /ext/intl/php_intl.c
parentbb3946a5e25a9b0b05883242de2ef722926eda10 (diff)
downloadphp-git-e08ce4c13db6e9aecd3497cd270b72d06c649bc7.tar.gz
Add stubs for various intl functions
Closes GH-4819 - Add stubs for idn functions - Add stubs for grapheme functions - Add stubs for Spoofchecker - Add stubs for Normalizer - Add stubs for ResourceBundle - Fix arginfos - Add support for union return types - Fix arginfo for resourcebundle_create()
Diffstat (limited to 'ext/intl/php_intl.c')
-rw-r--r--ext/intl/php_intl.c118
1 files changed, 23 insertions, 95 deletions
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 95481aab79..9d963449a5 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -42,6 +42,7 @@
#include "formatter/formatter_parse.h"
#include "grapheme/grapheme.h"
+#include "grapheme/grapheme_arginfo.h"
#include "msgformat/msgformat.h"
#include "msgformat/msgformat_class.h"
@@ -52,6 +53,7 @@
#include "normalizer/normalizer.h"
#include "normalizer/normalizer_class.h"
#include "normalizer/normalizer_normalize.h"
+#include "normalizer/normalizer_arginfo.h"
#include "locale/locale.h"
#include "locale/locale_class.h"
@@ -68,6 +70,7 @@
#include "dateformat/dateformat_data.h"
#include "resourcebundle/resourcebundle_class.h"
+#include "resourcebundle/resourcebundle_arginfo.h"
#include "transliterator/transliterator.h"
#include "transliterator/transliterator_class.h"
@@ -85,6 +88,7 @@
#include "breakiterator/breakiterator_iterators.h"
#include "idn/idn.h"
+#include "idn/idn_arginfo.h"
#include "uchar/uchar.h"
# include "spoofchecker/spoofchecker_class.h"
@@ -173,47 +177,6 @@ ZEND_END_ARG_INFO()
#define intl_0_args collator_static_0_args
#define intl_1_arg collator_static_1_arg
-ZEND_BEGIN_ARG_INFO_EX(normalizer_args, 0, 0, 1)
- ZEND_ARG_INFO(0, input)
- ZEND_ARG_INFO(0, form)
-ZEND_END_ARG_INFO()
-
-#if U_ICU_VERSION_MAJOR_NUM >= 56
-ZEND_BEGIN_ARG_INFO_EX(decomposition_args, 0, 0, 1)
- ZEND_ARG_INFO(0, input)
-ZEND_END_ARG_INFO();
-#endif
-
-ZEND_BEGIN_ARG_INFO_EX(grapheme_1_arg, 0, 0, 1)
- ZEND_ARG_INFO(0, string)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(grapheme_search_args, 0, 0, 2)
- ZEND_ARG_INFO(0, haystack)
- ZEND_ARG_INFO(0, needle)
- ZEND_ARG_INFO(0, offset)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(grapheme_substr_args, 0, 0, 2)
- ZEND_ARG_INFO(0, string)
- ZEND_ARG_INFO(0, start)
- ZEND_ARG_INFO(0, length)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(grapheme_strstr_args, 0, 0, 2)
- ZEND_ARG_INFO(0, haystack)
- ZEND_ARG_INFO(0, needle)
- ZEND_ARG_INFO(0, before_needle)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(grapheme_extract_args, 0, 0, 2)
- ZEND_ARG_INFO(0, arg1)
- ZEND_ARG_INFO(0, arg2)
- ZEND_ARG_INFO(0, arg3)
- ZEND_ARG_INFO(0, arg4)
- ZEND_ARG_INFO(1, arg5) /* 1 = pass by reference */
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO_EX(datefmt_parse_args, 0, 0, 2)
ZEND_ARG_INFO(0, formatter)
ZEND_ARG_INFO(0, string)
@@ -349,41 +312,6 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_datefmt_create, 0, 0, 3)
ZEND_ARG_INFO(0, pattern)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_idn_to_ascii, 0, 0, 1)
- ZEND_ARG_INFO(0, domain)
- ZEND_ARG_INFO(0, option)
- ZEND_ARG_INFO(0, variant)
- ZEND_ARG_INFO(1, idn_info)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_create_proc, 0, 0, 2 )
- ZEND_ARG_INFO( 0, locale )
- ZEND_ARG_INFO( 0, bundlename )
- ZEND_ARG_INFO( 0, fallback )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_proc, 0, 0, 2 )
- ZEND_ARG_INFO( 0, bundle )
- ZEND_ARG_INFO( 0, index )
- ZEND_ARG_INFO( 0, fallback )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_count_proc, 0, 0, 1 )
- ZEND_ARG_INFO( 0, bundle )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_locales_proc, 0, 0, 1 )
- ZEND_ARG_INFO( 0, bundlename )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_code_proc, 0, 0, 1 )
- ZEND_ARG_INFO( 0, bundle )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_resourcebundle_get_error_message_proc, 0, 0, 1 )
- ZEND_ARG_INFO( 0, bundle )
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO_EX( arginfo_transliterator_void, 0, 0, 0 )
ZEND_END_ARG_INFO()
@@ -583,10 +511,10 @@ static const zend_function_entry intl_functions[] = {
PHP_FE( numfmt_get_error_message, arginfo_numfmt_get_error_code )
/* normalizer functions */
- PHP_FE( normalizer_normalize, normalizer_args )
- PHP_FE( normalizer_is_normalized, normalizer_args )
+ PHP_FE( normalizer_normalize, arginfo_normalizer_normalize )
+ PHP_FE( normalizer_is_normalized, arginfo_normalizer_is_normalized )
#if U_ICU_VERSION_MAJOR_NUM >= 56
- PHP_FE( normalizer_get_raw_decomposition, decomposition_args )
+ PHP_FE( normalizer_get_raw_decomposition, arginfo_normalizer_get_raw_decomposition )
#endif
/* Locale functions */
@@ -644,27 +572,27 @@ static const zend_function_entry intl_functions[] = {
PHP_FE( datefmt_get_error_message, arginfo_msgfmt_get_error_message )
/* grapheme functions */
- PHP_FE( grapheme_strlen, grapheme_1_arg )
- PHP_FE( grapheme_strpos, grapheme_search_args )
- PHP_FE( grapheme_stripos, grapheme_search_args )
- PHP_FE( grapheme_strrpos, grapheme_search_args )
- PHP_FE( grapheme_strripos, grapheme_search_args )
- PHP_FE( grapheme_substr, grapheme_substr_args )
- PHP_FE( grapheme_strstr, grapheme_strstr_args )
- PHP_FE( grapheme_stristr, grapheme_strstr_args )
- PHP_FE( grapheme_extract, grapheme_extract_args )
+ PHP_FE( grapheme_strlen, arginfo_grapheme_strlen )
+ PHP_FE( grapheme_strpos, arginfo_grapheme_strpos )
+ PHP_FE( grapheme_stripos, arginfo_grapheme_stripos )
+ PHP_FE( grapheme_strrpos, arginfo_grapheme_strrpos )
+ PHP_FE( grapheme_strripos, arginfo_grapheme_strripos )
+ PHP_FE( grapheme_substr, arginfo_grapheme_substr )
+ PHP_FE( grapheme_strstr, arginfo_grapheme_strstr )
+ PHP_FE( grapheme_stristr, arginfo_grapheme_stristr )
+ PHP_FE( grapheme_extract, arginfo_grapheme_extract )
/* IDN functions */
PHP_FE( idn_to_ascii, arginfo_idn_to_ascii)
- PHP_FE( idn_to_utf8, arginfo_idn_to_ascii)
+ PHP_FE( idn_to_utf8, arginfo_idn_to_utf8)
/* ResourceBundle functions */
- PHP_FE( resourcebundle_create, arginfo_resourcebundle_create_proc )
- PHP_FE( resourcebundle_get, arginfo_resourcebundle_get_proc )
- PHP_FE( resourcebundle_count, arginfo_resourcebundle_count_proc )
- PHP_FE( resourcebundle_locales, arginfo_resourcebundle_locales_proc )
- PHP_FE( resourcebundle_get_error_code, arginfo_resourcebundle_get_error_code_proc )
- PHP_FE( resourcebundle_get_error_message, arginfo_resourcebundle_get_error_message_proc )
+ PHP_FE( resourcebundle_create, arginfo_resourcebundle_create )
+ PHP_FE( resourcebundle_get, arginfo_resourcebundle_get )
+ PHP_FE( resourcebundle_count, arginfo_resourcebundle_count )
+ PHP_FE( resourcebundle_locales, arginfo_resourcebundle_locales )
+ PHP_FE( resourcebundle_get_error_code, arginfo_resourcebundle_get_error_code )
+ PHP_FE( resourcebundle_get_error_message, arginfo_resourcebundle_get_error_message )
/* Transliterator functions */
PHP_FE( transliterator_create, arginfo_transliterator_create )