pattern.h (2235c7feac959bcc9ddfd6a2bc6be32102b1f84c) | pattern.h (95270f73baf6fa95ae529bc2eb6a61f5c79f32c0) |
---|---|
1/* | 1/* |
2 * Copyright (C) 1984-2021 Mark Nudelman | 2 * Copyright (C) 1984-2022 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> | 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 * | 13#define PATTERN_TYPE struct re_pattern_buffer * |
14#define SET_NULL_PATTERN(name) name = NULL 15#endif 16 | 14#define SET_NULL_PATTERN(name) name = NULL 15#endif 16 |
17/* ---- POSIX ---- */ |
|
17#if HAVE_POSIX_REGCOMP 18#include <regex.h> 19#ifdef REG_EXTENDED 20extern int less_is_more; 21#define REGCOMP_FLAG (less_is_more ? 0 : REG_EXTENDED) 22#else | 18#if HAVE_POSIX_REGCOMP 19#include <regex.h> 20#ifdef REG_EXTENDED 21extern int less_is_more; 22#define REGCOMP_FLAG (less_is_more ? 0 : REG_EXTENDED) 23#else |
23#define REGCOMP_FLAG 0 | 24#define REGCOMP_FLAG 0 |
24#endif | 25#endif |
25#define PATTERN_TYPE regex_t * | 26#define PATTERN_TYPE regex_t * |
26#define SET_NULL_PATTERN(name) name = NULL | 27#define SET_NULL_PATTERN(name) name = NULL |
28#define re_handles_caseless TRUE |
|
27#endif 28 | 29#endif 30 |
31/* ---- PCRE ---- */ |
|
29#if HAVE_PCRE 30#include <pcre.h> | 32#if HAVE_PCRE 33#include <pcre.h> |
31#define PATTERN_TYPE pcre * | 34#define PATTERN_TYPE pcre * |
32#define SET_NULL_PATTERN(name) name = NULL | 35#define SET_NULL_PATTERN(name) name = NULL |
36#define re_handles_caseless TRUE |
|
33#endif 34 | 37#endif 38 |
39/* ---- PCRE2 ---- */ |
|
35#if HAVE_PCRE2 36#define PCRE2_CODE_UNIT_WIDTH 8 37#include <pcre2.h> | 40#if HAVE_PCRE2 41#define PCRE2_CODE_UNIT_WIDTH 8 42#include <pcre2.h> |
38#define PATTERN_TYPE pcre2_code * | 43#define PATTERN_TYPE pcre2_code * |
39#define SET_NULL_PATTERN(name) name = NULL | 44#define SET_NULL_PATTERN(name) name = NULL |
45#define re_handles_caseless TRUE |
|
40#endif 41 | 46#endif 47 |
48/* ---- RE_COMP ---- */ |
|
42#if HAVE_RE_COMP 43char *re_comp LESSPARAMS ((char*)); 44int re_exec LESSPARAMS ((char*)); | 49#if HAVE_RE_COMP 50char *re_comp LESSPARAMS ((char*)); 51int re_exec LESSPARAMS ((char*)); |
45#define PATTERN_TYPE int | 52#define PATTERN_TYPE int |
46#define SET_NULL_PATTERN(name) name = 0 47#endif 48 | 53#define SET_NULL_PATTERN(name) name = 0 54#endif 55 |
56/* ---- REGCMP ---- */ |
|
49#if HAVE_REGCMP 50char *regcmp LESSPARAMS ((char*)); 51char *regex LESSPARAMS ((char**, char*)); 52extern char *__loc1; | 57#if HAVE_REGCMP 58char *regcmp LESSPARAMS ((char*)); 59char *regex LESSPARAMS ((char**, char*)); 60extern char *__loc1; |
53#define PATTERN_TYPE char ** | 61#define PATTERN_TYPE char ** |
54#define SET_NULL_PATTERN(name) name = NULL 55#endif 56 | 62#define SET_NULL_PATTERN(name) name = NULL 63#endif 64 |
65/* ---- REGCOMP ---- */ |
|
57#if HAVE_V8_REGCOMP 58#include "regexp.h" 59extern int reg_show_error; | 66#if HAVE_V8_REGCOMP 67#include "regexp.h" 68extern int reg_show_error; |
60#define PATTERN_TYPE struct regexp * | 69#define PATTERN_TYPE struct regexp * |
61#define SET_NULL_PATTERN(name) name = NULL 62#endif 63 | 70#define SET_NULL_PATTERN(name) name = NULL 71#endif 72 |
73/* ---- NONE ---- */ |
|
64#if NO_REGEX | 74#if NO_REGEX |
65#define PATTERN_TYPE void * | 75#define PATTERN_TYPE void * |
66#define SET_NULL_PATTERN(name) 67#endif | 76#define SET_NULL_PATTERN(name) 77#endif |
78 79#ifndef re_handles_caseless 80#define re_handles_caseless FALSE 81#endif |
|