home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 May / W2KPRK.iso / apps / posix / source / PAX / REGEXP.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-17  |  1.0 KB  |  42 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.  
  8. #ifndef _PAX_REGEXP_H
  9. #define _PAX_REGEXP_H
  10.  
  11. #define NSUBEXP  10
  12. typedef struct regexp {
  13.     char *startp[NSUBEXP];
  14.     char *endp[NSUBEXP];
  15.     char regstart;        /* Internal use only. */
  16.     char reganch;        /* Internal use only. */
  17.     char *regmust;        /* Internal use only. */
  18.     int regmlen;        /* Internal use only. */
  19.     char program[1];    /* Unwarranted chumminess with compiler. */
  20. } regexp;
  21.  
  22.  
  23. /*
  24.  * The first byte of the regexp internal "program" is actually this magic
  25.  * number; the start node begins in the second byte.
  26.  */
  27. #define    MAGIC    0234
  28.  
  29. #ifdef __STDC__  /* Xn */
  30. extern regexp *regcomp(char *);
  31. extern int regexec(register regexp *, register char *);
  32. extern void regsub(regexp *, char *, char *);
  33. extern void regerror(char *);
  34. #else  /* Xn */
  35. extern regexp *regcomp();
  36. extern int regexec();
  37. extern void regsub();
  38. extern void regerror();
  39. #endif  /* Xn */
  40.  
  41. #endif /* _PAX_REGEXP_H */
  42.