xref: /minix/external/bsd/less/dist/pattern.h (revision dda632a2)
1 /*	$NetBSD: pattern.h,v 1.3 2011/07/03 20:14:13 tron Exp $	*/
2 
3 /*
4  * Copyright (C) 1984-2011  Mark Nudelman
5  *
6  * You may distribute under the terms of either the GNU General Public
7  * License or the Less License, as specified in the README file.
8  *
9  * For more information about less, or for information on how to
10  * contact the author, see the README file.
11  */
12 
13 #if HAVE_POSIX_REGCOMP
14 #include <regex.h>
15 #ifdef REG_EXTENDED
16 extern int more_mode;
17 #define	REGCOMP_FLAG	(more_mode ? 0 : REG_EXTENDED)
18 #else
19 #define	REGCOMP_FLAG	0
20 #endif
21 #define DEFINE_PATTERN(name)  regex_t *name
22 #define CLEAR_PATTERN(name)   name = NULL
23 #endif
24 
25 #if HAVE_PCRE
26 #include <pcre.h>
27 #define DEFINE_PATTERN(name)  pcre *name
28 #define CLEAR_PATTERN(name)   name = NULL
29 #endif
30 
31 #if HAVE_RE_COMP
32 char *re_comp();
33 int re_exec();
34 #define DEFINE_PATTERN(name)  int name
35 #define CLEAR_PATTERN(name)   name = 0
36 #endif
37 
38 #if HAVE_REGCMP
39 char *regcmp();
40 char *regex();
41 extern char *__loc1;
42 #define DEFINE_PATTERN(name)  char *name
43 #define CLEAR_PATTERN(name)   name = NULL
44 #endif
45 
46 #if HAVE_V8_REGCOMP
47 #include "regexp.h"
48 #define DEFINE_PATTERN(name)  struct regexp *name
49 #define CLEAR_PATTERN(name)   name = NULL
50 #endif
51 
52