HEAD: better documentation for wvx509 constructors.
[wvapps.git] / funfs / funfscommon.h
blob1fc1b15d1bdac7f109bd1ea337e0dccbc07dde74
1 #ifndef __FUNFSCOMMON_H
2 #define __FUNFSCOMMON_H
4 typedef long unsigned int uint32;
5 typedef short unsigned int uint16;
6 typedef unsigned char uint8;
8 enum JobType
10 JT_GETATTR = 1,
11 JT_GETDIR = 2,
12 JT_READLINK = 3,
13 JT_UTIME = 5,
14 JT_READ = 6,
15 JT_STATFS = 7,
16 JT_LINK = 8,
17 JT_OPEN = 9,
18 JT_RELEASE = 10
21 #define READ(x) \
22 { \
23 int n = continue_read(-1, &x, sizeof(x)); \
24 assert(n == sizeof(x) || !isok()); \
25 } \
26 if (sizeof(x) == 2) \
27 SWAP16(&x); \
28 if (sizeof(x) == 4) \
29 SWAP32(&x); \
30 if (sizeof(x) == 8) \
31 SWAP64(&x)
33 #define WRITE(x) \
34 if (sizeof(x) == 2) \
35 SWAP16(&x); \
36 if (sizeof(x) == 4) \
37 SWAP32(&x); \
38 if (sizeof(x) == 8) \
39 SWAP64(&x); \
40 write(&x, sizeof(x));
42 #endif