Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:26509 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 219 invoked by uid 1010); 11 Nov 2006 01:31:09 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 204 invoked from network); 11 Nov 2006 01:31:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 Nov 2006 01:31:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=antony@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=antony@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 212.25.124.162 as permitted sender) X-PHP-List-Original-Sender: antony@zend.com X-Host-Fingerprint: 212.25.124.162 mail.zend.com Linux 2.5 (sometimes 2.4) (4) Received: from [212.25.124.162] ([212.25.124.162:4799] helo=mail.zend.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 76/00-33389-7D725554 for ; Fri, 10 Nov 2006 20:31:09 -0500 Received: (qmail 25004 invoked from network); 11 Nov 2006 01:29:35 -0000 Received: from internal.zend.office (HELO ?127.0.0.1?) (10.1.1.1) by internal.zend.office with SMTP; 11 Nov 2006 01:29:35 -0000 Message-ID: <455527D3.6050606@zend.com> Date: Sat, 11 Nov 2006 04:30:59 +0300 User-Agent: Thunderbird 1.5.0.7 (X11/20060909) MIME-Version: 1.0 To: Arnold Daniels CC: internals@lists.php.net References: <455523C4.70106@adaniels.nl> In-Reply-To: <455523C4.70106@adaniels.nl> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] strange php_stream_from_zval requires return_value From: antony@zend.com (Antony Dovgal) 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