Commit | Line | Data |
9ef589d8 |
1 | /* $RCSfile: spat.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:51:59 $ |
a687059c |
2 | * |
9ef589d8 |
3 | * Copyright (c) 1991, Larry Wall |
a687059c |
4 | * |
9ef589d8 |
5 | * You may distribute under the terms of either the GNU General Public |
6 | * License or the Artistic License, as specified in the README file. |
8d063cd8 |
7 | * |
8 | * $Log: spat.h,v $ |
9ef589d8 |
9 | * Revision 4.0.1.1 91/06/07 11:51:59 lwall |
10 | * patch4: new copyright notice |
11 | * patch4: added global modifier for pattern matches |
12 | * |
fe14fcc3 |
13 | * Revision 4.0 91/03/20 01:39:36 lwall |
14 | * 4.0 baseline. |
8d063cd8 |
15 | * |
16 | */ |
17 | |
18 | struct scanpat { |
19 | SPAT *spat_next; /* list of all scanpats */ |
378cc40b |
20 | REGEXP *spat_regexp; /* compiled expression */ |
8d063cd8 |
21 | ARG *spat_repl; /* replacement string for subst */ |
22 | ARG *spat_runtime; /* compile pattern at runtime */ |
378cc40b |
23 | STR *spat_short; /* for a fast bypass of execute() */ |
9ef589d8 |
24 | short spat_flags; |
378cc40b |
25 | char spat_slen; |
8d063cd8 |
26 | }; |
27 | |
28 | #define SPAT_USED 1 /* spat has been used once already */ |
a687059c |
29 | #define SPAT_ONCE 2 /* use pattern only once per reset */ |
8d063cd8 |
30 | #define SPAT_SCANFIRST 4 /* initial constant not anchored */ |
378cc40b |
31 | #define SPAT_ALL 8 /* initial constant is whole pat */ |
2e1b3b7e |
32 | #define SPAT_SKIPWHITE 16 /* skip leading whitespace for split */ |
378cc40b |
33 | #define SPAT_FOLD 32 /* case insensitivity */ |
a687059c |
34 | #define SPAT_CONST 64 /* subst replacement is constant */ |
35 | #define SPAT_KEEP 128 /* keep 1st runtime pattern forever */ |
9ef589d8 |
36 | #define SPAT_GLOBAL 256 /* pattern had a g modifier */ |
8d063cd8 |
37 | |
8d063cd8 |
38 | EXT SPAT *curspat; /* what to do \ interps from */ |
378cc40b |
39 | EXT SPAT *lastspat; /* what to use in place of null pattern */ |
40 | |
41 | EXT char *hint INIT(Nullch); /* hint from cmd_exec to do_match et al */ |
8d063cd8 |
42 | |
43 | #define Nullspat Null(SPAT*) |