Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12312 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10345 invoked by uid 1010); 23 Aug 2004 18:28:04 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 10249 invoked from network); 23 Aug 2004 18:28:03 -0000 Received: from unknown (HELO gibraltar.zend.office) (80.74.107.235) by pb1.pair.com with SMTP; 23 Aug 2004 18:28:03 -0000 Received: (qmail 5921 invoked by uid 500); 23 Aug 2004 18:33:48 -0000 Date: Mon, 23 Aug 2004 21:33:48 +0300 To: internals@lists.php.net Message-ID: <20040823183348.GA5910@zend.com> Mail-Followup-To: internals@lists.php.net References: <20040823175608.GB5466@zend.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i Organization: Zend Technologies Subject: Re: [PHP-DEV] Passing structure to PHP function From: michael@zend.com (Michael Spector) On Mon, Aug 23, 2004 at 11:10:16AM -0700, Rasmus Lerdorf wrote: > On Mon, 23 Aug 2004, Michael Spector wrote: > > I'm "translating" some function, that recieves a pointer to structure of > > this type: > > > > struct { > > char * text; > > char ** value; > > int flags; > > }; > > This looks like a string, an array and an integer to me. So just pass > that. Or an array of those if there is more than one. > Actually, the prototype of the function is the following: int newtWinEntries (char * title, char * text, int suggestedWidth, int flexDown, int flexUp, int dataWidth, struct newtWinEntry * items, char * button1, ...) Where newtWinEntry is the structure mentioned above. The problem is that I have to accept a list of such structures as an argument. Value (char ** value) is the reference to the returned value. So, you say there's no need to use string keys in the array ? -- Best regards, Michael