aboutsummaryrefslogtreecommitdiff
path: root/lpcap.h
diff options
context:
space:
mode:
Diffstat (limited to 'lpcap.h')
-rw-r--r--lpcap.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/lpcap.h b/lpcap.h
index 7cf8c24..30f3714 100644
--- a/lpcap.h
+++ b/lpcap.h
@@ -59,6 +59,18 @@ typedef struct CapState {
59} CapState; 59} CapState;
60 60
61 61
62#define captype(cap) ((cap)->kind)
63
64#define isclosecap(cap) (captype(cap) == Cclose)
65#define isopencap(cap) ((cap)->siz == 0)
66
67/* true if c2 is (any number of levels) inside c1 */
68#define capinside(c1,c2) \
69 (isopencap(c1) ? !isclosecap(c2) \
70 : (c2)->index < (c1)->index + (c1)->siz - 1)
71
72
73
62int runtimecap (CapState *cs, Capture *close, const char *s, int *rem); 74int runtimecap (CapState *cs, Capture *close, const char *s, int *rem);
63int getcaptures (lua_State *L, const char *s, const char *r, int ptop); 75int getcaptures (lua_State *L, const char *s, const char *r, int ptop);
64int finddyncap (Capture *cap, Capture *last); 76int finddyncap (Capture *cap, Capture *last);