6 #include <afs/afsint.h>
13 struct afs_cell *cell;
25 struct afs_cell *cell;
33 char name[16+32*(64-2)]; /* 64 is EPP. */
36 typedef struct afs_dirstream afs_DIR;
37 typedef struct afs_openfile afs_FILE;
40 int afscp_init(const char *cellname);
41 void afscp_finalize(void);
44 #define GetCellByName afs_cellbyname
45 #define GetCellById afs_cellbyid
46 #define GetDefaultCell afs_defaultcell
47 #define SetDefaultCell afs_setdefaultcell
48 #define GetCellID afs_cellid
50 struct afs_cell *afs_defaultcell(void);
51 struct afs_cell *afs_cellbyname(const char *cellname) ;
52 int afs_setdefaultcell(const char *cellname);
53 struct afs_cell *afs_cellbyid(int id);
54 int afs_cellid(struct afs_cell *cell);
58 #define GetServerById afs_serverbyid
59 #define GetServerByAddr afs_serverbyaddr
60 #define GetAnyServerById afs_anyserverbyaddr
61 #define GetAnyServerByIndex afs_serverbyindex
62 #define GetConnection afs_serverconnection
65 struct afs_server *afs_serverbyid(struct afs_cell *thecell, afsUUID *u);
66 struct afs_server *afs_serverbyaddr(struct afs_cell *thecell,
68 struct afs_server *afs_anyserverbyaddr(afs_uint32 addr) ;
69 struct afs_server *afs_serverbyindex(int idx) ;
70 struct rx_connection *afs_serverconnection(const struct afs_server *srv,
73 int AddCallBack(const struct afs_server *server, const struct AFSFid *fid,
74 const struct AFSFetchStatus *st, const struct AFSCallBack *cb);
75 int RemoveCallBack(const struct afs_server *server, const struct afs_venusfid *fid);
76 int ReturnCallBacks(const struct afs_server *server);
77 int ReturnAllCallBacks(void);
81 /* frees with free() */
82 struct afs_venusfid *makefid(struct afs_cell *cell, afs_uint32 volume,
83 afs_uint32 vnode, afs_uint32 unique);
84 struct afs_venusfid *dupfid(const struct afs_venusfid *in);
87 int afs_stat(const struct afs_venusfid *fid, struct stat *s);
89 ssize_t afs_pread(const struct afs_venusfid *fid, void *buffer, size_t count, off_t offset);
90 ssize_t afs_pwrite(const struct afs_venusfid *fid, const void *buffer, size_t count, off_t offset);
91 afs_FILE *afs_open(const char *path);
92 afs_FILE *afs_fidopen(const struct afs_venusfid *fid);
93 off_t afs_fseek (afs_FILE *f, off_t o, int whence);
94 ssize_t afs_fread(const afs_FILE *f, void *buffer, size_t count);
95 ssize_t afs_fwrite(const afs_FILE *f, const void *buffer, size_t count);
98 int afs_GetStatus(const struct afs_venusfid *fid, struct AFSFetchStatus *s);
99 int afs_StoreStatus(const struct afs_venusfid *fid, struct AFSStoreStatus *s);
100 int afs_CreateFile(const struct afs_venusfid *fid, /* const */ char *name,
101 struct AFSStoreStatus *sst,
102 struct afs_venusfid **ret);
103 int afs_MakeDir(const struct afs_venusfid *fid, /* const */ char *name,
104 struct AFSStoreStatus *sst,
105 struct afs_venusfid **ret);
106 int afs_Symlink(const struct afs_venusfid *fid, /* const */ char *name,
107 /*const*/ char *target, struct AFSStoreStatus *sst);
108 int afs_RemoveFile(const struct afs_venusfid *dir, char *name);
109 int afs_RemoveDir(const struct afs_venusfid *dir, char *name);
110 int afs_FetchACL(const struct afs_venusfid *dir,
111 struct AFSOpaque *acl);
112 int afs_StoreACL(const struct afs_venusfid *dir,
113 struct AFSOpaque *acl);
114 /* directory parsing stuff*/
115 struct afs_dirstream *afs_opendir(const struct afs_venusfid *fid);
116 struct afs_dirent *afs_readdir(struct afs_dirstream *d);
117 int afs_rewinddir(struct afs_dirstream *d);
118 int afs_closedir(struct afs_dirstream *d);
119 struct afs_venusfid *DirLookup(struct afs_dirstream *d, const char *name);
120 struct afs_venusfid *ResolveName(const struct afs_venusfid *dir, const char *name);
121 struct afs_venusfid *ResolvePath(const char *path);
122 struct afs_venusfid *ResolvePath2(const struct afs_volume *start, const char *path);
125 struct afs_volume *afs_volumebyname(struct afs_cell *cell, const char *vname, afs_int32 vtype);
126 struct afs_volume *afs_volumebyid(struct afs_cell *cell, afs_uint32 id);
128 #define DIRMODE_CELL 0
129 #define DIRMODE_DYNROOT 1
134 int SetDirMode(int mode);