summaryrefslogtreecommitdiff
path: root/ext/mbstring/php_mbregex.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/mbstring/php_mbregex.c')
-rw-r--r--ext/mbstring/php_mbregex.c96
1 files changed, 48 insertions, 48 deletions
diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c
index 8be88c3fee..6f3954e013 100644
--- a/ext/mbstring/php_mbregex.c
+++ b/ext/mbstring/php_mbregex.c
@@ -61,7 +61,7 @@ static void php_mb_regex_free_cache(zval *el) {
/* }}} */
/* {{{ _php_mb_regex_globals_ctor */
-static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
+static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals)
{
pglobals->default_mbctype = ONIG_ENCODING_UTF8;
pglobals->current_mbctype = ONIG_ENCODING_UTF8;
@@ -77,21 +77,21 @@ static int _php_mb_regex_globals_ctor(zend_mb_regex_globals *pglobals TSRMLS_DC)
/* }}} */
/* {{{ _php_mb_regex_globals_dtor */
-static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals TSRMLS_DC)
+static void _php_mb_regex_globals_dtor(zend_mb_regex_globals *pglobals)
{
zend_hash_destroy(&pglobals->ht_rc);
}
/* }}} */
/* {{{ php_mb_regex_globals_alloc */
-zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D)
+zend_mb_regex_globals *php_mb_regex_globals_alloc(void)
{
zend_mb_regex_globals *pglobals = pemalloc(
sizeof(zend_mb_regex_globals), 1);
if (!pglobals) {
return NULL;
}
- if (SUCCESS != _php_mb_regex_globals_ctor(pglobals TSRMLS_CC)) {
+ if (SUCCESS != _php_mb_regex_globals_ctor(pglobals)) {
pefree(pglobals, 1);
return NULL;
}
@@ -100,12 +100,12 @@ zend_mb_regex_globals *php_mb_regex_globals_alloc(TSRMLS_D)
/* }}} */
/* {{{ php_mb_regex_globals_free */
-void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals TSRMLS_DC)
+void php_mb_regex_globals_free(zend_mb_regex_globals *pglobals)
{
if (!pglobals) {
return;
}
- _php_mb_regex_globals_dtor(pglobals TSRMLS_CC);
+ _php_mb_regex_globals_dtor(pglobals);
pefree(pglobals, 1);
}
/* }}} */
@@ -403,7 +403,7 @@ static const char *_php_mb_regex_mbctype2name(OnigEncoding mbctype)
/* }}} */
/* {{{ php_mb_regex_set_mbctype */
-int php_mb_regex_set_mbctype(const char *encname TSRMLS_DC)
+int php_mb_regex_set_mbctype(const char *encname)
{
OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname);
if (mbctype == ONIG_ENCODING_UNDEF) {
@@ -415,7 +415,7 @@ int php_mb_regex_set_mbctype(const char *encname TSRMLS_DC)
/* }}} */
/* {{{ php_mb_regex_set_default_mbctype */
-int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC)
+int php_mb_regex_set_default_mbctype(const char *encname)
{
OnigEncoding mbctype = _php_mb_regex_name2mbctype(encname);
if (mbctype == ONIG_ENCODING_UNDEF) {
@@ -427,14 +427,14 @@ int php_mb_regex_set_default_mbctype(const char *encname TSRMLS_DC)
/* }}} */
/* {{{ php_mb_regex_get_mbctype */
-const char *php_mb_regex_get_mbctype(TSRMLS_D)
+const char *php_mb_regex_get_mbctype(void)
{
return _php_mb_regex_mbctype2name(MBREX(current_mbctype));
}
/* }}} */
/* {{{ php_mb_regex_get_default_mbctype */
-const char *php_mb_regex_get_default_mbctype(TSRMLS_D)
+const char *php_mb_regex_get_default_mbctype(void)
{
return _php_mb_regex_mbctype2name(MBREX(default_mbctype));
}
@@ -444,7 +444,7 @@ const char *php_mb_regex_get_default_mbctype(TSRMLS_D)
* regex cache
*/
/* {{{ php_mbregex_compile_pattern */
-static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax TSRMLS_DC)
+static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patlen, OnigOptionType options, OnigEncoding enc, OnigSyntaxType *syntax)
{
int err_code = 0;
php_mb_regex_t *retval = NULL, *rc = NULL;
@@ -455,7 +455,7 @@ static php_mb_regex_t *php_mbregex_compile_pattern(const char *pattern, int patl
if (!rc || rc->options != options || rc->enc != enc || rc->syntax != syntax) {
if ((err_code = onig_new(&retval, (OnigUChar *)pattern, (OnigUChar *)(pattern + patlen), options, enc, syntax, &err_info)) != ONIG_NORMAL) {
onig_error_code_to_str(err_str, err_code, err_info);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex compile err: %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex compile err: %s", err_str);
retval = NULL;
goto out;
}
@@ -658,7 +658,7 @@ PHP_FUNCTION(mb_regex_encoding)
size_t encoding_len;
OnigEncoding mbctype;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &encoding, &encoding_len) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &encoding, &encoding_len) == FAILURE) {
return;
}
@@ -674,7 +674,7 @@ PHP_FUNCTION(mb_regex_encoding)
mbctype = _php_mb_regex_name2mbctype(encoding);
if (mbctype == ONIG_ENCODING_UNDEF) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown encoding \"%s\"", encoding);
+ php_error_docref(NULL, E_WARNING, "Unknown encoding \"%s\"", encoding);
RETURN_FALSE;
}
@@ -698,7 +698,7 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
array = NULL;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zs|z/", &arg_pattern, &string, &string_len, &array) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zs|z/", &arg_pattern, &string, &string_len, &array) == FAILURE) {
RETURN_FALSE;
}
@@ -718,12 +718,12 @@ static void _php_mb_regex_ereg_exec(INTERNAL_FUNCTION_PARAMETERS, int icase)
}
if (Z_STRLEN_P(arg_pattern) == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "empty pattern");
+ php_error_docref(NULL, E_WARNING, "empty pattern");
RETVAL_FALSE;
goto out;
}
- re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC);
+ re = php_mbregex_compile_pattern(Z_STRVAL_P(arg_pattern), Z_STRLEN_P(arg_pattern), options, MBREX(current_mbctype), MBREX(regex_default_syntax));
if (re == NULL) {
RETVAL_FALSE;
goto out;
@@ -819,7 +819,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
current_enc_name = _php_mb_regex_mbctype2name(MBREX(current_mbctype));
if (current_enc_name == NULL ||
(enc = mbfl_name2encoding(current_enc_name)) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error");
+ php_error_docref(NULL, E_WARNING, "Unknown error");
RETURN_FALSE;
}
}
@@ -829,7 +829,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
size_t option_str_len = 0;
if (!is_callable) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zss|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zss|s",
&arg_pattern_zval,
&replace, &replace_len,
&string, &string_len,
@@ -837,7 +837,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zfs|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "zfs|s",
&arg_pattern_zval,
&arg_replace_fci, &arg_replace_fci_cache,
&string, &string_len,
@@ -866,14 +866,14 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
arg_pattern_len = 1;
}
/* create regex pattern buffer */
- re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBREX(current_mbctype), syntax TSRMLS_CC);
+ re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, options, MBREX(current_mbctype), syntax);
if (re == NULL) {
RETURN_FALSE;
}
if (eval || is_callable) {
pbuf = &eval_buf;
- description = zend_make_compiled_string_description("mbregex replace" TSRMLS_CC);
+ description = zend_make_compiled_string_description("mbregex replace");
} else {
pbuf = &out_buf;
description = NULL;
@@ -881,7 +881,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
if (is_callable) {
if (eval) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Option 'e' cannot be used with replacement callback");
+ php_error_docref(NULL, E_WARNING, "Option 'e' cannot be used with replacement callback");
RETURN_FALSE;
}
}
@@ -896,13 +896,13 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in php_mbereg_replace_exec(): %s", err_str);
break;
}
if (err >= 0) {
#if moriyoshi_0
if (regs->beg[0] == regs->end[0]) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL, E_WARNING, "Empty regular expression");
break;
}
#endif
@@ -939,9 +939,9 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
/* null terminate buffer */
smart_str_0(&eval_buf);
/* do eval */
- if (zend_eval_stringl(eval_buf.s->val, eval_buf.s->len, &v, description TSRMLS_CC) == FAILURE) {
+ if (zend_eval_stringl(eval_buf.s->val, eval_buf.s->len, &v, description) == FAILURE) {
efree(description);
- php_error_docref(NULL TSRMLS_CC,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, eval_buf.s->val);
+ php_error_docref(NULL,E_ERROR, "Failed evaluating code: %s%s", PHP_EOL, eval_buf.s->val);
/* zend_error() does not return in this case */
}
@@ -968,7 +968,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
arg_replace_fci.param_count = 1;
arg_replace_fci.params = args;
arg_replace_fci.retval = &retval;
- if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache TSRMLS_CC) == SUCCESS &&
+ if (zend_call_function(&arg_replace_fci, &arg_replace_fci_cache) == SUCCESS &&
!Z_ISUNDEF(retval)) {
convert_to_string_ex(&retval);
smart_str_appendl(&out_buf, Z_STRVAL(retval), Z_STRLEN(retval));
@@ -979,7 +979,7 @@ static void _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, OnigOp
} else {
efree(description);
if (!EG(exception)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
+ php_error_docref(NULL, E_WARNING, "Unable to call custom replacement function");
}
}
zval_ptr_dtor(&subpats);
@@ -1062,7 +1062,7 @@ PHP_FUNCTION(mb_split)
int n, err;
zend_long count = -1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|l", &arg_pattern, &arg_pattern_len, &string, &string_len, &count) == FAILURE) {
RETURN_FALSE;
}
@@ -1071,7 +1071,7 @@ PHP_FUNCTION(mb_split)
}
/* create regex pattern buffer */
- if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC)) == NULL) {
+ if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, MBREX(regex_default_options), MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
}
@@ -1111,7 +1111,7 @@ PHP_FUNCTION(mb_split)
if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in mbsplit(): %s", err_str);
zval_dtor(return_value);
RETURN_FALSE;
}
@@ -1145,7 +1145,7 @@ PHP_FUNCTION(mb_ereg_match)
char *option_str = NULL;
size_t option_str_len = 0;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ss|s",
&arg_pattern, &arg_pattern_len, &string, &string_len,
&option_str, &option_str_len)==FAILURE) {
RETURN_FALSE;
@@ -1159,7 +1159,7 @@ PHP_FUNCTION(mb_ereg_match)
}
}
- if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax TSRMLS_CC)) == NULL) {
+ if ((re = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}
@@ -1186,7 +1186,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
OnigUChar *str;
OnigSyntaxType *syntax;
- if (zend_parse_parameters(argc TSRMLS_CC, "|ss", &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "|ss", &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
return;
}
@@ -1199,7 +1199,7 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (argc > 0) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax) TSRMLS_CC)) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), MBREX(regex_default_syntax))) == NULL) {
RETURN_FALSE;
}
}
@@ -1213,12 +1213,12 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
}
if (MBREX(search_re) == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No regex given");
+ php_error_docref(NULL, E_WARNING, "No regex given");
RETURN_FALSE;
}
if (str == NULL) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "No string given");
+ php_error_docref(NULL, E_WARNING, "No string given");
RETURN_FALSE;
}
@@ -1234,11 +1234,11 @@ _php_mb_regex_ereg_search_exec(INTERNAL_FUNCTION_PARAMETERS, int mode)
} else if (err <= -2) {
OnigUChar err_str[ONIG_MAX_ERROR_MESSAGE_LEN];
onig_error_code_to_str(err_str, err);
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
+ php_error_docref(NULL, E_WARNING, "mbregex search failure in mbregex_search(): %s", err_str);
RETVAL_FALSE;
} else {
if (MBREX(search_regs)->beg[0] == MBREX(search_regs)->end[0]) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty regular expression");
+ php_error_docref(NULL, E_WARNING, "Empty regular expression");
}
switch (mode) {
case 1:
@@ -1315,12 +1315,12 @@ PHP_FUNCTION(mb_ereg_search_init)
OnigSyntaxType *syntax = NULL;
OnigOptionType option;
- if (zend_parse_parameters(argc TSRMLS_CC, "z|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
+ if (zend_parse_parameters(argc, "z|ss", &arg_str, &arg_pattern, &arg_pattern_len, &arg_options, &arg_options_len) == FAILURE) {
return;
}
if (argc > 1 && arg_pattern_len == 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Empty pattern");
+ php_error_docref(NULL, E_WARNING, "Empty pattern");
RETURN_FALSE;
}
@@ -1334,7 +1334,7 @@ PHP_FUNCTION(mb_ereg_search_init)
if (argc > 1) {
/* create regex pattern buffer */
- if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax TSRMLS_CC)) == NULL) {
+ if ((MBREX(search_re) = php_mbregex_compile_pattern(arg_pattern, arg_pattern_len, option, MBREX(current_mbctype), syntax)) == NULL) {
RETURN_FALSE;
}
}
@@ -1398,12 +1398,12 @@ PHP_FUNCTION(mb_ereg_search_setpos)
{
zend_long position;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &position) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &position) == FAILURE) {
return;
}
if (position < 0 || (!Z_ISUNDEF(MBREX(search_str)) && Z_TYPE(MBREX(search_str)) == IS_STRING && (size_t)position >= Z_STRLEN(MBREX(search_str)))) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Position is out of range");
+ php_error_docref(NULL, E_WARNING, "Position is out of range");
MBREX(search_pos) = 0;
RETURN_FALSE;
}
@@ -1414,7 +1414,7 @@ PHP_FUNCTION(mb_ereg_search_setpos)
/* }}} */
/* {{{ php_mb_regex_set_options */
-static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax TSRMLS_DC)
+static void _php_mb_regex_set_options(OnigOptionType options, OnigSyntaxType *syntax, OnigOptionType *prev_options, OnigSyntaxType **prev_syntax)
{
if (prev_options != NULL) {
*prev_options = MBREX(regex_default_options);
@@ -1437,7 +1437,7 @@ PHP_FUNCTION(mb_regex_set_options)
size_t string_len;
char buf[16];
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s",
&string, &string_len) == FAILURE) {
RETURN_FALSE;
}
@@ -1445,7 +1445,7 @@ PHP_FUNCTION(mb_regex_set_options)
opt = 0;
syntax = NULL;
_php_mb_regex_init_options(string, string_len, &opt, &syntax, NULL);
- _php_mb_regex_set_options(opt, syntax, NULL, NULL TSRMLS_CC);
+ _php_mb_regex_set_options(opt, syntax, NULL, NULL);
} else {
opt = MBREX(regex_default_options);
syntax = MBREX(regex_default_syntax);