Browse Source

MFH: arg ifno

PECL_OPENSSL
Hannes Magnusson 20 years ago
parent
commit
aae5df3ffd
  1. 126
      ext/hash/hash.c
  2. 105
      ext/iconv/iconv.c
  3. 37
      ext/libxml/libxml.c

126
ext/hash/hash.c

@ -596,32 +596,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}

105
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(

37
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}
};
@ -674,7 +699,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)
{

Loading…
Cancel
Save