pattern.h revision 195902
1195902Sdelphij/* 2195902Sdelphij * Copyright (C) 1984-2009 Mark Nudelman 3195902Sdelphij * 4195902Sdelphij * You may distribute under the terms of either the GNU General Public 5195902Sdelphij * License or the Less License, as specified in the README file. 6195902Sdelphij * 7195902Sdelphij * For more information about less, or for information on how to 8195902Sdelphij * contact the author, see the README file. 9195902Sdelphij */ 10195902Sdelphij 11195902Sdelphij#if HAVE_POSIX_REGCOMP 12195902Sdelphij#include <regex.h> 13195902Sdelphij#ifdef REG_EXTENDED 14195902Sdelphij#define REGCOMP_FLAG REG_EXTENDED 15195902Sdelphij#else 16195902Sdelphij#define REGCOMP_FLAG 0 17195902Sdelphij#endif 18195902Sdelphij#define DEFINE_PATTERN(name) regex_t *name 19195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 20195902Sdelphij#endif 21195902Sdelphij 22195902Sdelphij#if HAVE_PCRE 23195902Sdelphij#include <pcre.h> 24195902Sdelphij#define DEFINE_PATTERN(name) pcre *name 25195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 26195902Sdelphij#endif 27195902Sdelphij 28195902Sdelphij#if HAVE_RE_COMP 29195902Sdelphijchar *re_comp(); 30195902Sdelphijint re_exec(); 31195902Sdelphij#define DEFINE_PATTERN(name) int name 32195902Sdelphij#define CLEAR_PATTERN(name) name = 0 33195902Sdelphij#endif 34195902Sdelphij 35195902Sdelphij#if HAVE_REGCMP 36195902Sdelphijchar *regcmp(); 37195902Sdelphijchar *regex(); 38195902Sdelphijextern char *__loc1; 39195902Sdelphij#define DEFINE_PATTERN(name) char *name 40195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 41195902Sdelphij#endif 42195902Sdelphij 43195902Sdelphij#if HAVE_V8_REGCOMP 44195902Sdelphij#include "regexp.h" 45195902Sdelphij#define DEFINE_PATTERN(name) struct regexp *name 46195902Sdelphij#define CLEAR_PATTERN(name) name = NULL 47195902Sdelphij#endif 48195902Sdelphij 49