1 /* $NetBSD: pattern.h,v 1.4 2013/09/04 19:44:21 tron Exp $ */ 2 3 /* 4 * Copyright (C) 1984-2012 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, see the README file. 10 */ 11 12 #if HAVE_GNU_REGEX 13 #define __USE_GNU 1 14 #include <regex.h> 15 #define DEFINE_PATTERN(name) struct re_pattern_buffer *name 16 #define CLEAR_PATTERN(name) name = NULL 17 #endif 18 19 #if HAVE_POSIX_REGCOMP 20 #include <regex.h> 21 #ifdef REG_EXTENDED 22 extern int more_mode; 23 #define REGCOMP_FLAG (more_mode ? 0 : REG_EXTENDED) 24 #else 25 #define REGCOMP_FLAG 0 26 #endif 27 #define DEFINE_PATTERN(name) regex_t *name 28 #define CLEAR_PATTERN(name) name = NULL 29 #endif 30 31 #if HAVE_PCRE 32 #include <pcre.h> 33 #define DEFINE_PATTERN(name) pcre *name 34 #define CLEAR_PATTERN(name) name = NULL 35 #endif 36 37 #if HAVE_RE_COMP 38 char *re_comp(); 39 int re_exec(); 40 #define DEFINE_PATTERN(name) int name 41 #define CLEAR_PATTERN(name) name = 0 42 #endif 43 44 #if HAVE_REGCMP 45 char *regcmp(); 46 char *regex(); 47 extern char *__loc1; 48 #define DEFINE_PATTERN(name) char *name 49 #define CLEAR_PATTERN(name) name = NULL 50 #endif 51 52 #if HAVE_V8_REGCOMP 53 #include "regexp.h" 54 #define DEFINE_PATTERN(name) struct regexp *name 55 #define CLEAR_PATTERN(name) name = NULL 56 #endif 57 58 #if NO_REGEX 59 #define DEFINE_PATTERN(name) 60 #define CLEAR_PATTERN(name) 61 #endif 62