summaryrefslogtreecommitdiff
path: root/ext/iconv/iconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/iconv/iconv.c')
-rw-r--r--ext/iconv/iconv.c228
1 files changed, 114 insertions, 114 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index c8dcc15e99..16c5eac578 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -200,7 +200,7 @@ typedef enum _php_iconv_enc_scheme_t {
static php_iconv_err_t _php_iconv_appendl(smart_str *d, const char *s, size_t l, iconv_t cd);
static php_iconv_err_t _php_iconv_appendc(smart_str *d, const char c, iconv_t cd);
-static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC);
+static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset);
static php_iconv_err_t _php_iconv_strlen(size_t *pretval, const char *str, size_t nbytes, const char *enc);
@@ -212,11 +212,11 @@ static php_iconv_err_t _php_iconv_mime_encode(smart_str *pretval, const char *fn
static php_iconv_err_t _php_iconv_mime_decode(smart_str *pretval, const char *str, size_t str_nbytes, const char *enc, const char **next_pos, int mode);
-static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D);
-static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D);
+static php_iconv_err_t php_iconv_stream_filter_register_factory(void);
+static php_iconv_err_t php_iconv_stream_filter_unregister_factory(void);
-static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len TSRMLS_DC);
-static php_output_handler *php_iconv_output_handler_init(const char *name, size_t name_len, size_t chunk_size, int flags TSRMLS_DC);
+static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len);
+static php_output_handler *php_iconv_output_handler_init(const char *name, size_t name_len, size_t chunk_size, int flags);
static int php_iconv_output_handler(void **nothing, php_output_context *output_context);
/* }}} */
@@ -233,9 +233,9 @@ static PHP_INI_MH(OnUpdateInputEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.input_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -246,9 +246,9 @@ static PHP_INI_MH(OnUpdateOutputEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.output_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -259,9 +259,9 @@ static PHP_INI_MH(OnUpdateInternalEncoding)
return FAILURE;
}
if (stage & (PHP_INI_STAGE_ACTIVATE | PHP_INI_STAGE_RUNTIME)) {
- php_error_docref("ref.iconv" TSRMLS_CC, E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
+ php_error_docref("ref.iconv", E_DEPRECATED, "Use of iconv.internal_encoding is deprecated");
}
- OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage TSRMLS_CC);
+ OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
return SUCCESS;
}
@@ -309,12 +309,12 @@ PHP_MINIT_FUNCTION(miconv)
REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_STRICT", PHP_ICONV_MIME_DECODE_STRICT, CONST_CS | CONST_PERSISTENT);
REGISTER_LONG_CONSTANT("ICONV_MIME_DECODE_CONTINUE_ON_ERROR", PHP_ICONV_MIME_DECODE_CONTINUE_ON_ERROR, CONST_CS | CONST_PERSISTENT);
- if (php_iconv_stream_filter_register_factory(TSRMLS_C) != PHP_ICONV_ERR_SUCCESS) {
+ if (php_iconv_stream_filter_register_factory() != PHP_ICONV_ERR_SUCCESS) {
return FAILURE;
}
- php_output_handler_alias_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_handler_init TSRMLS_CC);
- php_output_handler_conflict_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_conflict TSRMLS_CC);
+ php_output_handler_alias_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_handler_init);
+ php_output_handler_conflict_register(ZEND_STRL("ob_iconv_handler"), php_iconv_output_conflict);
return SUCCESS;
}
@@ -323,7 +323,7 @@ PHP_MINIT_FUNCTION(miconv)
/* {{{ PHP_MSHUTDOWN_FUNCTION */
PHP_MSHUTDOWN_FUNCTION(miconv)
{
- php_iconv_stream_filter_unregister_factory(TSRMLS_C);
+ php_iconv_stream_filter_unregister_factory();
UNREGISTER_INI_ENTRIES();
return SUCCESS;
}
@@ -334,8 +334,8 @@ PHP_MINFO_FUNCTION(miconv)
{
zval *iconv_impl, *iconv_ver;
- iconv_impl = zend_get_constant_str("ICONV_IMPL", sizeof("ICONV_IMPL")-1 TSRMLS_CC);
- iconv_ver = zend_get_constant_str("ICONV_VERSION", sizeof("ICONV_VERSION")-1 TSRMLS_CC);
+ iconv_impl = zend_get_constant_str("ICONV_IMPL", sizeof("ICONV_IMPL")-1);
+ iconv_ver = zend_get_constant_str("ICONV_VERSION", sizeof("ICONV_VERSION")-1);
php_info_print_table_start();
php_info_print_table_row(2, "iconv support", "enabled");
@@ -347,7 +347,7 @@ PHP_MINFO_FUNCTION(miconv)
}
/* }}} */
-static char *get_internal_encoding(TSRMLS_D) {
+static char *get_internal_encoding(void) {
if (ICONVG(internal_encoding) && ICONVG(internal_encoding)[0]) {
return ICONVG(internal_encoding);
} else if (PG(internal_encoding) && PG(internal_encoding)[0]) {
@@ -358,7 +358,7 @@ static char *get_internal_encoding(TSRMLS_D) {
return "";
}
-static char *get_input_encoding(TSRMLS_D) {
+static char *get_input_encoding(void) {
if (ICONVG(input_encoding) && ICONVG(input_encoding)[0]) {
return ICONVG(input_encoding);
} else if (PG(input_encoding) && PG(input_encoding)[0]) {
@@ -369,7 +369,7 @@ static char *get_input_encoding(TSRMLS_D) {
return "";
}
-static char *get_output_encoding(TSRMLS_D) {
+static char *get_output_encoding(void) {
if (ICONVG(output_encoding) && ICONVG(output_encoding)[0]) {
return ICONVG(output_encoding);
} else if (PG(output_encoding) && PG(output_encoding)[0]) {
@@ -381,20 +381,20 @@ static char *get_output_encoding(TSRMLS_D) {
}
-static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len TSRMLS_DC)
+static int php_iconv_output_conflict(const char *handler_name, size_t handler_name_len)
{
- if (php_output_get_level(TSRMLS_C)) {
- if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_iconv_handler") TSRMLS_CC)
- || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler") TSRMLS_CC)) {
+ if (php_output_get_level()) {
+ if (php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("ob_iconv_handler"))
+ || php_output_handler_conflict(handler_name, handler_name_len, ZEND_STRL("mb_output_handler"))) {
return FAILURE;
}
}
return SUCCESS;
}
-static php_output_handler *php_iconv_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags TSRMLS_DC)
+static php_output_handler *php_iconv_output_handler_init(const char *handler_name, size_t handler_name_len, size_t chunk_size, int flags)
{
- return php_output_handler_create_internal(handler_name, handler_name_len, php_iconv_output_handler, chunk_size, flags TSRMLS_CC);
+ return php_output_handler_create_internal(handler_name, handler_name_len, php_iconv_output_handler, chunk_size, flags);
}
static int php_iconv_output_handler(void **nothing, php_output_context *output_context)
@@ -404,7 +404,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
PHP_OUTPUT_TSRMLS(output_context);
if (output_context->op & PHP_OUTPUT_HANDLER_START) {
- output_status = php_output_get_status(TSRMLS_C);
+ output_status = php_output_get_status();
if (output_status & PHP_OUTPUT_SENT) {
return FAILURE;
}
@@ -422,16 +422,16 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (mimetype != NULL && !(output_context->op & PHP_OUTPUT_HANDLER_CLEAN)) {
size_t len;
- char *p = strstr(get_output_encoding(TSRMLS_C), "//");
+ char *p = strstr(get_output_encoding(), "//");
if (p) {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%.*s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, (size_t)(p - get_output_encoding()), get_output_encoding());
} else {
- len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding(TSRMLS_C));
+ len = spprintf(&content_type, 0, "Content-Type:%.*s; charset=%s", mimetype_len ? mimetype_len : (size_t) strlen(mimetype), mimetype, get_output_encoding());
}
if (content_type && SUCCESS == sapi_add_header(content_type, (uint)len, 0)) {
SG(sapi_headers).send_default_content_type = 0;
- php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL TSRMLS_CC);
+ php_output_handler_hook(PHP_OUTPUT_HANDLER_HOOK_IMMUTABLE, NULL);
}
}
}
@@ -439,7 +439,7 @@ static int php_iconv_output_handler(void **nothing, php_output_context *output_c
if (output_context->in.used) {
zend_string *out;
output_context->out.free = 1;
- _php_iconv_show_error(php_iconv_string(output_context->in.data, output_context->in.used, &out, get_output_encoding(TSRMLS_C), get_internal_encoding(TSRMLS_C)), get_output_encoding(TSRMLS_C), get_internal_encoding(TSRMLS_C) TSRMLS_CC);
+ _php_iconv_show_error(php_iconv_string(output_context->in.data, output_context->in.used, &out, get_output_encoding(), get_internal_encoding()), get_output_encoding(), get_internal_encoding());
if (out) {
output_context->out.data = estrndup(out->val, out->len);
output_context->out.used = out->len;
@@ -1973,41 +1973,41 @@ out:
/* }}} */
/* {{{ php_iconv_show_error() */
-static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset TSRMLS_DC)
+static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset, const char *in_charset)
{
switch (err) {
case PHP_ICONV_ERR_SUCCESS:
break;
case PHP_ICONV_ERR_CONVERTER:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Cannot open converter");
+ php_error_docref(NULL, E_NOTICE, "Cannot open converter");
break;
case PHP_ICONV_ERR_WRONG_CHARSET:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
+ php_error_docref(NULL, E_NOTICE, "Wrong charset, conversion from `%s' to `%s' is not allowed",
in_charset, out_charset);
break;
case PHP_ICONV_ERR_ILLEGAL_CHAR:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an incomplete multibyte character in input string");
+ php_error_docref(NULL, E_NOTICE, "Detected an incomplete multibyte character in input string");
break;
case PHP_ICONV_ERR_ILLEGAL_SEQ:
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Detected an illegal character in input string");
+ php_error_docref(NULL, E_NOTICE, "Detected an illegal character in input string");
break;
case PHP_ICONV_ERR_TOO_BIG:
/* should not happen */
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Buffer length exceeded");
+ php_error_docref(NULL, E_WARNING, "Buffer length exceeded");
break;
case PHP_ICONV_ERR_MALFORMED:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Malformed string");
+ php_error_docref(NULL, E_WARNING, "Malformed string");
break;
default:
/* other error */
- php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown error (%d)", errno);
+ php_error_docref(NULL, E_NOTICE, "Unknown error (%d)", errno);
break;
}
}
@@ -2017,7 +2017,7 @@ static void _php_iconv_show_error(php_iconv_err_t err, const char *out_charset,
Returns the character count of str */
PHP_FUNCTION(iconv_strlen)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *str;
@@ -2025,18 +2025,18 @@ PHP_FUNCTION(iconv_strlen)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|s",
&str, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_strlen(&retval, str->val, str->len, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS) {
RETVAL_LONG(retval);
} else {
@@ -2049,7 +2049,7 @@ PHP_FUNCTION(iconv_strlen)
Returns specified part of a string */
PHP_FUNCTION(iconv_substr)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *str;
zend_long offset, length = 0;
@@ -2058,14 +2058,14 @@ PHP_FUNCTION(iconv_substr)
smart_str retval = {0};
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sl|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "Sl|ls",
&str, &offset, &length,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2074,7 +2074,7 @@ PHP_FUNCTION(iconv_substr)
}
err = _php_iconv_substr(&retval, str->val, str->len, offset, length, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && str->val[0] != '\0' && retval.s != NULL) {
RETURN_STR(retval.s);
@@ -2088,7 +2088,7 @@ PHP_FUNCTION(iconv_substr)
Finds position of first occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strpos)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2098,19 +2098,19 @@ PHP_FUNCTION(iconv_strpos)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|ls",
&haystk, &ndl,
&offset, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
if (offset < 0) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset not contained in string.");
+ php_error_docref(NULL, E_WARNING, "Offset not contained in string.");
RETURN_FALSE;
}
@@ -2120,7 +2120,7 @@ PHP_FUNCTION(iconv_strpos)
err = _php_iconv_strpos(&retval, haystk->val, haystk->len, ndl->val, ndl->len,
offset, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
@@ -2134,7 +2134,7 @@ PHP_FUNCTION(iconv_strpos)
Finds position of last occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strrpos)
{
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_string *haystk;
zend_string *ndl;
@@ -2143,7 +2143,7 @@ PHP_FUNCTION(iconv_strrpos)
size_t retval;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|s",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|s",
&haystk, &ndl,
&charset, &charset_len) == FAILURE) {
RETURN_FALSE;
@@ -2154,13 +2154,13 @@ PHP_FUNCTION(iconv_strrpos)
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_strpos(&retval, haystk->val, haystk->len, ndl->val, ndl->len,
-1, charset);
- _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset TSRMLS_CC);
+ _php_iconv_show_error(err, GENERIC_SUPERSET_NAME, charset);
if (err == PHP_ICONV_ERR_SUCCESS && retval != (size_t)-1) {
RETVAL_LONG((zend_long)retval);
@@ -2181,13 +2181,13 @@ PHP_FUNCTION(iconv_mime_encode)
smart_str retval = {0};
php_iconv_err_t err;
- const char *in_charset = get_internal_encoding(TSRMLS_C);
+ const char *in_charset = get_internal_encoding();
const char *out_charset = in_charset;
zend_long line_len = 76;
const char *lfchars = "\r\n";
php_iconv_enc_scheme_t scheme_id = PHP_ICONV_ENC_SCHEME_BASE64;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "SS|a",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "SS|a",
&field_name, &field_value,
&pref) == FAILURE) {
@@ -2213,7 +2213,7 @@ PHP_FUNCTION(iconv_mime_encode)
if ((pzval = zend_hash_str_find(Z_ARRVAL_P(pref), "input-charset", sizeof("input-charset") - 1)) != NULL) {
if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2225,7 +2225,7 @@ PHP_FUNCTION(iconv_mime_encode)
if ((pzval = zend_hash_str_find(Z_ARRVAL_P(pref), "output-charset", sizeof("output-charset") - 1)) != NULL) {
if (Z_STRLEN_P(pzval) >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2263,7 +2263,7 @@ PHP_FUNCTION(iconv_mime_encode)
err = _php_iconv_mime_encode(&retval, field_name->val, field_name->len,
field_value->val, field_value->len, line_len, lfchars, scheme_id,
out_charset, in_charset);
- _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
+ _php_iconv_show_error(err, out_charset, in_charset);
if (err == PHP_ICONV_ERR_SUCCESS) {
if (retval.s != NULL) {
@@ -2287,7 +2287,7 @@ PHP_FUNCTION(iconv_mime_encode)
PHP_FUNCTION(iconv_mime_decode)
{
zend_string *encoded_str;
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_long mode = 0;
@@ -2295,19 +2295,19 @@ PHP_FUNCTION(iconv_mime_decode)
php_iconv_err_t err;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = _php_iconv_mime_decode(&retval, encoded_str->val, encoded_str->len, charset, NULL, (int)mode);
- _php_iconv_show_error(err, charset, "???" TSRMLS_CC);
+ _php_iconv_show_error(err, charset, "???");
if (err == PHP_ICONV_ERR_SUCCESS) {
if (retval.s != NULL) {
@@ -2327,7 +2327,7 @@ PHP_FUNCTION(iconv_mime_decode)
PHP_FUNCTION(iconv_mime_decode_headers)
{
zend_string *encoded_str;
- char *charset = get_internal_encoding(TSRMLS_C);
+ char *charset = get_internal_encoding();
size_t charset_len = 0;
zend_long mode = 0;
char *enc_str_tmp;
@@ -2335,14 +2335,14 @@ PHP_FUNCTION(iconv_mime_decode_headers)
php_iconv_err_t err = PHP_ICONV_ERR_SUCCESS;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "S|ls",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "S|ls",
&encoded_str, &mode, &charset, &charset_len) == FAILURE) {
RETURN_FALSE;
}
if (charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2413,7 +2413,7 @@ PHP_FUNCTION(iconv_mime_decode_headers)
}
if (err != PHP_ICONV_ERR_SUCCESS) {
- _php_iconv_show_error(err, charset, "???" TSRMLS_CC);
+ _php_iconv_show_error(err, charset, "???");
zval_dtor(return_value);
RETVAL_FALSE;
}
@@ -2430,17 +2430,17 @@ PHP_NAMED_FUNCTION(php_if_iconv)
php_iconv_err_t err;
zend_string *out_buffer;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssS",
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "ssS",
&in_charset, &in_charset_len, &out_charset, &out_charset_len, &in_buffer) == FAILURE)
return;
if (in_charset_len >= ICONV_CSNMAXLEN || out_charset_len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
err = php_iconv_string(in_buffer->val, (size_t)in_buffer->len, &out_buffer, out_charset, in_charset);
- _php_iconv_show_error(err, out_charset, in_charset TSRMLS_CC);
+ _php_iconv_show_error(err, out_charset, in_charset);
if (err == PHP_ICONV_ERR_SUCCESS && out_buffer != NULL) {
RETVAL_STR(out_buffer);
} else {
@@ -2461,11 +2461,11 @@ PHP_FUNCTION(iconv_set_encoding)
size_t type_len, retval;
zend_string *name;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sS", &type, &type_len, &charset) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "sS", &type, &type_len, &charset) == FAILURE)
return;
if (charset->len >= ICONV_CSNMAXLEN) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
+ php_error_docref(NULL, E_WARNING, "Charset parameter exceeds the maximum allowed length of %d characters", ICONV_CSNMAXLEN);
RETURN_FALSE;
}
@@ -2497,20 +2497,20 @@ PHP_FUNCTION(iconv_get_encoding)
char *type = "all";
size_t type_len = sizeof("all")-1;
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &type, &type_len) == FAILURE)
+ if (zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &type, &type_len) == FAILURE)
return;
if (!strcasecmp("all", type)) {
array_init(return_value);
- add_assoc_string(return_value, "input_encoding", get_input_encoding(TSRMLS_C));
- add_assoc_string(return_value, "output_encoding", get_output_encoding(TSRMLS_C));
- add_assoc_string(return_value, "internal_encoding", get_internal_encoding(TSRMLS_C));
+ add_assoc_string(return_value, "input_encoding", get_input_encoding());
+ add_assoc_string(return_value, "output_encoding", get_output_encoding());
+ add_assoc_string(return_value, "internal_encoding", get_internal_encoding());
} else if (!strcasecmp("input_encoding", type)) {
- RETVAL_STRING(get_input_encoding(TSRMLS_C));
+ RETVAL_STRING(get_input_encoding());
} else if (!strcasecmp("output_encoding", type)) {
- RETVAL_STRING(get_output_encoding(TSRMLS_C));
+ RETVAL_STRING(get_output_encoding());
} else if (!strcasecmp("internal_encoding", type)) {
- RETVAL_STRING(get_internal_encoding(TSRMLS_C));
+ RETVAL_STRING(get_internal_encoding());
} else {
RETURN_FALSE;
}
@@ -2577,7 +2577,7 @@ static int php_iconv_stream_filter_append_bucket(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_out,
const char *ps, size_t buf_len, size_t *consumed,
- int persistent TSRMLS_DC)
+ int persistent)
{
php_stream_bucket *new_bucket;
char *out_buf = NULL;
@@ -2610,14 +2610,14 @@ static int php_iconv_stream_filter_append_bucket(
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
goto out_failure;
case EINVAL:
if (ps != NULL) {
if (icnt > 0) {
if (self->stub_len >= sizeof(self->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
goto out_failure;
}
self->stub[self->stub_len++] = *(ps++);
@@ -2639,11 +2639,11 @@ static int php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -2652,11 +2652,11 @@ static int php_iconv_stream_filter_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -2667,12 +2667,12 @@ static int php_iconv_stream_filter_append_bucket(
} break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#else
if (ocnt == prev_ocnt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#endif
@@ -2689,13 +2689,13 @@ static int php_iconv_stream_filter_append_bucket(
#if ICONV_SUPPORTS_ERRNO
switch (errno) {
case EILSEQ:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): invalid multibyte sequence", self->from_charset, self->to_charset);
goto out_failure;
case EINVAL:
if (ps != NULL) {
if (icnt > sizeof(self->stub)) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): insufficient buffer", self->from_charset, self->to_charset);
goto out_failure;
}
memcpy(self->stub, ps, icnt);
@@ -2703,7 +2703,7 @@ static int php_iconv_stream_filter_append_bucket(
ps += icnt;
icnt = 0;
} else {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unexpected octet values", self->from_charset, self->to_charset);
goto out_failure;
}
break;
@@ -2716,11 +2716,11 @@ static int php_iconv_stream_filter_append_bucket(
if (new_out_buf_size < out_buf_size) {
/* whoa! no bigger buckets are sold anywhere... */
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
out_buf_size = ocnt = initial_out_buf_size;
if (NULL == (out_buf = pemalloc(out_buf_size, persistent))) {
@@ -2729,11 +2729,11 @@ static int php_iconv_stream_filter_append_bucket(
pd = out_buf;
} else {
if (NULL == (new_out_buf = perealloc(out_buf, new_out_buf_size, persistent))) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
return FAILURE;
}
pd = new_out_buf + (pd - out_buf);
@@ -2744,12 +2744,12 @@ static int php_iconv_stream_filter_append_bucket(
} break;
default:
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#else
if (ocnt == prev_ocnt) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
+ php_error_docref(NULL, E_WARNING, "iconv stream filter (\"%s\"=>\"%s\"): unknown error", self->from_charset, self->to_charset);
goto out_failure;
}
#endif
@@ -2762,10 +2762,10 @@ static int php_iconv_stream_filter_append_bucket(
}
if (out_buf_size > ocnt) {
- if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent TSRMLS_CC))) {
+ if (NULL == (new_bucket = php_stream_bucket_new(stream, out_buf, (out_buf_size - ocnt), 1, persistent))) {
goto out_failure;
}
- php_stream_bucket_append(buckets_out, new_bucket TSRMLS_CC);
+ php_stream_bucket_append(buckets_out, new_bucket);
} else {
pefree(out_buf, persistent);
}
@@ -2784,7 +2784,7 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
php_stream *stream, php_stream_filter *filter,
php_stream_bucket_brigade *buckets_in,
php_stream_bucket_brigade *buckets_out,
- size_t *bytes_consumed, int flags TSRMLS_DC)
+ size_t *bytes_consumed, int flags)
{
php_stream_bucket *bucket = NULL;
size_t consumed = 0;
@@ -2793,21 +2793,21 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
while (buckets_in->head != NULL) {
bucket = buckets_in->head;
- php_stream_bucket_unlink(bucket TSRMLS_CC);
+ php_stream_bucket_unlink(bucket);
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, bucket->buf, bucket->buflen, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
if (flags != PSFS_FLAG_NORMAL) {
if (php_iconv_stream_filter_append_bucket(self, stream, filter,
buckets_out, NULL, 0, &consumed,
- php_stream_is_persistent(stream) TSRMLS_CC) != SUCCESS) {
+ php_stream_is_persistent(stream)) != SUCCESS) {
goto out_failure;
}
}
@@ -2820,14 +2820,14 @@ static php_stream_filter_status_t php_iconv_stream_filter_do_filter(
out_failure:
if (bucket != NULL) {
- php_stream_bucket_delref(bucket TSRMLS_CC);
+ php_stream_bucket_delref(bucket);
}
return PSFS_ERR_FATAL;
}
/* }}} */
/* {{{ php_iconv_stream_filter_cleanup */
-static void php_iconv_stream_filter_cleanup(php_stream_filter *filter TSRMLS_DC)
+static void php_iconv_stream_filter_cleanup(php_stream_filter *filter)
{
php_iconv_stream_filter_dtor((php_iconv_stream_filter *)Z_PTR(filter->abstract));
pefree(Z_PTR(filter->abstract), ((php_iconv_stream_filter *)Z_PTR(filter->abstract))->persistent);
@@ -2841,7 +2841,7 @@ static php_stream_filter_ops php_iconv_stream_filter_ops = {
};
/* {{{ php_iconv_stream_filter_create */
-static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent TSRMLS_DC)
+static php_stream_filter *php_iconv_stream_filter_factory_create(const char *name, zval *params, int persistent)
{
php_stream_filter *retval = NULL;
php_iconv_stream_filter *inst;
@@ -2886,7 +2886,7 @@ static php_stream_filter *php_iconv_stream_filter_factory_create(const char *nam
/* }}} */
/* {{{ php_iconv_stream_register_factory */
-static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
+static php_iconv_err_t php_iconv_stream_filter_register_factory(void)
{
static php_stream_filter_factory filter_factory = {
php_iconv_stream_filter_factory_create
@@ -2894,7 +2894,7 @@ static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
if (FAILURE == php_stream_filter_register_factory(
php_iconv_stream_filter_ops.label,
- &filter_factory TSRMLS_CC)) {
+ &filter_factory)) {
return PHP_ICONV_ERR_UNKNOWN;
}
return PHP_ICONV_ERR_SUCCESS;
@@ -2902,10 +2902,10 @@ static php_iconv_err_t php_iconv_stream_filter_register_factory(TSRMLS_D)
/* }}} */
/* {{{ php_iconv_stream_unregister_factory */
-static php_iconv_err_t php_iconv_stream_filter_unregister_factory(TSRMLS_D)
+static php_iconv_err_t php_iconv_stream_filter_unregister_factory(void)
{
if (FAILURE == php_stream_filter_unregister_factory(
- php_iconv_stream_filter_ops.label TSRMLS_CC)) {
+ php_iconv_stream_filter_ops.label)) {
return PHP_ICONV_ERR_UNKNOWN;
}
return PHP_ICONV_ERR_SUCCESS;