aboutsummaryrefslogtreecommitdiff
path: root/lpcap.h
diff options
context:
space:
mode:
authorSergio Medeiros <sqmedeiros@gmail.com>2014-10-29 18:13:38 -0300
committerSergio Medeiros <sqmedeiros@gmail.com>2014-10-29 18:13:38 -0300
commit8d30a0ff8a8584e225c03d878a9add439ea193a3 (patch)
treecdc03907837ebec1aed26be7290a5a40d00f3e2c /lpcap.h
parent3af55803f0a261dd9b2ccf85a7532288c4a270ae (diff)
downloadlpeglabel-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.h43
1 files changed, 43 insertions, 0 deletions
diff --git a/lpcap.h b/lpcap.h
new file mode 100644
index 0000000..c0a0e38
--- /dev/null
+++ b/lpcap.h
@@ -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 */
13typedef enum CapKind {
14 Cclose, Cposition, Cconst, Cbackref, Carg, Csimple, Ctable, Cfunction,
15 Cquery, Cstring, Cnum, Csubst, Cfold, Cruntime, Cgroup
16} CapKind;
17
18
19typedef 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
27typedef 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
37int runtimecap (CapState *cs, Capture *close, const char *s, int *rem);
38int getcaptures (lua_State *L, const char *s, const char *r, int ptop);
39int finddyncap (Capture *cap, Capture *last);
40
41#endif
42
43