aboutsummaryrefslogtreecommitdiff
path: root/include/9pclient.h
blob: 52b2cb963f20aa1e7c20024e6fb5db87b6d6e6e2 (plain)
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
#ifndef _9PCLIENT_H_
#define _9PCLIENT_H_ 1
#ifdef __cplusplus
extern "C" {
#endif

AUTOLIB(9pclient)
/*
 * Simple user-level 9P client.
 */

typedef struct CFsys CFsys;
typedef struct CFid CFid;

CFsys *fsinit(int);
CFsys *fsmount(int, char*);

int fsversion(CFsys*, int, char*, int);
CFid *fsauth(CFsys*, char*, char*);
CFid *fsattach(CFsys*, CFid*, char*, char*);
CFid *fsopen(CFsys*, char*, int);
int fsopenfd(CFsys*, char*, int);
long fsread(CFid*, void*, long);
long fsreadn(CFid*, void*, long);
long fspread(CFid*, void*, long, vlong);
long fspwrite(CFid*, void*, long, vlong);
vlong fsseek(CFid*, vlong, int);
long fswrite(CFid*, void*, long);
void fsclose(CFid*);
void fsunmount(CFsys*);
void _fsunmount(CFsys*);	/* do not close fd */
struct Dir;	/* in case there's no lib9.h */
long fsdirread(CFid*, struct Dir**);
long fsdirreadall(CFid*, struct Dir**);
struct Dir *fsdirstat(CFsys*, char*);
struct Dir *fsdirfstat(CFid*);
int fsdirwstat(CFsys*, char*, struct Dir*);
int fsdirfwstat(CFid*, struct Dir*);
CFid *fsroot(CFsys*);
void fssetroot(CFsys*, CFid*);
CFsys *nsinit(char*);
CFsys *nsmount(char*, char*);
CFid *nsopen(char*, char*, char*, int);
int	fsfremove(CFid*);
int	fsremove(CFsys*, char*);
CFid *fscreate(CFsys*, char*, int, ulong);
int fsaccess(CFsys*, char*, int);
int	fsvprint(CFid*, char*, va_list);
int	fsprint(CFid*, char*, ...);
Qid	fsqid(CFid*);

/* manipulate unopened fids */
CFid	*fswalk(CFid*, char*);
int fsfopen(CFid*, int);
int fsfcreate(CFid*, char*, int, ulong);

extern int chatty9pclient;
extern int eofkill9pclient;

#ifdef __cplusplus
}
#endif
#endif