Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:1452 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 22327 invoked from network); 12 May 2003 19:03:59 -0000 Received: from unknown (HELO carmine.bestweb.net) (209.94.102.73) by pb1.pair.com with SMTP; 12 May 2003 19:03:59 -0000 Received: from [192.168.1.100] (ip216-179-71-153.cust.bestweb.net [216.179.71.153]) by carmine.bestweb.net (Postfix) with ESMTP id 2C53C23A8D; Mon, 12 May 2003 14:03:54 -0500 (EST) To: Hans Zaunere Cc: internals@lists.php.net In-Reply-To: <20030512182902.34209.qmail@web12806.mail.yahoo.com> References: <20030512182902.34209.qmail@web12806.mail.yahoo.com> Content-Type: text/plain Organization: Message-ID: <1052761164.6733.59.camel@hasele> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 12 May 2003 13:39:24 -0400 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Accepting time_t as an argument From: sterling@bumblebury.com (Sterling Hughes) On Mon, 2003-05-12 at 14:29, Hans Zaunere wrote: > I have a function that will be implemented in an extension: > > ZEND_FUNCTION(msr_set_time); > > which started life as a real C function: > > void msr_set_time( const time_t ts ); > > I'm using Andrei's way, zend_parse_parameters(), to handle arguments. So, > > long l; > zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &l); > > seems to make sense. But, what if my code ends up on a platform where time_t > is an int? Essentially, the question is how to use compiler specific > typedefs with zend_parse_parameters() > well you could register a resource, but a long is fine. Just cast it to a time_t when you pass it. You shouldn't have to worry about overflows. -Sterling > Thank you, > > Hans -- Good judgement comes from experience, and experience comes from bad judgement. - Fred Brooks