-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathregexp.c
71 lines (64 loc) · 1.35 KB
/
regexp.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
regexp_system.c
copyright 2009-2020,2024, Thomas E. Dickey
copyright 2005, Aleksey Cheusov
This is a source file for mawk, an implementation of
the AWK programming language.
Mawk is distributed without warranty under the terms of
the GNU General Public License, version 2, 1991.
*/
/* $MawkId: regexp.c,v 1.16 2024/08/25 17:34:05 tom Exp $ */
#include <config.h>
#define Visible_CELL
#ifdef LOCAL_REGEXP
#define REGEXP_INTERNALS
#define Visible_MACHINE
#define Visible_RE_DATA
#define Visible_RT_POS_ENTRY
#define Visible_RT_STATE
#define Visible_STATE
# include <mawk.h>
#define RE_FILL() { goto refill; }
#define RE_CASE() { goto reswitch; }
# include <rexp.c>
# include <rexpdb.c>
# include <rexp0.c>
# include <rexp1.c>
# include <rexp2.c>
# include <rexp3.c>
#else
#define Visible_RE_DATA
#define Visible_RE_NODE
#define Visible_STRING
# include <regexp_system.c>
# include <rexp4.c>
#endif
#ifdef NO_LEAKS
void
rexp_leaks(void)
{
TRACE(("rexp_leaks\n"));
#ifdef LOCAL_REGEXP
lookup_cclass(0);
if (bv_base) {
BV **p = bv_base;
while (p != bv_next) {
RE_free(*p);
++p;
}
RE_free(bv_base);
bv_base = 0;
bv_limit = 0;
bv_next = 0;
}
if (RE_run_stack_base) {
RE_free(RE_run_stack_base);
RE_run_stack_base = 0;
}
if (RE_pos_stack_base) {
RE_free(RE_pos_stack_base);
RE_pos_stack_base = 0;
}
#endif
}
#endif