From owner-freebsd-arch Sat Nov 3 11:43:35 2001 Delivered-To: freebsd-arch@freebsd.org Received: from buffoon.automagic.org (buffoon.automagic.org [208.185.30.208]) by hub.freebsd.org (Postfix) with SMTP id C9BBB37B416 for ; Sat, 3 Nov 2001 11:43:32 -0800 (PST) Received: (qmail 76351 invoked by uid 1000); 3 Nov 2001 19:43:32 -0000 Date: Sat, 3 Nov 2001 14:43:32 -0500 From: Joe Abley To: Dag-Erling Smorgrav Cc: Peter Pentchev , arch@freebsd.org Subject: Re: POSIX character class support for 1Tawk Message-ID: <20011103144331.S25226@buffoon.automagic.org> References: <20011102233831.L25226@buffoon.automagic.org> <20011103012226.Q25226@buffoon.automagic.org> <20011103145608.B76275@straylight.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.22.1i Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Nov 03, 2001 at 05:21:08PM +0100, Dag-Erling Smorgrav wrote: > Peter Pentchev writes: > > On Sat, Nov 03, 2001 at 07:23:59AM +0100, Dag-Erling Smorgrav wrote: > > > Joe Abley writes: > > > > Our isalpha() and friends are locale-sensitive, I think. > > > Only if the caller has previously called setlocale(). > > So what's the problem in calling setlocale(LC_ALL, "") > > early in main() or something, as so many other utilities in > > our base system already do? > > You still have to totally rewrite the character class matching code, > instead of simply extending it like I've done. See my earlier > comments about enumerating the members of a character or equivalence > class. Rather than coding the character classes statically, as you have done, is not it possible to extract the character set for each posix class by expanding corresponding character ranges from _CurrentRuneLocale? This smells unportable (is there a portable interface to that structure?) Hard-coding the strings corresponding to the most common locales in bawk seems sub-optimal, considering that the same information exists elsewhere. The hard-coded strings are guaranteed to be wrong for some locale at some point in the future, if not now. Joe To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message