| 1 |
/*************************************************
|
| 2 |
* Perl-Compatible Regular Expressions *
|
| 3 |
*************************************************/
|
| 4 |
|
| 5 |
/* Copyright (c) 1997 University of Cambridge */
|
| 6 |
|
| 7 |
#ifndef _PCRE_H
|
| 8 |
#define _PCRE_H
|
| 9 |
|
| 10 |
/* Have to include stdlib.h in order to ensure that size_t is defined;
|
| 11 |
it is needed here for malloc. */
|
| 12 |
|
| 13 |
#include <sys/types.h>
|
| 14 |
#include <stdlib.h>
|
| 15 |
|
| 16 |
/* Options */
|
| 17 |
|
| 18 |
#define PCRE_CASELESS 0x0001
|
| 19 |
#define PCRE_EXTENDED 0x0002
|
| 20 |
#define PCRE_ANCHORED 0x0004
|
| 21 |
#define PCRE_MULTILINE 0x0008
|
| 22 |
#define PCRE_DOTALL 0x0010
|
| 23 |
#define PCRE_DOLLAR_ENDONLY 0x0020
|
| 24 |
#define PCRE_EXTRA 0x0040
|
| 25 |
#define PCRE_NOTBOL 0x0080
|
| 26 |
#define PCRE_NOTEOL 0x0100
|
| 27 |
|
| 28 |
/* Exec-time error codes */
|
| 29 |
|
| 30 |
#define PCRE_ERROR_NOMATCH (-1)
|
| 31 |
#define PCRE_ERROR_BADREF (-2)
|
| 32 |
#define PCRE_ERROR_NULL (-3)
|
| 33 |
#define PCRE_ERROR_BADOPTION (-4)
|
| 34 |
#define PCRE_ERROR_BADMAGIC (-5)
|
| 35 |
#define PCRE_ERROR_UNKNOWN_NODE (-6)
|
| 36 |
#define PCRE_ERROR_NOMEMORY (-7)
|
| 37 |
|
| 38 |
/* Types */
|
| 39 |
|
| 40 |
typedef void pcre;
|
| 41 |
typedef void pcre_extra;
|
| 42 |
|
| 43 |
/* Store get and free functions. These can be set to alternative malloc/free
|
| 44 |
functions if required. */
|
| 45 |
|
| 46 |
extern void *(*pcre_malloc)(size_t);
|
| 47 |
extern void (*pcre_free)(void *);
|
| 48 |
|
| 49 |
/* Functions */
|
| 50 |
|
| 51 |
extern pcre *pcre_compile(const char *, int, const char **, int *);
|
| 52 |
extern int pcre_exec(const pcre *, const pcre_extra *, const char *,
|
| 53 |
int, int, int *, int);
|
| 54 |
extern int pcre_info(const pcre *, int *, int *);
|
| 55 |
extern pcre_extra *pcre_study(const pcre *, int, const char **);
|
| 56 |
extern const char *pcre_version(void);
|
| 57 |
|
| 58 |
#endif /* End of pcre.h */
|