felipe Fri Jul 25 15:23:10 2008 UTC Modified files: (Branch: PHP_5_3) /php-src/ext/fileinfo fileinfo.c Log: MFH: - Added arginfo - Fixed: . proto: finfo_buffer . parameter type in _php_finfo_get_type() http://cvs.php.net/viewvc.cgi/php-src/ext/fileinfo/fileinfo.c?r1=1.20.2.1&r2=1.20.2.2&diff_format=u Index: php-src/ext/fileinfo/fileinfo.c diff -u php-src/ext/fileinfo/fileinfo.c:1.20.2.1 php-src/ext/fileinfo/fileinfo.c:1.20.2.2 --- php-src/ext/fileinfo/fileinfo.c:1.20.2.1 Fri Jul 25 09:16:22 2008 +++ php-src/ext/fileinfo/fileinfo.c Fri Jul 25 15:23:10 2008 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: fileinfo.c,v 1.20.2.1 2008/07/25 09:16:22 jani Exp $ */ +/* $Id: fileinfo.c,v 1.20.2.2 2008/07/25 15:23:10 felipe Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -114,19 +114,73 @@ } /* }}} */ +/* {{{ arginfo */ +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_open, 0, 0, 0) + ZEND_ARG_INFO(0, options) + ZEND_ARG_INFO(0, arg) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_close, 0, 0, 1) + ZEND_ARG_INFO(0, finfo) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_set_flags, 0, 0, 2) + ZEND_ARG_INFO(0, finfo) + ZEND_ARG_INFO(0, options) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_method_set_flags, 0, 0, 1) + ZEND_ARG_INFO(0, options) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_file, 0, 0, 2) + ZEND_ARG_INFO(0, finfo) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, options) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_method_file, 0, 0, 1) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_INFO(0, options) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_buffer, 0, 0, 2) + ZEND_ARG_INFO(0, finfo) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, options) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() + +static +ZEND_BEGIN_ARG_INFO_EX(arginfo_finfo_method_buffer, 0, 0, 1) + ZEND_ARG_INFO(0, string) + ZEND_ARG_INFO(0, options) + ZEND_ARG_INFO(0, context) +ZEND_END_ARG_INFO() +/* }}} */ + /* {{{ finfo_class_functions */ function_entry finfo_class_functions[] = { #if PHP_VERSION_ID >= 50200 - ZEND_ME_MAPPING(finfo, finfo_open, NULL, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(set_flags, finfo_set_flags,NULL, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(file, finfo_file, NULL, ZEND_ACC_PUBLIC) - ZEND_ME_MAPPING(buffer, finfo_buffer, NULL, ZEND_ACC_PUBLIC) + ZEND_ME_MAPPING(finfo, finfo_open, arginfo_finfo_open, ZEND_ACC_PUBLIC) + ZEND_ME_MAPPING(set_flags, finfo_set_flags,arginfo_finfo_method_set_flags, ZEND_ACC_PUBLIC) + ZEND_ME_MAPPING(file, finfo_file, arginfo_finfo_method_file, ZEND_ACC_PUBLIC) + ZEND_ME_MAPPING(buffer, finfo_buffer, arginfo_finfo_method_buffer, ZEND_ACC_PUBLIC) #else - ZEND_ME_MAPPING(finfo, finfo_open, NULL) - ZEND_ME_MAPPING(set_flags, finfo_set_flags,NULL) - ZEND_ME_MAPPING(file, finfo_file, NULL) - ZEND_ME_MAPPING(buffer, finfo_buffer, NULL) + ZEND_ME_MAPPING(finfo, finfo_open, arginfo_finfo_open) + ZEND_ME_MAPPING(set_flags, finfo_set_flags,arginfo_finfo_method_set_flags) + ZEND_ME_MAPPING(file, finfo_file, arginfo_finfo_method_file) + ZEND_ME_MAPPING(buffer, finfo_buffer, arginfo_finfo_method_buffer) #endif {NULL, NULL, NULL} }; @@ -166,14 +220,15 @@ } /* }}} */ + /* {{{ fileinfo_functions[] */ function_entry fileinfo_functions[] = { - PHP_FE(finfo_open, NULL) - PHP_FE(finfo_close, NULL) - PHP_FE(finfo_set_flags, NULL) - PHP_FE(finfo_file, NULL) - PHP_FE(finfo_buffer, NULL) + PHP_FE(finfo_open, arginfo_finfo_open) + PHP_FE(finfo_close, arginfo_finfo_close) + PHP_FE(finfo_set_flags, arginfo_finfo_set_flags) + PHP_FE(finfo_file, arginfo_finfo_file) + PHP_FE(finfo_buffer, arginfo_finfo_buffer) {NULL, NULL, NULL} }; /* }}} */ @@ -354,12 +409,12 @@ FILEINFO_DECLARE_INIT_OBJECT(object) if (object) { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lbr", &buffer, &buffer_len, &options, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|lr", &buffer, &buffer_len, &options, &zcontext) == FAILURE) { RETURN_FALSE; } FILEINFO_FROM_OBJECT(finfo, object); } else { - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lbr", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) { + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rs|lr", &zfinfo, &buffer, &buffer_len, &options, &zcontext) == FAILURE) { RETURN_FALSE; } ZEND_FETCH_RESOURCE(finfo, struct php_fileinfo *, &zfinfo, -1, "file_info", le_fileinfo); @@ -432,7 +487,7 @@ } /* }}} */ -/* {{{ proto string finfo_buffer(resource finfo, char *string [, int options]) +/* {{{ proto string finfo_buffer(resource finfo, char *string [, int options [, resource context]]) Return infromation about a string buffer. */ PHP_FUNCTION(finfo_buffer) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php