forked from tysonmote/gommap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
consts.c.txt
54 lines (51 loc) · 1.71 KB
/
consts.c.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <sys/mman.h>
#include <stdio.h>
#define pcomment(COMMENT) printf("// %s\n", COMMENT)
#define ppackage(NAME) printf("package %s\n", NAME)
#define ptype(NAME, TYPE) printf("\ntype %s %s\n", #NAME, #TYPE)
#define pconstblock(EXPS) { printf("\nconst (\n"); {EXPS} printf(")\n"); }
#define pconst(NAME, TYPE) printf("\t%-15s %s = 0x%x\n", #NAME, #TYPE, NAME)
int main(int argc, char *argvc[]) {
pcomment("** This file is automatically generated from consts.c.txt **\n");
pcomment("+build !windows\n");
ppackage("gommap");
ptype(ProtFlags, uint);
pconstblock(
pconst(PROT_NONE, ProtFlags);
pconst(PROT_READ, ProtFlags);
pconst(PROT_WRITE, ProtFlags);
pconst(PROT_EXEC, ProtFlags);
)
ptype(MapFlags, uint);
pconstblock(
pconst(MAP_SHARED, MapFlags);
pconst(MAP_PRIVATE, MapFlags);
pconst(MAP_FIXED, MapFlags);
pconst(MAP_ANONYMOUS, MapFlags);
pconst(MAP_GROWSDOWN, MapFlags);
pconst(MAP_LOCKED, MapFlags);
pconst(MAP_NONBLOCK, MapFlags);
pconst(MAP_NORESERVE, MapFlags);
pconst(MAP_POPULATE, MapFlags);
)
ptype(SyncFlags, uint);
pconstblock(
pconst(MS_SYNC, SyncFlags);
pconst(MS_ASYNC, SyncFlags);
pconst(MS_INVALIDATE, SyncFlags);
)
ptype(AdviseFlags, uint);
pconstblock(
pconst(MADV_NORMAL, AdviseFlags);
pconst(MADV_RANDOM, AdviseFlags);
pconst(MADV_SEQUENTIAL, AdviseFlags);
pconst(MADV_WILLNEED, AdviseFlags);
pconst(MADV_DONTNEED, AdviseFlags);
pconst(MADV_REMOVE, AdviseFlags);
pconst(MADV_DONTFORK, AdviseFlags);
pconst(MADV_DOFORK, AdviseFlags);
)
return 0;
}
/* vim:ft=c
*/