home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 5 / FreshFish_July-August1994.bin / bbs / util / jade-3.0.lha / Jade / src / regexp / regexp.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-03-30  |  1.1 KB  |  48 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. #define NSUBEXP  10
  8. typedef struct regexp {
  9.     char *startp[NSUBEXP];
  10.     char *endp[NSUBEXP];
  11.     char regstart;        /* Internal use only. */
  12.     char reganch;        /* Internal use only. */
  13.     char *regmust;        /* Internal use only. */
  14.     int regmlen;        /* Internal use only. */
  15.     char program[1];    /* Unwarranted chumminess with compiler. */
  16. } regexp;
  17.  
  18. /* eflags for regexec2() */
  19. #define REG_NOTBOL 1
  20. #define REG_NOCASE 2
  21.  
  22. #define regexec(p,s) regexec2(p,s,0)
  23.  
  24. #ifdef __STDC__
  25. extern regexp *regcomp(char *);
  26. extern int regexec2(regexp *, char *, int);
  27. extern void regsub(regexp *, char *, char *);
  28. extern int regsublen(regexp *, char *);
  29. extern void regerror(char *);
  30. #else
  31. extern regexp *regcomp();
  32. extern int regexec2();
  33. extern void regsub();
  34. extern int regsub();
  35. extern void regerror();
  36. #endif
  37.  
  38. /* My Amiga's C library calls str[n]casecmp() str[n]icmp()  */
  39. #ifdef AMIGA
  40. # ifndef strcasecmp
  41. #  define strcasecmp stricmp
  42. # endif
  43. # ifndef strncasecmp
  44. #  define strncasecmp strnicmp
  45. # endif
  46. #endif
  47.  
  48.