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.c105
1 files changed, 92 insertions, 13 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 2bd527cf79..40573f47f5 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -62,20 +62,97 @@
#define _php_iconv_memequal(a, b, c) \
((c) == sizeof(unsigned long) ? *((unsigned long *)(a)) == *((unsigned long *)(b)) : ((c) == sizeof(unsigned int) ? *((unsigned int *)(a)) == *((unsigned int *)(b)) : memcmp(a, b, c) == 0))
+/* {{{ arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strlen, 0, 0, 1)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_substr, 0, 0, 2)
+ ZEND_ARG_INFO(0, str)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, length)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strpos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, offset)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_strrpos, 0, 0, 2)
+ ZEND_ARG_INFO(0, haystack)
+ ZEND_ARG_INFO(0, needle)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_mime_encode, 0, 0, 2)
+ ZEND_ARG_INFO(0, field_name)
+ ZEND_ARG_INFO(0, field_value)
+ ZEND_ARG_INFO(0, preference) /* ZEND_ARG_ARRAY_INFO(0, preference, 1) */
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_mime_decode, 0, 0, 1)
+ ZEND_ARG_INFO(0, encoded_string)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_mime_decode_headers, 0, 0, 1)
+ ZEND_ARG_INFO(0, headers)
+ ZEND_ARG_INFO(0, mode)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_iconv, 0)
+ ZEND_ARG_INFO(0, in_charset)
+ ZEND_ARG_INFO(0, out_charset)
+ ZEND_ARG_INFO(0, str)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_ob_iconv_handler, 0)
+ ZEND_ARG_INFO(0, contents)
+ ZEND_ARG_INFO(0, status)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_iconv_set_encoding, 0)
+ ZEND_ARG_INFO(0, type)
+ ZEND_ARG_INFO(0, charset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_iconv_get_encoding, 0, 0, 0)
+ ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+
+/* }}} */
+
/* {{{ iconv_functions[]
*/
zend_function_entry iconv_functions[] = {
- PHP_NAMED_FE(iconv,php_if_iconv, NULL)
- PHP_FE(ob_iconv_handler, NULL)
- PHP_FE(iconv_get_encoding, NULL)
- PHP_FE(iconv_set_encoding, NULL)
- PHP_FE(iconv_strlen, NULL)
- PHP_FE(iconv_substr, NULL)
- PHP_FE(iconv_strpos, NULL)
- PHP_FE(iconv_strrpos, NULL)
- PHP_FE(iconv_mime_encode, NULL)
- PHP_FE(iconv_mime_decode, NULL)
- PHP_FE(iconv_mime_decode_headers, NULL)
+ PHP_NAMED_FE(iconv,php_if_iconv, arginfo_iconv)
+ PHP_FE(ob_iconv_handler, arginfo_ob_iconv_handler)
+ PHP_FE(iconv_get_encoding, arginfo_iconv_get_encoding)
+ PHP_FE(iconv_set_encoding, arginfo_iconv_set_encoding)
+ PHP_FE(iconv_strlen, arginfo_iconv_strlen)
+ PHP_FE(iconv_substr, arginfo_iconv_substr)
+ PHP_FE(iconv_strpos, arginfo_iconv_strpos)
+ PHP_FE(iconv_strrpos, arginfo_iconv_strrpos)
+ PHP_FE(iconv_mime_encode, arginfo_iconv_mime_encode)
+ PHP_FE(iconv_mime_decode, arginfo_iconv_mime_decode)
+ PHP_FE(iconv_mime_decode_headers, arginfo_iconv_mime_decode_headers)
{NULL, NULL, NULL}
};
/* }}} */
@@ -1843,7 +1920,7 @@ PHP_FUNCTION(iconv_substr)
}
/* }}} */
-/* {{{ proto int iconv_strpos(string haystack, string needle, int offset [, string charset])
+/* {{{ proto int iconv_strpos(string haystack, string needle [, int offset [, string charset]])
Finds position of first occurrence of needle within part of haystack beginning with offset */
PHP_FUNCTION(iconv_strpos)
{
@@ -1920,7 +1997,7 @@ PHP_FUNCTION(iconv_strrpos)
}
/* }}} */
-/* {{{ proto string iconv_mime_encode(string field_name, string field_value, [, array preference])
+/* {{{ proto string iconv_mime_encode(string field_name, string field_value [, array preference])
Composes a mime header field with field_name and field_value in a specified scheme */
PHP_FUNCTION(iconv_mime_encode)
{
@@ -2304,6 +2381,7 @@ typedef struct _php_iconv_stream_filter {
char stub[128];
size_t stub_len;
} php_iconv_stream_filter;
+/* }}} iconv stream filter */
/* {{{ php_iconv_stream_filter_dtor */
static void php_iconv_stream_filter_dtor(php_iconv_stream_filter *self)
@@ -2551,6 +2629,7 @@ out_failure:
pefree(out_buf, persistent);
return FAILURE;
}
+/* }}} php_iconv_stream_filter_append_bucket */
/* {{{ php_iconv_stream_filter_do_filter */
static php_stream_filter_status_t php_iconv_stream_filter_do_filter(