]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - pattern.h
Vendor import of less v529.
[FreeBSD/FreeBSD.git] / pattern.h
1 /*
2  * Copyright (C) 1984-2017  Mark Nudelman
3  *
4  * You may distribute under the terms of either the GNU General Public
5  * License or the Less License, as specified in the README file.
6  *
7  * For more information, see the README file.
8  */
9
10 #if HAVE_GNU_REGEX
11 #define __USE_GNU 1
12 #include <regex.h>
13 #define PATTERN_TYPE          struct re_pattern_buffer *
14 #define CLEAR_PATTERN(name)   name = NULL
15 #endif
16
17 #if HAVE_POSIX_REGCOMP
18 #include <regex.h>
19 #ifdef REG_EXTENDED
20 #define REGCOMP_FLAG    REG_EXTENDED
21 #else
22 #define REGCOMP_FLAG    0
23 #endif
24 #define PATTERN_TYPE          regex_t *
25 #define CLEAR_PATTERN(name)   name = NULL
26 #endif
27
28 #if HAVE_PCRE
29 #include <pcre.h>
30 #define PATTERN_TYPE          pcre *
31 #define CLEAR_PATTERN(name)   name = NULL
32 #endif
33
34 #if HAVE_RE_COMP
35 char *re_comp LESSPARAMS ((char*));
36 int re_exec LESSPARAMS ((char*));
37 #define PATTERN_TYPE          int
38 #define CLEAR_PATTERN(name)   name = 0
39 #endif
40
41 #if HAVE_REGCMP
42 char *regcmp LESSPARAMS ((char*));
43 char *regex LESSPARAMS ((char**, char*));
44 extern char *__loc1;
45 #define PATTERN_TYPE          char **
46 #define CLEAR_PATTERN(name)   name = NULL
47 #endif
48
49 #if HAVE_V8_REGCOMP
50 #include "regexp.h"
51 extern int reg_show_error;
52 #define PATTERN_TYPE          struct regexp *
53 #define CLEAR_PATTERN(name)   name = NULL
54 #endif
55
56 #if NO_REGEX
57 #define PATTERN_TYPE          void *
58 #define CLEAR_PATTERN(name)   
59 #endif