aboutsummaryrefslogtreecommitdiff
path: root/lptypes.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-04-27 11:03:30 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-04-27 11:03:30 -0300
commit97a4ca3b4078f581cdc8cebc4fa4cf39d5ff8125 (patch)
tree3ec0442b2f1ce9f3a081da5cf14f281b2d2811d5 /lptypes.h
parent012cf9c86cf91cb8354e229bde335592d41b84b2 (diff)
downloadlpeg-97a4ca3b4078f581cdc8cebc4fa4cf39d5ff8125.tar.gz
lpeg-97a4ca3b4078f581cdc8cebc4fa4cf39d5ff8125.tar.bz2
lpeg-97a4ca3b4078f581cdc8cebc4fa4cf39d5ff8125.zip
New macros 'fillset' and 'clearset'
Diffstat (limited to 'lptypes.h')
-rw-r--r--lptypes.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/lptypes.h b/lptypes.h
index 7793e76..17d406e 100644
--- a/lptypes.h
+++ b/lptypes.h
@@ -10,6 +10,7 @@
10 10
11#include <assert.h> 11#include <assert.h>
12#include <limits.h> 12#include <limits.h>
13#include <string.h>
13 14
14#include "lua.h" 15#include "lua.h"
15 16
@@ -97,6 +98,9 @@ typedef struct Charset {
97 98
98#define loopset(v,b) { int v; for (v = 0; v < CHARSETSIZE; v++) {b;} } 99#define loopset(v,b) { int v; for (v = 0; v < CHARSETSIZE; v++) {b;} }
99 100
101#define fillset(s,c) memset(s,c,CHARSETSIZE)
102#define clearset(s) fillset(s,0)
103
100/* access to charset */ 104/* access to charset */
101#define treebuffer(t) ((byte *)((t) + 1)) 105#define treebuffer(t) ((byte *)((t) + 1))
102 106