home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / cvt304.zip / REGEXP.H < prev   
C/C++ Source or Header  |  1995-12-17  |  1KB  |  45 lines

  1.  
  2. /*
  3.  * Definitions etc. for regexp(3) routines.
  4.  *
  5.  * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
  6.  * not the System V one.
  7.  */
  8.  
  9. #ifndef REGEXP_H
  10. #define REGEXP_H
  11.  
  12. /* The first byte of the regexp internal "program" is actually this magic   */
  13. /* number; the start node begins in the second byte.                */
  14.  
  15. #define MAGIC           0234
  16.  
  17. #define NSUBEXP        10
  18.  
  19. struct S_RegExp
  20. {
  21.     char     *startp[NSUBEXP];
  22.     char     *endp[NSUBEXP];
  23.     char      regstart;        /* Internal use only. */
  24.     char      reganch;           /* Internal use only. */
  25.     char     *regmust;           /* Internal use only. */
  26.     short     regmlen;           /* Internal use only. */
  27.     char      program[1];       /* Unwarranted chumminess with compiler. */
  28. };
  29. typedef struct S_RegExp         regexp;
  30.  
  31.  
  32. regexp *     regcomp PROTO((char *exp));
  33. short        regexec PROTO((register regexp *prog, register char *string));
  34. void         regsub PROTO((regexp *prog, char *source, char *dest));
  35.  
  36. #ifndef REGERROR
  37. void         regerror PROTO((char *msg));
  38. #endif
  39.  
  40. #ifdef DEBUG
  41. void         regdump PROTO((regexp *r));
  42. #endif
  43.  
  44. #endif    /* REGEXP_H */
  45.