summaryrefslogtreecommitdiff
path: root/ext/intl/php_intl.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/php_intl.c')
-rw-r--r--ext/intl/php_intl.c286
1 files changed, 67 insertions, 219 deletions
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index b244a29842..9d963449a5 100644
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -1,7 +1,5 @@
/*
+----------------------------------------------------------------------+
- | PHP Version 7 |
- +----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
@@ -44,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"
@@ -54,10 +53,12 @@
#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"
#include "locale/locale_methods.h"
+#include "locale/locale_arginfo.h"
#include "dateformat/dateformat.h"
#include "dateformat/dateformat_class.h"
@@ -69,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"
@@ -76,6 +78,7 @@
#include "timezone/timezone_class.h"
#include "timezone/timezone_methods.h"
+#include "timezone/timezone_arginfo.h"
#include "calendar/calendar_class.h"
#include "calendar/calendar_methods.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"
@@ -170,75 +174,9 @@ ZEND_BEGIN_ARG_INFO_EX(numfmt_parse_currency_arginfo, 0, 0, 3)
ZEND_ARG_INFO(1, position)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX( locale_get_loc_in_loc_args, 0, ZEND_RETURN_VALUE, 1 )
- ZEND_ARG_INFO(0, locale)
- ZEND_ARG_INFO(0, in_locale)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( locale_filter_matches_args, 0, ZEND_RETURN_VALUE, 2 )
- ZEND_ARG_INFO(0, langtag)
- ZEND_ARG_INFO(0, locale)
- ZEND_ARG_INFO(0, canonicalize)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( locale_lookup_args, 0, ZEND_RETURN_VALUE, 2 )
- ZEND_ARG_INFO(0, langtag)
- ZEND_ARG_INFO(0, locale)
- ZEND_ARG_INFO(0, canonicalize)
- ZEND_ARG_INFO(0, def)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(locale_0_args, 0, 0, 0)
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX(locale_1_arg, 0, 0, 1)
- ZEND_ARG_INFO(0, arg1)
-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)
@@ -323,7 +261,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_msgfmt_parse, 0, 0, 2)
ZEND_ARG_INFO(0, source)
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX(arginfo_numfmt_parse_message, 0, 0, 3)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_msgfmt_parse_message, 0, 0, 3)
ZEND_ARG_INFO(0, locale)
ZEND_ARG_INFO(0, pattern)
ZEND_ARG_INFO(0, source)
@@ -374,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()
@@ -437,61 +340,6 @@ ZEND_BEGIN_ARG_INFO_EX( arginfo_transliterator_error, 0, 0, 1 )
ZEND_ARG_OBJ_INFO( 0, trans, Transliterator, 0 )
ZEND_END_ARG_INFO()
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_idarg_static, 0, 0, 1 )
- ZEND_ARG_INFO( 0, zoneId )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_from_date_time_zone, 0, 0, 1 )
- ZEND_ARG_OBJ_INFO( 0, dateTimeZone, DateTimeZone, 0 )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_create_enumeration, 0, 0, 0 )
- ZEND_ARG_INFO( 0, countryOrRawOffset )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_create_time_zone_id_enumeration, 0, 0, 1 )
- ZEND_ARG_INFO( 0, zoneType )
- ZEND_ARG_INFO( 0, region )
- ZEND_ARG_INFO( 0, rawOffset )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_get_canonical_id, 0, 0, 1 )
- ZEND_ARG_INFO( 0, zoneId )
- ZEND_ARG_INFO( 1, isSystemID )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_get_equivalent_id, 0, 0, 2 )
- ZEND_ARG_INFO( 0, zoneId )
- ZEND_ARG_INFO( 0, index )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_get_offset, 0, 0, 5 )
- ZEND_ARG_OBJ_INFO( 0, timeZone, IntlTimeZone, 0 )
- ZEND_ARG_INFO( 0, date )
- ZEND_ARG_INFO( 0, local )
- ZEND_ARG_INFO( 1, rawOffset )
- ZEND_ARG_INFO( 1, dstOffset )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_has_same_rules, 0, 0, 1 )
- ZEND_ARG_OBJ_INFO( 0, timeZone, IntlTimeZone, 0 )
- ZEND_ARG_OBJ_INFO( 0, otherTimeZone, IntlTimeZone, 0 )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_get_display_name, 0, 0, 1 )
- ZEND_ARG_OBJ_INFO( 0, timeZone, IntlTimeZone, 0 )
- ZEND_ARG_INFO( 0, isDaylight )
- ZEND_ARG_INFO( 0, style )
- ZEND_ARG_INFO( 0, locale )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_only_tz, 0, 0, 1 )
- ZEND_ARG_OBJ_INFO( 0, timeZone, IntlTimeZone, 0 )
-ZEND_END_ARG_INFO()
-
-ZEND_BEGIN_ARG_INFO_EX( arginfo_tz_void, 0, 0, 0 )
-ZEND_END_ARG_INFO()
-
ZEND_BEGIN_ARG_INFO_EX( ainfo_cal_create_instance, 0, 0, 0 )
ZEND_ARG_INFO( 0, timeZone )
ZEND_ARG_INFO( 0, locale )
@@ -663,38 +511,38 @@ 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 */
- PHP_NAMED_FE( locale_get_default, zif_locale_get_default, locale_0_args )
- PHP_NAMED_FE( locale_set_default, zif_locale_set_default, locale_1_arg )
- PHP_FE( locale_get_primary_language, locale_1_arg )
- PHP_FE( locale_get_script, locale_1_arg )
- PHP_FE( locale_get_region, locale_1_arg )
- PHP_FE( locale_get_keywords, locale_1_arg )
- PHP_FE( locale_get_display_script, locale_get_loc_in_loc_args )
- PHP_FE( locale_get_display_region, locale_get_loc_in_loc_args )
- PHP_FE( locale_get_display_name, locale_get_loc_in_loc_args )
- PHP_FE( locale_get_display_language, locale_get_loc_in_loc_args)
- PHP_FE( locale_get_display_variant, locale_get_loc_in_loc_args )
- PHP_FE( locale_compose, locale_1_arg )
- PHP_FE( locale_parse, locale_1_arg )
- PHP_FE( locale_get_all_variants, locale_1_arg )
- PHP_FE( locale_filter_matches, locale_filter_matches_args )
- PHP_FE( locale_canonicalize, locale_1_arg )
- PHP_FE( locale_lookup, locale_lookup_args )
- PHP_FE( locale_accept_from_http, locale_1_arg )
+ PHP_NAMED_FE( locale_get_default, zif_locale_get_default, arginfo_locale_get_default )
+ PHP_NAMED_FE( locale_set_default, zif_locale_set_default, arginfo_locale_set_default )
+ PHP_FE( locale_get_primary_language, arginfo_locale_get_primary_language )
+ PHP_FE( locale_get_script, arginfo_locale_get_script )
+ PHP_FE( locale_get_region, arginfo_locale_get_region )
+ PHP_FE( locale_get_keywords, arginfo_locale_get_keywords )
+ PHP_FE( locale_get_display_script, arginfo_locale_get_display_script )
+ PHP_FE( locale_get_display_region, arginfo_locale_get_display_region )
+ PHP_FE( locale_get_display_name, arginfo_locale_get_display_name )
+ PHP_FE( locale_get_display_language, arginfo_locale_get_display_language)
+ PHP_FE( locale_get_display_variant, arginfo_locale_get_display_variant )
+ PHP_FE( locale_compose, arginfo_locale_compose )
+ PHP_FE( locale_parse, arginfo_locale_parse )
+ PHP_FE( locale_get_all_variants, arginfo_locale_get_all_variants )
+ PHP_FE( locale_filter_matches, arginfo_locale_filter_matches )
+ PHP_FE( locale_canonicalize, arginfo_locale_canonicalize )
+ PHP_FE( locale_lookup, arginfo_locale_lookup )
+ PHP_FE( locale_accept_from_http, arginfo_locale_accept_from_http )
/* MessageFormatter functions */
PHP_FE( msgfmt_create, arginfo_msgfmt_create )
PHP_FE( msgfmt_format, arginfo_msgfmt_format )
PHP_FE( msgfmt_format_message, arginfo_msgfmt_format_message )
PHP_FE( msgfmt_parse, arginfo_msgfmt_parse )
- PHP_FE( msgfmt_parse_message, arginfo_numfmt_parse_message )
+ PHP_FE( msgfmt_parse_message, arginfo_msgfmt_parse_message )
PHP_FE( msgfmt_set_pattern, arginfo_msgfmt_set_pattern )
PHP_FE( msgfmt_get_pattern, arginfo_msgfmt_get_locale )
PHP_FE( msgfmt_get_locale, arginfo_msgfmt_get_locale )
@@ -724,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 )
@@ -756,28 +604,28 @@ static const zend_function_entry intl_functions[] = {
PHP_FE( transliterator_get_error_message, arginfo_transliterator_error )
/* TimeZone functions */
- PHP_FE( intltz_create_time_zone, arginfo_tz_idarg_static )
- PHP_FE( intltz_from_date_time_zone, arginfo_tz_from_date_time_zone )
- PHP_FE( intltz_create_default, arginfo_tz_void )
- PHP_FE( intltz_get_id, arginfo_tz_only_tz )
- PHP_FE( intltz_get_gmt, arginfo_tz_void )
- PHP_FE( intltz_get_unknown, arginfo_tz_void )
- PHP_FE( intltz_create_enumeration, arginfo_tz_create_enumeration )
- PHP_FE( intltz_count_equivalent_ids, arginfo_tz_idarg_static )
- PHP_FE( intltz_create_time_zone_id_enumeration, arginfo_tz_create_time_zone_id_enumeration )
- PHP_FE( intltz_get_canonical_id, arginfo_tz_get_canonical_id )
- PHP_FE( intltz_get_region, arginfo_tz_idarg_static )
- PHP_FE( intltz_get_tz_data_version, arginfo_tz_void )
- PHP_FE( intltz_get_equivalent_id, arginfo_tz_get_equivalent_id )
- PHP_FE( intltz_use_daylight_time, arginfo_tz_only_tz )
- PHP_FE( intltz_get_offset, arginfo_tz_get_offset )
- PHP_FE( intltz_get_raw_offset, arginfo_tz_only_tz )
- PHP_FE( intltz_has_same_rules, arginfo_tz_has_same_rules )
- PHP_FE( intltz_get_display_name, arginfo_tz_get_display_name )
- PHP_FE( intltz_get_dst_savings, arginfo_tz_only_tz )
- PHP_FE( intltz_to_date_time_zone, arginfo_tz_only_tz )
- PHP_FE( intltz_get_error_code, arginfo_tz_only_tz )
- PHP_FE( intltz_get_error_message, arginfo_tz_only_tz )
+ PHP_FE( intltz_create_time_zone, arginfo_intltz_create_time_zone )
+ PHP_FE( intltz_from_date_time_zone, arginfo_intltz_from_date_time_zone )
+ PHP_FE( intltz_create_default, arginfo_intltz_create_default )
+ PHP_FE( intltz_get_id, arginfo_intltz_get_id )
+ PHP_FE( intltz_get_gmt, arginfo_intltz_get_gmt )
+ PHP_FE( intltz_get_unknown, arginfo_intltz_get_unknown )
+ PHP_FE( intltz_create_enumeration, arginfo_intltz_create_enumeration )
+ PHP_FE( intltz_count_equivalent_ids, arginfo_intltz_count_equivalent_ids )
+ PHP_FE( intltz_create_time_zone_id_enumeration, arginfo_intltz_create_time_zone_id_enumeration )
+ PHP_FE( intltz_get_canonical_id, arginfo_intltz_get_canonical_id )
+ PHP_FE( intltz_get_region, arginfo_intltz_get_region )
+ PHP_FE( intltz_get_tz_data_version, arginfo_intltz_get_tz_data_version )
+ PHP_FE( intltz_get_equivalent_id, arginfo_intltz_get_equivalent_id )
+ PHP_FE( intltz_use_daylight_time, arginfo_intltz_use_daylight_time )
+ PHP_FE( intltz_get_offset, arginfo_intltz_get_offset )
+ PHP_FE( intltz_get_raw_offset, arginfo_intltz_get_raw_offset )
+ PHP_FE( intltz_has_same_rules, arginfo_intltz_has_same_rules )
+ PHP_FE( intltz_get_display_name, arginfo_intltz_get_display_name )
+ PHP_FE( intltz_get_dst_savings, arginfo_intltz_get_dst_savings )
+ PHP_FE( intltz_to_date_time_zone, arginfo_intltz_to_date_time_zone )
+ PHP_FE( intltz_get_error_code, arginfo_intltz_get_error_code )
+ PHP_FE( intltz_get_error_message, arginfo_intltz_get_error_message )
PHP_FE( intlcal_create_instance, ainfo_cal_create_instance )
PHP_FE( intlcal_get_keyword_values_for_locale, ainfo_cal_get_keyword_values_for_locale )