freebsd-dev/contrib/less/pattern.h
Xin LI f6b74a7d16 MFV r317581: less v491.
MFC after:	1 month
2017-05-05 14:33:39 +00:00

61 lines
1.3 KiB
C

/*
* Copyright (C) 1984-2017 Mark Nudelman
*
* You may distribute under the terms of either the GNU General Public
* License or the Less License, as specified in the README file.
*
* For more information, see the README file.
*/
#if HAVE_GNU_REGEX
#define __USE_GNU 1
#include <regex.h>
#define PATTERN_TYPE struct re_pattern_buffer *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_POSIX_REGCOMP
#include <regex.h>
#ifdef REG_EXTENDED
extern int less_is_more;
#define REGCOMP_FLAG (less_is_more ? 0 : REG_EXTENDED)
#else
#define REGCOMP_FLAG 0
#endif
#define PATTERN_TYPE regex_t *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_PCRE
#include <pcre.h>
#define PATTERN_TYPE pcre *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_RE_COMP
char *re_comp();
int re_exec();
#define PATTERN_TYPE int
#define CLEAR_PATTERN(name) name = 0
#endif
#if HAVE_REGCMP
char *regcmp();
char *regex();
extern char *__loc1;
#define PATTERN_TYPE char **
#define CLEAR_PATTERN(name) name = NULL
#endif
#if HAVE_V8_REGCOMP
#include "regexp.h"
extern int reg_show_error;
#define PATTERN_TYPE struct regexp *
#define CLEAR_PATTERN(name) name = NULL
#endif
#if NO_REGEX
#define PATTERN_TYPE void *
#define CLEAR_PATTERN(name)
#endif