home *** CD-ROM | disk | FTP | other *** search
- WildCard.c by Frank J. Perricone
-
- This program is just a simple piece of C code that matches wildcard
- strings. Pass the function wildcardmatch() two strings; the first one
- may contain as many wildcards as you like. Wildcards are * which matches
- 0 or more characters, and ? which matches exactly one character. The
- function returns TRUE or FALSE to say if they match. This is case-
- sensitive.
-
- My purpose in releasing this is for educational purposes, and so that
- some poor sap can be spared the trouble of writing this function. Note
- that it is recursive, so if you're going to be comparing very large
- strings better up your stack a bit.
-
- The main program just tests this on its two parameters. So type
- Wildcard <pattern> <string>
- to see if they match. If you think of a use for this program as is,
- I will be surprised.
-
- Feel free to use the source code, however, which IS useful. Use it however
- you like. It is in the public domain, as long as someone else (maybe the
- makers of UN*X?) hasn't copyrighted it first; if so, I'm sorry.
-
- For some help or advice or a friendly whatever call my BBS, the Crystal
- Ship, at 907-364-3362.
-