-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconstants.c
44 lines (35 loc) · 956 Bytes
/
constants.c
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
#include <sys/epoll.h>
#include <sys/eventfd.h>
#include <stdio.h>
#include <stdlib.h>
void constant(const char *name, int value)
{
printf(" let %s = 0x%x\n", name, value);
}
int main(int argc, char **argv)
{
printf("module Epoll = struct\n");
constant("inp", EPOLLIN);
constant("pri", EPOLLPRI);
constant("out", EPOLLOUT);
constant("rdnorm", EPOLLRDNORM);
constant("rdband", EPOLLRDBAND);
constant("wrnorm", EPOLLWRNORM);
constant("wrband", EPOLLWRBAND);
constant("msg", EPOLLMSG);
constant("err", EPOLLERR);
constant("hup", EPOLLHUP);
constant("rdhup", EPOLLRDHUP);
constant("wakeup", EPOLLWAKEUP);
constant("oneshot", EPOLLONESHOT);
constant("et", EPOLLET);
/* constant("exclusive",EPOLLEXCLUSIVE); */
printf("end\n");
printf("module EventFD = struct\n");
constant("cloexec", EFD_CLOEXEC);
constant("nonblock", EFD_NONBLOCK);
constant("semaphore", EFD_SEMAPHORE);
printf("end\n");
return 0;
}
/* vim: set ts=8 noet: */