From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10273 invoked from network); 25 Aug 1997 05:37:25 -0000 Received: from math.gatech.edu (list@130.207.146.50) by coral.primenet.com.au with SMTP; 25 Aug 1997 05:37:25 -0000 Received: (from list@localhost) by math.gatech.edu (8.8.5/8.8.5) id BAA15672; Mon, 25 Aug 1997 01:31:33 -0400 (EDT) Resent-Date: Mon, 25 Aug 1997 01:31:33 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199708250530.BAA04562@hzoli.home> Subject: Re: libzglob? In-Reply-To: <199708232232.BAA25694@alpha.hut.fi> from Jarkko Hietaniemi at "Aug 24, 97 01:32:07 am" To: jhi@iki.fi Date: Mon, 25 Aug 1997 01:30:15 -0400 (EDT) Cc: zsh-workers@math.gatech.edu X-Mailer: ELM [version 2.4ME+ PL31 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-ID: <"tnL3k1.0.pq3.qYH0q"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/3455 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > has there been any talk / thought / action as to separate the zsh > globbing code into its own library? (as Zle nowadays seems to be, > sort of) glob.c is quite independent of the rest of the code, I think it would not be hard to make it a standalone library. > I realize that this is not trivial because the glob.c seems to > use a lot of general zsh structs and call other zsh functions, > ansi2knr, makepro.sh, for some things it may be useful to use ansi2knr is only needed for very old traditional compilers which cannot compile programs with ANSI C prototypes. Makepro is just a simple prototype generator. > If this happens I can see one zsh API change need right now: glob() > should be 'thread-safe' in that the various glob options should be > passed in as arguments (a bitmask? a struct?) instead of being part of > the 'global' zsh state -- as there is no zsh opts[] if only the glob > lib is being used. There are several static variables used by glob.c, so if you want real re-entrant glob, more changes are necessary. The scanner in zsh glob can be used for perl, however the pattern matching part has some problems. One for example is that (ab#)# does not match ab. For perl, a zsh glob -> regexp translator would be much more roboust and relyable. Zoltan