home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 4 / MA_Cover_4.iso / libs / regexp / include / libraries / regexp.h
Encoding:
C/C++ Source or Header  |  1998-02-26  |  1.9 KB  |  56 lines

  1. #ifndef LIBRARIES_REGEXP_H
  2. #define LIBRARIES_REGEXP_H
  3. /*
  4. **    $VER: regexp.h 38.1 (26.2.98)
  5. **
  6. **    (C) Copyright 1998 Matthias Bethke
  7. */
  8.  
  9. #ifndef DOS_DOS_H
  10. #include "dos/dos.h"
  11. #endif
  12.  
  13. /*
  14. ** Error numbers returned by IoErr() if a regexp.library function
  15. ** fails. Use RegXlatError() to obtain the error text for a code
  16. */
  17.  
  18. #define REXPERR_NULLARG -1                        /* "NULL argument" */
  19. #define REXPERR_REXPTOOBIG -2                    /* "Regexp too big */
  20. #define REXPERR_TOOMANYPARENS -3                /* "Too many parentheses" */
  21. #define REXPERR_UNMATCHEDPARENS -4            /* "unmatched parentheses */
  22. #define REXPERR_JUNKONEND -5                    /* "Junk on end" (should never happen) */
  23. #define REXPERR_REPKLEENECBE -6                /* "Repetition/Kleene (+*) could be empty" */
  24. #define REXPERR_NESTEDPOSTFIXOP -7            /* "Nested postfix (+*?) operators" */
  25. #define REXPERR_INVALIDRANGE -8                /* "Invalid range" */
  26. #define REXPERR_UNMATCHEDRNGBRKT -9            /* "Unmatched range bracket" */
  27. #define REXPERR_INTERNALURP -10                /* "Internal urp" */
  28. #define REXPERR_PFOPFOLLOWSNOTHING -11        /* "Postfix operator (+*?) follows nothing" */
  29. #define REXPERR_TRAILINGBKSLASH -12            /* "Trailing backslash" */
  30. #define REXPERR_CORRUPTEDPROG -13            /* "Corrupted program" */
  31. #define REXPERR_CORRUPTEDMEM -14                /* "Corrupted memory" */
  32. #define REXPERR_CORRUPTEDPTRS -15            /* "Corrupted pointers" */
  33. #define REXPERR_INTERNALFOULUP -16            /* "Internal foulup" */
  34.  
  35.  
  36. /*
  37. ** better don't mess with struct regexp, use it as an abstract
  38. ** handle for expressions only!
  39. ** You may read startp/endp pointers to get start/end of matched
  40. ** (sub)expressions though.
  41. */
  42.  
  43. #define NSUBEXP  10
  44. typedef struct regexp {
  45.     STRPTR startp[NSUBEXP];
  46.     STRPTR endp[NSUBEXP];
  47.     UBYTE regstart;        /* Internal use only. */
  48.     UBYTE reganch;            /* Internal use only. */
  49.     STRPTR regmust;        /* Internal use only. */
  50.     LONG regmlen;            /* Internal use only. */
  51.     UBYTE program[1];        /* Unwarranted chumminess with compiler. */
  52. } regexp;
  53.  
  54.  
  55. #endif /* LIBRARIES_REGEXP_H */
  56.