[physfs] globbing?

Bradley Bell btb at icculus.org
Wed Jun 11 01:47:09 EDT 2003


Quoting "Ryan C. Gordon" <icculus at clutteredmind.org>:
> > Has there been any thought on adding a glob type function to physfs?
> > AFAICT, this would be pretty easy to do, using fnmatch(3), but that
> > doesn't exist on most platforms. I think there is a BSD-licensed
> > version out there that could be used, though.
> 
> Please update from CVS and look at globbing.h (and the implementation in
> globbing.c) in the "extras" directory. It wraps PHYSFS_enumerateFiles()
> and does pattern matching by-hand (no external fnmatch() function).
> 
> This respects the '*' and '?' wildcards, and has a flag for
> case-insensitivity (which only some implementations of fnmatch() have, as
> a GNU extension).
> 
> Might be neat to do this with a regexp library, but that's academic,
> really.
> 
> Note that this isn't part of the physfs API, but you can copy the
> globbing.c into your project directly, even before the upcoming license
> change, since that file is in the public domain.

I was just about to start writing pretty much the same thing.  But you've saved
me the trouble, yet again...
cheers,
-brad




More information about the physfs mailing list