1 /* 2 * Copyright (C) 1984-2019 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_PCRE2 35 #define PCRE2_CODE_UNIT_WIDTH 8 36 #include <pcre2.h> 37 #define PATTERN_TYPE pcre2_code * 38 #define CLEAR_PATTERN(name) name = NULL 39 #endif 40 41 #if HAVE_RE_COMP 42 char *re_comp LESSPARAMS ((char*)); 43 int re_exec LESSPARAMS ((char*)); 44 #define PATTERN_TYPE int 45 #define CLEAR_PATTERN(name) name = 0 46 #endif 47 48 #if HAVE_REGCMP 49 char *regcmp LESSPARAMS ((char*)); 50 char *regex LESSPARAMS ((char**, char*)); 51 extern char *__loc1; 52 #define PATTERN_TYPE char ** 53 #define CLEAR_PATTERN(name) name = NULL 54 #endif 55 56 #if HAVE_V8_REGCOMP 57 #include "regexp.h" 58 extern int reg_show_error; 59 #define PATTERN_TYPE struct regexp * 60 #define CLEAR_PATTERN(name) name = NULL 61 #endif 62 63 #if NO_REGEX 64 #define PATTERN_TYPE void * 65 #define CLEAR_PATTERN(name) 66 #endif 67