Guido van Rossum | 51b3aa3 | 1997-10-06 14:43:11 +0000 | [diff] [blame] | 1 | /************************************************* |
| 2 | * Perl-Compatible Regular Expressions * |
| 3 | *************************************************/ |
| 4 | |
| 5 | /* Copyright (c) 1997 University of Cambridge */ |
| 6 | |
| 7 | /* Have to include stdlib.h in order to ensure that size_t is defined; |
| 8 | it is needed in there for malloc. */ |
| 9 | |
| 10 | #ifndef PCRE_H |
| 11 | #define PCRE_H |
| 12 | |
| 13 | #include <stdlib.h> |
| 14 | #ifdef FOR_PYTHON |
| 15 | #include "Python.h" |
| 16 | #endif |
| 17 | |
| 18 | /* Options */ |
| 19 | |
| 20 | #define PCRE_CASELESS 0x01 |
| 21 | #define PCRE_EXTENDED 0x02 |
| 22 | #define PCRE_ANCHORED 0x04 |
| 23 | #define PCRE_MULTILINE 0x08 |
| 24 | #define PCRE_DOTALL 0x10 |
| 25 | |
| 26 | /* Exec-time error codes */ |
| 27 | |
| 28 | #define PCRE_ERROR_NOMATCH (-1) |
| 29 | #define PCRE_ERROR_BADREF (-2) |
| 30 | #define PCRE_ERROR_NULL (-3) |
| 31 | #define PCRE_ERROR_BADOPTION (-4) |
| 32 | #define PCRE_ERROR_BADMAGIC (-5) |
| 33 | #define PCRE_ERROR_UNKNOWN_NODE (-6) |
| 34 | |
| 35 | /* Types */ |
| 36 | |
| 37 | typedef void pcre; |
| 38 | typedef void pcre_extra; |
| 39 | |
| 40 | /* Store get and free functions. These can be set to alternative malloc/free |
| 41 | functions if required. */ |
| 42 | |
| 43 | extern void *(*pcre_malloc)(size_t); |
| 44 | extern void (*pcre_free)(void *); |
| 45 | |
| 46 | /* Functions */ |
| 47 | |
| 48 | #ifdef FOR_PYTHON |
| 49 | extern pcre *pcre_compile(char *, int, char **, int *, PyObject *); |
| 50 | #else |
| 51 | extern pcre *pcre_compile(char *, int, char **, int *); |
| 52 | #endif |
| 53 | extern int pcre_exec(pcre *, pcre_extra *, char *, int, int, int *, int); |
| 54 | extern int pcre_info(pcre *, int *, int *); |
| 55 | extern pcre_extra *pcre_study(pcre *, int, char **); |
| 56 | extern char *pcre_version(void); |
| 57 | |
| 58 | #endif /* ifndef PCRE_H */ |
| 59 | /* End of pcre.h */ |