blob: f0f9824703b6f06e05dd1a29046203b8a092c36e [file] [log] [blame]
Guido van Rossum51b3aa31997-10-06 14:43:11 +00001/*************************************************
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;
8it 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
37typedef void pcre;
38typedef void pcre_extra;
39
40/* Store get and free functions. These can be set to alternative malloc/free
41functions if required. */
42
43extern void *(*pcre_malloc)(size_t);
44extern void (*pcre_free)(void *);
45
46/* Functions */
47
48#ifdef FOR_PYTHON
49extern pcre *pcre_compile(char *, int, char **, int *, PyObject *);
50#else
51extern pcre *pcre_compile(char *, int, char **, int *);
52#endif
53extern int pcre_exec(pcre *, pcre_extra *, char *, int, int, int *, int);
54extern int pcre_info(pcre *, int *, int *);
55extern pcre_extra *pcre_study(pcre *, int, char **);
56extern char *pcre_version(void);
57
58#endif /* ifndef PCRE_H */
59/* End of pcre.h */