home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume33 / problem / part01 / regexp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-19  |  1.6 KB  |  44 lines

  1. /*
  2. ** external definitions needed for interfacing with regexp.C
  3. **
  4. ** regexp.h regexp.h 1.3   Delta'd: 23:06:20 7/2/92   Mike Lijewski, CNSF
  5. **
  6. ** Copyright (c) 1991 Cornell University
  7. ** All rights reserved.
  8. **
  9. ** Redistribution and use in source and binary forms are permitted
  10. ** provided that: (1) source distributions retain this entire copyright
  11. ** notice and comment, and (2) distributions including binaries display
  12. ** the following acknowledgement:  ``This product includes software
  13. ** developed by Cornell University'' in the documentation or other
  14. ** materials provided with the distribution and in all advertising
  15. ** materials mentioning features or use of this software. Neither the
  16. ** name of the University nor the names of its contributors may be used
  17. ** to endorse or promote products derived from this software without
  18. ** specific prior written permission.
  19. **
  20. ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  21. ** IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  22. ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  23. */
  24.  
  25. #ifndef _REGEXP_H
  26. #define _REGEXP_H
  27.  
  28. #define NSUBEXP  10
  29. typedef struct regexp {
  30.     char *startp[NSUBEXP];
  31.     char *endp[NSUBEXP];
  32.     char regstart;        // Internal use only.
  33.     char reganch;        // Internal use only.
  34.     char *regmust;        // Internal use only.
  35.     int regmlen;        // Internal use only.
  36.     char program[1];    // Unwarranted chumminess with compiler.
  37. } regexp;
  38.  
  39. extern const char *REerror; // how we pass error messages around
  40. extern regexp *regcomp(const char *exp);
  41. extern int regexec(regexp *prog, char *string);
  42.  
  43. #endif
  44.