1238730Sdelphij/* 2330571Sdelphij * Copyright (C) 1984-2017 Mark Nudelman 3238730Sdelphij * 4238730Sdelphij * You may distribute under the terms of either the GNU General Public 5238730Sdelphij * License or the Less License, as specified in the README file. 6238730Sdelphij * 7238730Sdelphij * For more information, see the README file. 8238730Sdelphij */ 9195902Sdelphij 10237613Sdelphij#if HAVE_GNU_REGEX 11237613Sdelphij#define __USE_GNU 1 12237613Sdelphij#include <regex.h> 13330571Sdelphij#define PATTERN_TYPE struct re_pattern_buffer * 14237613Sdelphij#define CLEAR_PATTERN(name) name = NULL 15237613Sdelphij#endif 16237613Sdelphij 17195902Sdelphij#if HAVE_POSIX_REGCOMP 18195902Sdelphij#include <regex.h> 19195902Sdelphij#ifdef REG_EXTENDED 20195941Sdelphijextern int less_is_more; 21330571Sdelphij#define REGCOMP_FLAG (less_is_more ? 0 : REG_EXTENDED) 22195902Sdelphij#else 23330571Sdelphij#define REGCOMP_FLAG 0 24195902Sdelphij#endif 25330571Sdelphij#define PATTERN_TYPE regex_t * 26195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 27195902Sdelphij#endif 28195902Sdelphij 29195902Sdelphij#if HAVE_PCRE 30195902Sdelphij#include <pcre.h> 31330571Sdelphij#define PATTERN_TYPE pcre * 32195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 33195902Sdelphij#endif 34195902Sdelphij 35195902Sdelphij#if HAVE_RE_COMP 36330571Sdelphijchar *re_comp LESSPARAMS ((char*)); 37330571Sdelphijint re_exec LESSPARAMS ((char*)); 38330571Sdelphij#define PATTERN_TYPE int 39195902Sdelphij#define CLEAR_PATTERN(name) name = 0 40195902Sdelphij#endif 41195902Sdelphij 42195902Sdelphij#if HAVE_REGCMP 43330571Sdelphijchar *regcmp LESSPARAMS ((char*)); 44330571Sdelphijchar *regex LESSPARAMS ((char**, char*)); 45195902Sdelphijextern char *__loc1; 46330571Sdelphij#define PATTERN_TYPE char ** 47195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 48195902Sdelphij#endif 49195902Sdelphij 50195902Sdelphij#if HAVE_V8_REGCOMP 51195902Sdelphij#include "regexp.h" 52294286Sdelphijextern int reg_show_error; 53330571Sdelphij#define PATTERN_TYPE struct regexp * 54195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 55195902Sdelphij#endif 56195902Sdelphij 57237613Sdelphij#if NO_REGEX 58330571Sdelphij#define PATTERN_TYPE void * 59237613Sdelphij#define CLEAR_PATTERN(name) 60237613Sdelphij#endif 61