home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1996 May / PCOnline_05_1996.bin / linux / source / xap / xfm / xfm-1.000 / xfm-1 / xfm-1.3.2 / regexp / regexp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-04  |  955 b   |  49 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.  
  9. /* The following is copied directly from <X11/Xos.h> */
  10.  
  11. #ifndef X_NOT_STDC_ENV
  12. #include <string.h>
  13. #ifndef index
  14. #define index strchr
  15. #endif
  16. #ifndef rindex
  17. #define rindex strrchr
  18. #endif
  19.  
  20. #else
  21.  
  22. #ifdef SYSV
  23. #include <string.h>
  24. #define index strchr
  25. #define rindex strrchr
  26. #else
  27. #include <strings.h>
  28. #define strchr index
  29. #define strrchr rindex
  30. #endif
  31.  
  32. #endif /* X_NOT_STDC_ENV */
  33.  
  34. #define NSUBEXP  10
  35. typedef struct regexp {
  36.     char *startp[NSUBEXP];
  37.     char *endp[NSUBEXP];
  38.     char regstart;        /* Internal use only. */
  39.     char reganch;        /* Internal use only. */
  40.     char *regmust;        /* Internal use only. */
  41.     int regmlen;        /* Internal use only. */
  42.     char program[1];    /* Unwarranted chumminess with compiler. */
  43. } regexp;
  44.  
  45. extern regexp *regcomp();
  46. extern int regexec();
  47. extern void regsub();
  48. extern void regerror();
  49.