diff options
author | Sergio Medeiros <sqmedeiros@gmail.com> | 2014-10-29 18:13:38 -0300 |
---|---|---|
committer | Sergio Medeiros <sqmedeiros@gmail.com> | 2014-10-29 18:13:38 -0300 |
commit | 8d30a0ff8a8584e225c03d878a9add439ea193a3 (patch) | |
tree | cdc03907837ebec1aed26be7290a5a40d00f3e2c /lpcap.h | |
parent | 3af55803f0a261dd9b2ccf85a7532288c4a270ae (diff) | |
download | lpeglabel-8d30a0ff8a8584e225c03d878a9add439ea193a3.tar.gz lpeglabel-8d30a0ff8a8584e225c03d878a9add439ea193a3.tar.bz2 lpeglabel-8d30a0ff8a8584e225c03d878a9add439ea193a3.zip |
Creating the git repository with the current implementation.
Diffstat (limited to 'lpcap.h')
-rw-r--r-- | lpcap.h | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -0,0 +1,43 @@ | |||
1 | /* | ||
2 | ** $Id: lpcap.h,v 1.1 2013/03/21 20:25:12 roberto Exp $ | ||
3 | */ | ||
4 | |||
5 | #if !defined(lpcap_h) | ||
6 | #define lpcap_h | ||
7 | |||
8 | |||
9 | #include "lptypes.h" | ||
10 | |||
11 | |||
12 | /* kinds of captures */ | ||
13 | typedef enum CapKind { | ||
14 | Cclose, Cposition, Cconst, Cbackref, Carg, Csimple, Ctable, Cfunction, | ||
15 | Cquery, Cstring, Cnum, Csubst, Cfold, Cruntime, Cgroup | ||
16 | } CapKind; | ||
17 | |||
18 | |||
19 | typedef struct Capture { | ||
20 | const char *s; /* subject position */ | ||
21 | short idx; /* extra info about capture (group name, arg index, etc.) */ | ||
22 | byte kind; /* kind of capture */ | ||
23 | byte siz; /* size of full capture + 1 (0 = not a full capture) */ | ||
24 | } Capture; | ||
25 | |||
26 | |||
27 | typedef struct CapState { | ||
28 | Capture *cap; /* current capture */ | ||
29 | Capture *ocap; /* (original) capture list */ | ||
30 | lua_State *L; | ||
31 | int ptop; /* index of last argument to 'match' */ | ||
32 | const char *s; /* original string */ | ||
33 | int valuecached; /* value stored in cache slot */ | ||
34 | } CapState; | ||
35 | |||
36 | |||
37 | int runtimecap (CapState *cs, Capture *close, const char *s, int *rem); | ||
38 | int getcaptures (lua_State *L, const char *s, const char *r, int ptop); | ||
39 | int finddyncap (Capture *cap, Capture *last); | ||
40 | |||
41 | #endif | ||
42 | |||
43 | |||