com php-src: Convert exif functions arginfo to php stubs: ext/exif/exif.c ext/exif/exif.stub.php ext/exif/exif_arginfo.h

From: Date: Mon, 26 Aug 2019 15:25:12 +0000
Subject: com php-src: Convert exif functions arginfo to php stubs: ext/exif/exif.c ext/exif/exif.stub.php ext/exif/exif_arginfo.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-108070@lists.php.net to get a copy of this message
Commit: 743591458c8505ea13e2391898cc502702461983 Author: Craig Duncan <git@duncanc.co.uk> Thu, 15 Aug 2019 21:47:15 +0200 Committer: Christoph M. Becker <cmbecker69@gmx.de> Mon, 26 Aug 2019 17:25:12 +0200 Parents: 5b09e6043c930168cacce3aa37346560be65d8b3 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=743591458c8505ea13e2391898cc502702461983 Log: Convert exif functions arginfo to php stubs We also allow sections needed to be null. Changed paths: M ext/exif/exif.c A ext/exif/exif.stub.php A ext/exif/exif_arginfo.h Diff: diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 8ad018b..e9efa32 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 <math.h> #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 0000000..a878c3c --- /dev/null +++ b/ext/exif/exif.stub.php @@ -0,0 +1,13 @@ +<?php + +/** @return string|false */ +function exif_tagname(int $index) {} + +/** @return array|false */ +function exif_read_data($filename, ?string $sections_needed = null, bool $sub_arrays = false, bool $read_thumbnail = false) {} + +/** @return string|false */ +function exif_thumbnail($filename, &$width = null, &$height = null, &$imagetype = null) {} + +/** @return int|false */ +function exif_imagetype(string $filename) {} diff --git a/ext/exif/exif_arginfo.h b/ext/exif/exif_arginfo.h new file mode 100644 index 0000000..2e449de --- /dev/null +++ b/ext/exif/exif_arginfo.h @@ -0,0 +1,23 @@ +/* This is a generated file, edit the .stub.php file instead. */ + +ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_tagname, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, index, IS_LONG, 0) +ZEND_END_ARG_INFO() + +ZEND_BEGIN_ARG_INFO_EX(arginfo_exif_read_data, 0, 0, 1) + ZEND_ARG_INFO(0, filename) + ZEND_ARG_TYPE_INFO(0, sections_needed, IS_STRING, 1) + ZEND_ARG_TYPE_INFO(0, sub_arrays, _IS_BOOL, 0) + ZEND_ARG_TYPE_INFO(0, read_thumbnail, _IS_BOOL, 0) +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_EX(arginfo_exif_imagetype, 0, 0, 1) + ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) +ZEND_END_ARG_INFO()

« previous php.cvs (#108070) next »