Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31477 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 26999 invoked by uid 1010); 7 Aug 2007 15:59:52 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 26984 invoked from network); 7 Aug 2007 15:59:52 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 Aug 2007 15:59:52 -0000 Authentication-Results: pb1.pair.com smtp.mail=johannes@php.net; spf=unknown; sender-id=unknown Authentication-Results: pb1.pair.com header.from=johannes@php.net; sender-id=unknown Received-SPF: unknown (pb1.pair.com: domain php.net does not designate 83.243.58.163 as permitted sender) X-PHP-List-Original-Sender: johannes@php.net X-Host-Fingerprint: 83.243.58.163 mail4.netbeat.de Received: from [83.243.58.163] ([83.243.58.163:45230] helo=mail4.netbeat.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2A/53-05160-6F698B64 for ; Tue, 07 Aug 2007 11:59:52 -0400 Received: (qmail 10377 invoked by uid 507); 7 Aug 2007 15:47:03 -0000 Received: from unknown (HELO ?192.168.1.102?) (postmaster%schlueters.de@82.135.71.124) by mail4.netbeat.de with ESMTPA; 7 Aug 2007 15:47:03 -0000 To: David Soria Parra Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain Date: Tue, 07 Aug 2007 17:46:55 +0200 Message-ID: <1186501615.2772.38.camel@johannes.nop> Mime-Version: 1.0 X-Mailer: Evolution 2.10.3 (2.10.3-1.fc7) Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [PATCH] Getopt with longopts and windows support - part 2 From: johannes@php.net (Johannes =?ISO-8859-1?Q?Schl=FCter?=) David, On Mon, 2007-08-06 at 09:57 -0400, David Soria Parra wrote: > Hi internals, > > so based on a discussion of php.pecl we thought about using the php_getopt > for the PHP_FUNCTION(getopt) instead of the system provided getopt. Here > is the patch for that. Hopefully someone is reviewing and commiting the > patch as i don't have karma. The idea is good imo, but there are a few things we have to do: - We need more tests, as far as I saw using grep we just have a single testcase for getopt() which is certainly not enough when replacing the implementation. - The current implementation is not thread-safe, I don't know about the glibc implementation but if we use our own implementation for PHP's getopt function that should be threadsafe. - If you move php_getopt to main you have to mark it as PHPAPI so the SAPIs can use it. Maybe there's more, didn't do a deeper review of the patch, yet, since I'd like to wait a) until Jani moved the files and b) we have more tests :-) johannes