Re: strange php_stream_from_zval requires return_value
| From: | Wez Furlong | Date: | Sat, 11 Nov 2006 15:59:43 +0000 |
| Subject: | Re: strange php_stream_from_zval requires return_value | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-26517@lists.php.net to get a copy of this message | ||
You probably want php_stream_from_zval_no_verify which doesn't
auto-return if there is an invalid stream passed in.
--Wez.
On 11/10/06, Antony Dovgal <antony@zend.com> wrote:
On 11/11/2006 04:13 AM, Arnold Daniels wrote: Hi, I've noticed that building an extension will fail when using macro php_stream_from_zval and there is not return_value variable within the scope. Well, looks like it's time to install cscope or ctags and use it to see which code actually stands behind a particular macro. ---- #define php_stream_from_zval(xstr, ppzval) ZEND_FETCH_RESOURCE2((xstr), php_stream *, (ppzval), -1, "stream", php_file_le_stream(), php_file_le_pstream())#define ZEND_FETCH_RESOURCE2(rsrc, rsrc_type, passed_id, default_id, resource_type_name, resource_type1, resource_type2) \ rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2); \ ZEND_VERIFY_RESOURCE(rsrc);#define ZEND_VERIFY_RESOURCE(rsrc) \ if (!rsrc) { \ RETURN_FALSE; \ <------------ nb }---- Obviously this macro is not what you need. I guess you need zend_fetch_resource(), which is the function actually used in ZEND_FETCH_RESOURCE2(). -- Wbr, Antony Dovgal -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php