1 /* 2 * Copyright (C) 1984-2015 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 DEFINE_PATTERN(name) struct re_pattern_buffer *name 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 DEFINE_PATTERN(name) regex_t *name 25 #define CLEAR_PATTERN(name) name = NULL 26 #endif 27 28 #if HAVE_PCRE 29 #include <pcre.h> 30 #define DEFINE_PATTERN(name) pcre *name 31 #define CLEAR_PATTERN(name) name = NULL 32 #endif 33 34 #if HAVE_RE_COMP 35 char *re_comp(); 36 int re_exec(); 37 #define DEFINE_PATTERN(name) int name 38 #define CLEAR_PATTERN(name) name = 0 39 #endif 40 41 #if HAVE_REGCMP 42 char *regcmp(); 43 char *regex(); 44 extern char *__loc1; 45 #define DEFINE_PATTERN(name) char *name 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 DEFINE_PATTERN(name) struct regexp *name 53 #define CLEAR_PATTERN(name) name = NULL 54 #endif 55 56 #if NO_REGEX 57 #define DEFINE_PATTERN(name) 58 #define CLEAR_PATTERN(name) 59 #endif 60