rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 1 | #ifndef _9PCLIENT_H_ |
| 2 | #define _9PCLIENT_H_ 1 |
| 3 | #ifdef __cplusplus |
| 4 | extern "C" { |
| 5 | #endif |
| 6 | |
| 7 | AUTOLIB(9pclient) |
| 8 | /* |
| 9 | * Simple user-level 9P client. |
| 10 | */ |
| 11 | |
| 12 | typedef struct CFsys CFsys; |
| 13 | typedef struct CFid CFid; |
| 14 | |
| 15 | CFsys *fsinit(int); |
| 16 | CFsys *fsmount(int, char*); |
| 17 | |
| 18 | int fsversion(CFsys*, int, char*, int); |
rsc | 74a6921 | 2005-02-08 21:06:39 +0000 | [diff] [blame] | 19 | CFid *fsauth(CFsys*, char*, char*); |
rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 20 | CFid *fsattach(CFsys*, CFid*, char*, char*); |
| 21 | CFid *fsopen(CFsys*, char*, int); |
| 22 | int fsopenfd(CFsys*, char*, int); |
| 23 | long fsread(CFid*, void*, long); |
| 24 | long fsreadn(CFid*, void*, long); |
rsc | daefa1a | 2005-01-18 18:11:39 +0000 | [diff] [blame] | 25 | long fspread(CFid*, void*, long, vlong); |
| 26 | long fspwrite(CFid*, void*, long, vlong); |
| 27 | vlong fsseek(CFid*, vlong, int); |
rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 28 | long fswrite(CFid*, void*, long); |
| 29 | void fsclose(CFid*); |
| 30 | void fsunmount(CFsys*); |
rsc | ce2a378 | 2005-02-10 16:08:16 +0000 | [diff] [blame] | 31 | void _fsunmount(CFsys*); /* do not close fd */ |
rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 32 | struct Dir; /* in case there's no lib9.h */ |
| 33 | long fsdirread(CFid*, struct Dir**); |
| 34 | long fsdirreadall(CFid*, struct Dir**); |
| 35 | struct Dir *fsdirstat(CFsys*, char*); |
| 36 | struct Dir *fsdirfstat(CFid*); |
| 37 | int fsdirwstat(CFsys*, char*, struct Dir*); |
| 38 | int fsdirfwstat(CFid*, struct Dir*); |
| 39 | CFid *fsroot(CFsys*); |
| 40 | void fssetroot(CFsys*, CFid*); |
rsc | ce2a378 | 2005-02-10 16:08:16 +0000 | [diff] [blame] | 41 | CFsys *nsinit(char*); |
rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 42 | CFsys *nsmount(char*, char*); |
rsc | 74a6921 | 2005-02-08 21:06:39 +0000 | [diff] [blame] | 43 | CFid *nsopen(char*, char*, char*, int); |
rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 44 | |
rsc | ce2a378 | 2005-02-10 16:08:16 +0000 | [diff] [blame] | 45 | extern int chatty9pclient; |
| 46 | |
rsc | 5ba841d | 2005-01-04 21:21:32 +0000 | [diff] [blame] | 47 | #ifdef __cplusplus |
| 48 | } |
| 49 | #endif |
| 50 | #endif |