home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume29 / regex-glob / part01 / match.h < prev    next >
C/C++ Source or Header  |  1992-04-06  |  2KB  |  59 lines

  1. /*
  2.  EPSHeader
  3.  
  4.    File: match.h
  5.    Author: J. Kercheval
  6.    Created: Sat, 01/05/1991  22:27:18
  7. */
  8. /*
  9.  EPSRevision History
  10.  
  11.    J. Kercheval  Wed, 02/20/1991  22:28:37  Released to Public Domain
  12. */
  13.  
  14. /*
  15.    Wildcard Pattern Matching
  16. */
  17.  
  18. #ifndef BOOLEAN
  19. # define BOOLEAN int
  20. # define TRUE 1
  21. # define FALSE 0
  22. #endif
  23.  
  24. /*----------------------------------------------------------------------------
  25. *
  26. *  Match the pattern PATTERN against the string TEXT;
  27. *  return TRUE if it matches, FALSE otherwise.
  28. *
  29. *  A match means the entire string TEXT is used up in matching.
  30. *
  31. *  In the pattern string:
  32. *       `*' matches any sequence of characters
  33. *       `?' matches any character
  34. *       [SET] matches any character in the specified set,
  35. *       [!SET] or [^SET] matches any character not in the specified set.
  36. *
  37. *  Note: the standard regex character '+' (one or more) should by
  38. *        simulated by using "?*" which is equivelant here.
  39. *
  40. *  A set is composed of characters or ranges; a range looks like
  41. *  character hyphen character (as in 0-9 or A-Z).
  42. *  [0-9a-zA-Z_] is the set of characters allowed in C identifiers.
  43. *  Any other character in the pattern must be matched exactly.
  44. *
  45. *  To suppress the special syntactic significance of any of `[]*?!^-\',
  46. *  and match the character exactly, precede it with a `\'.
  47. *
  48. ----------------------------------------------------------------------------*/
  49.  
  50. BOOLEAN match (char *pattern, char *text);
  51.  
  52. /*----------------------------------------------------------------------------
  53. *
  54. * Return TRUE if PATTERN has any special wildcard characters
  55. *
  56. ----------------------------------------------------------------------------*/
  57.  
  58. BOOLEAN is_pattern (char *pattern);
  59.