From: Craig Duncan Date: Thu, 15 Aug 2019 19:47:15 +0000 (+0200) Subject: Convert exif functions arginfo to php stubs X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=743591458c8505ea13e2391898cc502702461983;p=php Convert exif functions arginfo to php stubs We also allow sections needed to be null. --- diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 8ad018b31d..e9efa325a1 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -42,6 +42,7 @@ #endif #include "php_exif.h" +#include "exif_arginfo.h" #include #include "php_ini.h" #include "ext/standard/php_string.h" @@ -66,31 +67,6 @@ typedef unsigned char uchar; #define MAX_IFD_NESTING_LEVEL 150 -/* {{{ arginfo */ -ZEND_BEGIN_ARG_INFO(arginfo_exif_tagname, 0) - ZEND_ARG_INFO(0, index) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_read_data, 0, 0, 1) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(0, sections_needed) - ZEND_ARG_INFO(0, sub_arrays) - ZEND_ARG_INFO(0, read_thumbnail) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_thumbnail, 0, 0, 1) - ZEND_ARG_INFO(0, filename) - ZEND_ARG_INFO(1, width) - ZEND_ARG_INFO(1, height) - ZEND_ARG_INFO(1, imagetype) -ZEND_END_ARG_INFO() - -ZEND_BEGIN_ARG_INFO(arginfo_exif_imagetype, 0) - ZEND_ARG_INFO(0, imagefile) -ZEND_END_ARG_INFO() - -/* }}} */ - /* {{{ exif_functions[] */ static const zend_function_entry exif_functions[] = { @@ -4391,7 +4367,7 @@ PHP_FUNCTION(exif_read_data) ZEND_PARSE_PARAMETERS_START(1, 4) Z_PARAM_ZVAL(stream) Z_PARAM_OPTIONAL - Z_PARAM_STR(z_sections_needed) + Z_PARAM_STR_EX(z_sections_needed, 1, 0) Z_PARAM_BOOL(sub_arrays) Z_PARAM_BOOL(read_thumbnail) ZEND_PARSE_PARAMETERS_END(); diff --git a/ext/exif/exif.stub.php b/ext/exif/exif.stub.php new file mode 100644 index 0000000000..a878c3c3ff --- /dev/null +++ b/ext/exif/exif.stub.php @@ -0,0 +1,13 @@ +