forked from mischief/9pfs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
9pfs.h
67 lines (58 loc) · 1.06 KB
/
9pfs.h
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
55
56
57
58
59
60
61
62
63
64
65
66
67
enum
{
ROOTFID = 0,
AUTHFID,
PUT = 0,
DEL,
GET,
NHASH = 1009
};
#define FDEL ((void*)~0)
typedef struct FFid FFid;
typedef struct FDir FDir;
struct FFid
{
FFid *link;
uchar mode;
u32int fid;
Qid qid;
u32int iounit;
u64int offset;
char *path;
};
struct FDir
{
FDir *link;
char *path;
Dir *dirs;
long ndirs;
};
extern FILE *logfile;
extern FFid *rootfid;
extern FFid *authfid;
extern int msize;
extern int srvfd;
extern int debug;
void init9p(void);
int _9pversion(u32int);
FFid *_9pauth(u32int, char*, char*);
FFid *_9pattach(u32int, u32int, char*, char*);
FFid *_9pwalk(const char*);
FFid *_9pwalkr(FFid*, char*);
FFid *fidclone(FFid*);
Dir *_9pstat(FFid*);
int _9pwstat(FFid*, Dir*);
int _9pclunk(FFid*);
int _9popen(FFid*);
FFid *_9pcreate(FFid*, char*, int, int);
int _9premove(FFid*);
int _9pread(FFid*, char*, u32int);
int _9pwrite(FFid*, char*, u32int);
long _9pdirread(FFid*, Dir**);
int dircmp(const void*, const void*);
FDir *lookupdir(const char*, int);
#define DPRINT(...) \
do{ \
if(debug) \
fprintf(logfile, __VA_ARGS__); \
}while(0)