From: Hannes Magnusson Date: Sat, 17 Jun 2006 13:00:21 +0000 (+0000) Subject: Added argument info X-Git-Tag: RELEASE_1_0_0RC1~2703 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=587311d07edff7a0c79c56c3757e3d17babeae01;p=php Added argument info Fixed protos Fixed vim folding --- diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 9ab4c0d97a..37d22f3b2c 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -614,32 +614,130 @@ PHP_MINFO_FUNCTION(hash) } /* }}} */ +/* {{{ arginfo */ +#ifdef PHP_HASH_MD5_NOT_IN_CORE +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_md5, 0, 0, 1) + ZEND_ARG_INFO(0, str) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_md5_file, 0, 0, 1) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() +#endif + +#ifdef PHP_HASH_SHA1_NOT_IN_CORE +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_sha1, 0, 0, 1) + ZEND_ARG_INFO(0, str) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_sha1_file, 0, 0, 1) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() +#endif + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash, 0, 0, 2) + ZEND_ARG_INFO(0, algo) + ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_file, 0, 0, 2) + ZEND_ARG_INFO(0, algo) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac, 0, 0, 3) + ZEND_ARG_INFO(0, algo) + ZEND_ARG_INFO(0, data) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_hmac_file, 0, 0, 3) + ZEND_ARG_INFO(0, algo) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, key) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_init, 0, 0, 1) + ZEND_ARG_INFO(0, algo) + ZEND_ARG_INFO(0, options) + ZEND_ARG_INFO(0, key) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_hash_update, 0) + ZEND_ARG_INFO(0, context) + ZEND_ARG_INFO(0, data) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_stream, 0, 0, 2) + ZEND_ARG_INFO(0, context) + ZEND_ARG_INFO(0, handle) + ZEND_ARG_INFO(0, length) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_update_file, 0, 0, 2) + ZEND_ARG_INFO(0, context) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_hash_final, 0, 0, 1) + ZEND_ARG_INFO(0, context) + ZEND_ARG_INFO(0, raw_output) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_hash_algos, 0) +ZEND_END_ARG_INFO() + +/* }}} */ + /* {{{ hash_functions[] */ zend_function_entry hash_functions[] = { - PHP_FE(hash, NULL) - PHP_FE(hash_file, NULL) + PHP_FE(hash, arginfo_hash) + PHP_FE(hash_file, arginfo_hash_file) - PHP_FE(hash_hmac, NULL) - PHP_FE(hash_hmac_file, NULL) + PHP_FE(hash_hmac, arginfo_hash_hmac) + PHP_FE(hash_hmac_file, arginfo_hash_hmac_file) - PHP_FE(hash_init, NULL) - PHP_FE(hash_update, NULL) - PHP_FE(hash_update_stream, NULL) - PHP_FE(hash_update_file, NULL) - PHP_FE(hash_final, NULL) + PHP_FE(hash_init, arginfo_hash_init) + PHP_FE(hash_update, arginfo_hash_update) + PHP_FE(hash_update_stream, arginfo_hash_update_stream) + PHP_FE(hash_update_file, arginfo_hash_update_file) + PHP_FE(hash_final, arginfo_hash_final) - PHP_FE(hash_algos, NULL) + PHP_FE(hash_algos, arginfo_hash_algos) /* BC Land */ #ifdef PHP_HASH_MD5_NOT_IN_CORE - PHP_NAMED_FE(md5, php_if_md5, NULL) - PHP_NAMED_FE(md5_file, php_if_md5_file, NULL) + PHP_NAMED_FE(md5, php_if_md5, arginfo_hash_md5) + PHP_NAMED_FE(md5_file, php_if_md5_file, arginfo_hash_md5_file) #endif /* PHP_HASH_MD5_NOT_IN_CORE */ #ifdef PHP_HASH_SHA1_NOT_IN_CORE - PHP_NAMED_FE(sha1, php_if_sha1, NULL) - PHP_NAMED_FE(sha1_file, php_if_sha1_file, NULL) + PHP_NAMED_FE(sha1, php_if_sha1, arginfo_hash_sha1) + PHP_NAMED_FE(sha1_file, php_if_sha1_file, arginfo_hash_sha1_file) #endif /* PHP_HASH_SHA1_NOT_IN_CORE */ {NULL, NULL, NULL} diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 7847451cfd..67698a13a4 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} }; /* }}} */ @@ -1846,7 +1923,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) { @@ -1923,7 +2000,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) { @@ -2309,6 +2386,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) @@ -2556,6 +2634,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( diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 7a6f3031a6..4f38fe528f 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -83,13 +83,38 @@ PHP_MINFO_FUNCTION(libxml); /* }}} */ +/* {{{ arginfo */ +static +ZEND_BEGIN_ARG_INFO(arginfo_libxml_set_streams_context, 0) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_libxml_use_internal_errors, 0) + ZEND_ARG_INFO(0, use_errors) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_libxml_get_last_error, 0) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_libxml_get_errors, 0) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO(arginfo_libxml_clear_errors, 0) +ZEND_END_ARG_INFO() + +/* }}} */ + /* {{{ extension definition structures */ zend_function_entry libxml_functions[] = { - PHP_FE(libxml_set_streams_context, NULL) - PHP_FE(libxml_use_internal_errors, NULL) - PHP_FE(libxml_get_last_error, NULL) - PHP_FE(libxml_clear_errors, NULL) - PHP_FE(libxml_get_errors, NULL) + PHP_FE(libxml_set_streams_context, arginfo_libxml_set_streams_context) + PHP_FE(libxml_use_internal_errors, arginfo_libxml_use_internal_errors) + PHP_FE(libxml_get_last_error, arginfo_libxml_get_last_error) + PHP_FE(libxml_clear_errors, arginfo_libxml_clear_errors) + PHP_FE(libxml_get_errors, arginfo_libxml_get_errors) {NULL, NULL, NULL} }; @@ -603,6 +628,12 @@ PHP_MINIT_FUNCTION(libxml) INIT_CLASS_ENTRY(ce, "LibXMLError", NULL); libxmlerror_class_entry = zend_register_internal_class(&ce TSRMLS_CC); + zend_declare_property_long(libxmlerror_class_entry, "code", sizeof("code")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_long(libxmlerror_class_entry, "level", sizeof("level")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_long(libxmlerror_class_entry, "column", sizeof("column")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_string(libxmlerror_class_entry, "message", sizeof("message")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_string(libxmlerror_class_entry, "file", sizeof("file")-1, "", ZEND_ACC_PUBLIC TSRMLS_CC); + zend_declare_property_long(libxmlerror_class_entry, "line", sizeof("line")-1, 0, ZEND_ACC_PUBLIC TSRMLS_CC); return SUCCESS; } @@ -674,7 +705,7 @@ PHP_FUNCTION(libxml_set_streams_context) } /* }}} */ -/* {{{ proto void libxml_use_internal_errors(boolean use_errors) +/* {{{ proto void libxml_use_internal_errors([boolean use_errors]) Disable libxml errors and allow user to fetch error information as needed */ PHP_FUNCTION(libxml_use_internal_errors) {