#include "mb_gpc.h"
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
# include "php_mbregex.h"
# include "php_onig_compat.h"
# include <oniguruma.h>
# undef UChar
-#if ONIGURUMA_VERSION_INT < 60800
+# if !defined(ONIGURUMA_VERSION_INT) || ONIGURUMA_VERSION_INT < 60800
typedef void OnigMatchParam;
#define onig_new_match_param() (NULL)
#define onig_initialize_match_param(x) (void)(x)
onig_search(reg, str, end, start, range, region, option)
#define onig_match_with_param(re, str, end, at, region, option, mp) \
onig_match(re, str, end, at, region, option)
-#endif
+# endif
#else
# include "ext/pcre/php_pcre.h"
#endif
#include "mbstring_arginfo.h"
/* }}} */
-#if HAVE_MBSTRING
+#ifdef HAVE_MBSTRING
/* {{{ prototypes */
ZEND_DECLARE_MODULE_GLOBALS(mbstring)
static int _php_mb_match_regex(void *opaque, const char *str, size_t str_len);
static void _php_mb_free_regex(void *opaque);
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
/* {{{ _php_mb_compile_regex */
static void *_php_mb_compile_regex(const char *pattern)
{
}
MBSTRG(internal_encoding) = encoding;
MBSTRG(current_internal_encoding) = encoding;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
{
const char *enc_name = new_value;
if (FAILURE == php_mb_regex_set_default_mbctype(enc_name)) {
PHP_INI_ALL,
OnUpdateBool,
strict_detection, zend_mbstring_globals, mbstring_globals)
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
STD_PHP_INI_ENTRY("mbstring.regex_stack_limit", "100000",PHP_INI_ALL, OnUpdateLong, regex_stack_limit, zend_mbstring_globals, mbstring_globals)
STD_PHP_INI_ENTRY("mbstring.regex_retry_limit", "1000000",PHP_INI_ALL, OnUpdateLong, regex_retry_limit, zend_mbstring_globals, mbstring_globals)
#endif
mbstring_globals->strict_detection = 0;
mbstring_globals->outconv = NULL;
mbstring_globals->http_output_conv_mimetypes = NULL;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
mbstring_globals->mb_regex_globals = php_mb_regex_globals_alloc();
#endif
mbstring_globals->last_used_encoding_name = NULL;
if (mbstring_globals->http_output_conv_mimetypes) {
_php_mb_free_regex(mbstring_globals->http_output_conv_mimetypes);
}
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
php_mb_regex_globals_free(mbstring_globals->mb_regex_globals);
#endif
}
REGISTER_LONG_CONSTANT("MB_CASE_TITLE_SIMPLE", PHP_UNICODE_CASE_TITLE_SIMPLE, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("MB_CASE_FOLD_SIMPLE", PHP_UNICODE_CASE_FOLD_SIMPLE, CONST_CS | CONST_PERSISTENT);
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_MINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
zend_multibyte_restore_functions();
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_MSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
php_mb_populate_current_detect_order_list();
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_RINIT(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
zend_multibyte_set_internal_encoding((const zend_encoding *)MBSTRG(internal_encoding));
MBSTRG(http_output_set) = 0;
MBSTRG(http_input_set) = 0;
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_RSHUTDOWN(mb_regex) (INIT_FUNC_ARGS_PASSTHRU);
#endif
php_info_print_table_header(1, "mbstring extension makes use of \"streamable kanji code filter and converter\", which is distributed under the GNU Lesser General Public License version 2.1.");
php_info_print_table_end();
-#if HAVE_MBREGEX
+#ifdef HAVE_MBREGEX
PHP_MINFO(mb_regex)(ZEND_MODULE_INFO_FUNC_ARGS_PASSTHRU);
#endif
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_regex_encoding, 0, 0, MAY_BE_STRING|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, encoding, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg, 0, 2, MAY_BE_LONG|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_eregi arginfo_mb_ereg
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace, 0, 3, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, replacement, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_eregi_replace arginfo_mb_ereg_replace
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_replace_callback, 0, 3, MAY_BE_STRING|MAY_BE_FALSE|MAY_BE_NULL)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_split, 0, 2, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_match, 0, 2, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_search, 0, 0, MAY_BE_ARRAY|MAY_BE_BOOL)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, option, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_ereg_search_pos arginfo_mb_ereg_search
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
#define arginfo_mb_ereg_search_regs arginfo_mb_ereg_search
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_init, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, string, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, pattern, IS_STRING, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_mb_ereg_search_getregs, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_getpos, 0, 0, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_ereg_search_setpos, 0, 1, _IS_BOOL, 0)
ZEND_ARG_TYPE_INFO(0, position, IS_LONG, 0)
ZEND_END_ARG_INFO()
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_mb_regex_set_options, 0, 0, IS_STRING, 0)
ZEND_ARG_TYPE_INFO(0, options, IS_STRING, 0)
ZEND_END_ARG_INFO()
ZEND_FUNCTION(mb_scrub);
ZEND_FUNCTION(mb_ord);
ZEND_FUNCTION(mb_chr);
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_regex_encoding);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_eregi);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_replace);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_eregi_replace);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_replace_callback);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_split);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_match);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_pos);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_regs);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_init);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_getregs);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_getpos);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_ereg_search_setpos);
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FUNCTION(mb_regex_set_options);
#endif
ZEND_FE(mb_scrub, arginfo_mb_scrub)
ZEND_FE(mb_ord, arginfo_mb_ord)
ZEND_FE(mb_chr, arginfo_mb_chr)
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_regex_encoding, arginfo_mb_regex_encoding)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg, arginfo_mb_ereg)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_eregi, arginfo_mb_eregi)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_replace, arginfo_mb_ereg_replace)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_eregi_replace, arginfo_mb_eregi_replace)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_replace_callback, arginfo_mb_ereg_replace_callback)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_split, arginfo_mb_split)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_match, arginfo_mb_ereg_match)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search, arginfo_mb_ereg_search)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_pos, arginfo_mb_ereg_search_pos)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_regs, arginfo_mb_ereg_search_regs)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_init, arginfo_mb_ereg_search_init)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_getregs, arginfo_mb_ereg_search_getregs)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_getpos, arginfo_mb_ereg_search_getpos)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_ereg_search_setpos, arginfo_mb_ereg_search_setpos)
#endif
-#if HAVE_MBREGEX
+#if defined(HAVE_MBREGEX)
ZEND_FE(mb_regex_set_options, arginfo_mb_regex_set_options)
#endif
ZEND_FE_END