| 1 |
nigel |
43 |
/************************************************* |
| 2 |
|
|
* Perl-Compatible Regular Expressions * |
| 3 |
|
|
*************************************************/ |
| 4 |
|
|
|
| 5 |
|
|
/* Copyright (c) 1997-2000 University of Cambridge */ |
| 6 |
|
|
|
| 7 |
|
|
#ifndef _PCRE_H |
| 8 |
|
|
#define _PCRE_H |
| 9 |
|
|
|
| 10 |
nigel |
47 |
/* The file pcre.h is build by "configure". Do not edit it; instead |
| 11 |
|
|
make changes to pcre.in. */ |
| 12 |
|
|
|
| 13 |
nigel |
43 |
#define PCRE_MAJOR @PCRE_MAJOR@ |
| 14 |
|
|
#define PCRE_MINOR @PCRE_MINOR@ |
| 15 |
|
|
#define PCRE_DATE @PCRE_DATE@ |
| 16 |
|
|
|
| 17 |
|
|
/* Win32 uses DLL by default */ |
| 18 |
|
|
|
| 19 |
|
|
#ifdef _WIN32 |
| 20 |
|
|
# ifdef STATIC |
| 21 |
|
|
# define PCRE_DL_IMPORT |
| 22 |
|
|
# else |
| 23 |
|
|
# define PCRE_DL_IMPORT __declspec(dllimport) |
| 24 |
|
|
# endif |
| 25 |
|
|
#else |
| 26 |
|
|
# define PCRE_DL_IMPORT |
| 27 |
|
|
#endif |
| 28 |
|
|
|
| 29 |
|
|
/* Have to include stdlib.h in order to ensure that size_t is defined; |
| 30 |
|
|
it is needed here for malloc. */ |
| 31 |
|
|
|
| 32 |
|
|
#include <stdlib.h> |
| 33 |
|
|
|
| 34 |
|
|
/* Allow for C++ users */ |
| 35 |
|
|
|
| 36 |
|
|
#ifdef __cplusplus |
| 37 |
|
|
extern "C" { |
| 38 |
|
|
#endif |
| 39 |
|
|
|
| 40 |
|
|
/* Options */ |
| 41 |
|
|
|
| 42 |
|
|
#define PCRE_CASELESS 0x0001 |
| 43 |
|
|
#define PCRE_MULTILINE 0x0002 |
| 44 |
|
|
#define PCRE_DOTALL 0x0004 |
| 45 |
|
|
#define PCRE_EXTENDED 0x0008 |
| 46 |
|
|
#define PCRE_ANCHORED 0x0010 |
| 47 |
|
|
#define PCRE_DOLLAR_ENDONLY 0x0020 |
| 48 |
|
|
#define PCRE_EXTRA 0x0040 |
| 49 |
|
|
#define PCRE_NOTBOL 0x0080 |
| 50 |
|
|
#define PCRE_NOTEOL 0x0100 |
| 51 |
|
|
#define PCRE_UNGREEDY 0x0200 |
| 52 |
|
|
#define PCRE_NOTEMPTY 0x0400 |
| 53 |
|
|
|
| 54 |
|
|
/* Exec-time and get-time error codes */ |
| 55 |
|
|
|
| 56 |
|
|
#define PCRE_ERROR_NOMATCH (-1) |
| 57 |
|
|
#define PCRE_ERROR_NULL (-2) |
| 58 |
|
|
#define PCRE_ERROR_BADOPTION (-3) |
| 59 |
|
|
#define PCRE_ERROR_BADMAGIC (-4) |
| 60 |
|
|
#define PCRE_ERROR_UNKNOWN_NODE (-5) |
| 61 |
|
|
#define PCRE_ERROR_NOMEMORY (-6) |
| 62 |
|
|
#define PCRE_ERROR_NOSUBSTRING (-7) |
| 63 |
|
|
|
| 64 |
|
|
/* Request types for pcre_fullinfo() */ |
| 65 |
|
|
|
| 66 |
|
|
#define PCRE_INFO_OPTIONS 0 |
| 67 |
|
|
#define PCRE_INFO_SIZE 1 |
| 68 |
|
|
#define PCRE_INFO_CAPTURECOUNT 2 |
| 69 |
|
|
#define PCRE_INFO_BACKREFMAX 3 |
| 70 |
|
|
#define PCRE_INFO_FIRSTCHAR 4 |
| 71 |
|
|
#define PCRE_INFO_FIRSTTABLE 5 |
| 72 |
|
|
#define PCRE_INFO_LASTLITERAL 6 |
| 73 |
|
|
|
| 74 |
|
|
/* Types */ |
| 75 |
|
|
|
| 76 |
|
|
typedef void pcre; |
| 77 |
|
|
typedef void pcre_extra; |
| 78 |
|
|
|
| 79 |
|
|
/* Store get and free functions. These can be set to alternative malloc/free |
| 80 |
|
|
functions if required. Some magic is required for Win32 DLL; it is null on |
| 81 |
|
|
other OS. */ |
| 82 |
|
|
|
| 83 |
|
|
PCRE_DL_IMPORT extern void *(*pcre_malloc)(size_t); |
| 84 |
|
|
PCRE_DL_IMPORT extern void (*pcre_free)(void *); |
| 85 |
|
|
|
| 86 |
|
|
#undef PCRE_DL_IMPORT |
| 87 |
|
|
|
| 88 |
|
|
/* Functions */ |
| 89 |
|
|
|
| 90 |
|
|
extern pcre *pcre_compile(const char *, int, const char **, int *, |
| 91 |
|
|
const unsigned char *); |
| 92 |
|
|
extern int pcre_copy_substring(const char *, int *, int, int, char *, int); |
| 93 |
|
|
extern int pcre_exec(const pcre *, const pcre_extra *, const char *, |
| 94 |
|
|
int, int, int, int *, int); |
| 95 |
|
|
extern int pcre_get_substring(const char *, int *, int, int, const char **); |
| 96 |
|
|
extern int pcre_get_substring_list(const char *, int *, int, const char ***); |
| 97 |
|
|
extern int pcre_info(const pcre *, int *, int *); |
| 98 |
|
|
extern int pcre_fullinfo(const pcre *, const pcre_extra *, int, void *); |
| 99 |
|
|
extern unsigned const char *pcre_maketables(void); |
| 100 |
|
|
extern pcre_extra *pcre_study(const pcre *, int, const char **); |
| 101 |
|
|
extern const char *pcre_version(void); |
| 102 |
|
|
|
| 103 |
|
|
#ifdef __cplusplus |
| 104 |
|
|
} /* extern "C" */ |
| 105 |
|
|
#endif |
| 106 |
|
|
|
| 107 |
|
|
#endif /* End of pcre.h */ |