Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82523 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57020 invoked from network); 12 Feb 2015 11:35:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 11:35:45 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.43 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wg0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:65290] helo=mail-wg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F7/21-50473-F009CD45 for ; Thu, 12 Feb 2015 06:35:44 -0500 Received: by mail-wg0-f43.google.com with SMTP id n12so9483243wgh.2 for ; Thu, 12 Feb 2015 03:35:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=s15JJGGCM6G364njoypbM3br8axoyxetIrm5o/2L2bo=; b=EPa5HnxvkqyhLBkp665tfNiuotq4Pj7f9vi4uDMepqmZCUL9fXWJFAitRQiF7P6be3 thkZT79usnrDKDfSwUKkPHHyR+aYGxdQiqjk4+F04O1YmqMdwD5RwDfEnr13fXPlChrM 3kdEVmBVJ6/0+46tKsG3JgZE8X5jRdR1pTw79G0OCSOy+xGxlX8dtkkhPlUX/DoCFn3m mvILEIKEyfnb7wM1DmMY7Vb7T9JOXRpFMeUBhVykAyGxMf8V0gWhPR92vp492A7ZdldR OsrbM0Rl4BdBeDhWysvSTHKg1FvoSJRnzfj5xX5+sbWcVq5Dy5LH4KR5SFp0StDJXspe VIRg== MIME-Version: 1.0 X-Received: by 10.194.71.175 with SMTP id w15mr2607298wju.16.1423740940083; Thu, 12 Feb 2015 03:35:40 -0800 (PST) Received: by 10.27.10.168 with HTTP; Thu, 12 Feb 2015 03:35:40 -0800 (PST) In-Reply-To: <54DB4E59.4030503@lsces.co.uk> References: <54DA162D.1070806@lsces.co.uk> <54DB4E59.4030503@lsces.co.uk> Date: Thu, 12 Feb 2015 12:35:40 +0100 Message-ID: To: Lester Caine Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7bfcf000fc657d050ee284c3 Subject: Re: [PHP-DEV] zend_get_parameters_ex rework From: nikita.ppv@gmail.com (Nikita Popov) --047d7bfcf000fc657d050ee284c3 Content-Type: text/plain; charset=UTF-8 On Wed, Feb 11, 2015 at 1:43 PM, Lester Caine wrote: > On 10/02/15 14:31, Lester Caine wrote: > > in interbase/ibase_blobs.c > > > >> zval *blob_arg, *string_arg; > >> ibase_blob *ib_blob; > >> > >> RESET_ERRMSG; > >> > >> if (ZEND_NUM_ARGS() != 2 || zend_get_parameters_ex(2, &blob_arg, > &string_arg) == FAILURE) { > >> WRONG_PARAM_COUNT; > >> } > >> > >> ZEND_FETCH_RESOURCE(ib_blob, ibase_blob *, blob_arg, -1, > "Interbase blob", le_blob); > > > > I've got that if changes to > > > >> if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, > "rr", &blob_arg, &string_arg)) { > >> return; > >> } > > > > But I suspect I need to change the *string_arg to a character string so > > 'rc' and add a string_len field. At least that is what I think I'm > > seeing from the samples I have found. > > OK I've got a patch for master, but I know that the changes are not > complete! > > http://hg.lsces.org.uk/hg/php-src/rev/8ec9101f59b6 > In ibase_blob_get you're declaring 'len_arg' as 'unsigned long'. If you're using the 'l' type in zpp you should use the 'zend_long' type instead - otherwise it will not work correctly on LLP64 (aka Windows) systems. > > I've still got a question about the &string_arg on line 1.9 and if it > should be changed to a string but that change needs working through the > following code. > Yes, this should be changed to a string. E.g. use the 'S' zpp modifier and declare the variable as 'zend_string *str'. Then modify the places where it is used from Z_STRVAL_P(...) to str->val and Z_STRLEN_P(...) to str->len. > Also is what I'm doing here php7 only? so should there be wrappers for a > PHP5 build? > Apart form a few special exceptions we keep PHP7-only codebases in php-src. They don't need to (and shouldn't) contain any compat code. As another tip: If you want to link to code in the PHP codebase, I recommend using http://lxr.php.net/xref/PHP_TRUNK/ instead of GitHub - lxr.php.net is cross-referenced, so you can click through function usages. Nikita --047d7bfcf000fc657d050ee284c3--