-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathregexp.c
58 lines (54 loc) · 1.11 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
/*
regexp_system.c
copyright 2009-2010,2014, 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.8 2014/08/08 08:15:15 tom Exp $ */
#ifdef LOCAL_REGEXP
# include "mawk.h"
#define RE_FILL() { goto refill; }
#define RE_CASE() { goto reswitch; }
# include "rexp.c"
# include "rexp0.c"
# include "rexp1.c"
# include "rexp2.c"
# include "rexp3.c"
# include "rexp4.c"
# include "rexpdb.c"
#else
# include "rexp4.c"
# include "regexp_system.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