repo.or.cz
/
wvapps.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
HEAD: better documentation for wvx509 constructors.
[wvapps.git]
/
funfs
/
funfscommon.h
blob
1fc1b15d1bdac7f109bd1ea337e0dccbc07dde74
1
#ifndef __FUNFSCOMMON_H
2
#define __FUNFSCOMMON_H
3
4
typedef
long unsigned int
uint32
;
5
typedef
short unsigned int
uint16
;
6
typedef
unsigned char
uint8
;
7
8
enum
JobType
9
{
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
19
};
20
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)
32
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));
41
42
#endif