home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / fed0217s.zip / include / regexp.h < prev    next >
C/C++ Source or Header  |  2000-12-16  |  928b  |  36 lines

  1. /*
  2.  * Definitions etc. for regexp(3) routines.
  3.  *
  4.  * Caveat:  this is V8 regexp(3) [actually, a reimplementation thereof],
  5.  * not the System V one.
  6.  */
  7. #ifndef  __REGEXP_H
  8. #define  __REGEXP_H
  9.  
  10. #define NSUBEXP  10
  11.  
  12. #define regexcase(r,st) (r)->regcase=(st)
  13.  
  14. typedef struct regexp {
  15.     char *startp[NSUBEXP];
  16.     char *endp[NSUBEXP];
  17.     int regcase;
  18.     int regbol_off;
  19.     char regstart;        /* Internal use only. */
  20.     char reganch;        /* Internal use only. */
  21.     char *regmust;        /* Internal use only. */
  22.     int regmlen;        /* Internal use only. */
  23.     char program[1];    /* Unwarranted chumminess with compiler. */
  24. } regexp;
  25.  
  26. regexp* regcomp(char *exp);
  27. int regexec(regexp *prog, char *string);
  28. void regsub(regexp *prog, char *source, char *dest);
  29. void regerror(char *s);
  30.  
  31. void regexp_bol_off(regexp *prog);  /* Disable matching of BOL */
  32. void regexp_bol_on(regexp *prog);   /* Enable matching of BOL  */
  33.  
  34. #endif
  35.  
  36.