1 #define g2byte(x) (((x)[1]<<8) + (x)[0]) /* little-endian */
2 #define g3byte(x) (((x)[2]<<16) + ((x)[1]<<8) + (x)[0])
3 #define g4byte(x) (((x)[3]<<24) + ((x)[2]<<16) + ((x)[1]<<8) + (x)[0])
6 #define b4byte(x) (((x)[0]<<24) + ((x)[1]<<16) + ((x)[2]<<8) + (x)[3])
7 #define b8byte(x) (((vlong)b4byte(x)<<32) | (u32int)b4byte((x)+4))
10 OPERM = 0x3, /* mask of all permission types in open mode */
12 Maxbuf = 8192, /* max buffer size */
15 typedef struct Fid Fid;
16 typedef struct Ram Ram;
34 Ram *parent; /* parent directory */
35 Ram *child; /* first member of directory */
36 Ram *next; /* next member of file's directory */
59 typedef struct idmap {
64 typedef struct fileinf {
75 extern ulong path; /* incremented for each new file */
83 void *erealloc(void*, ulong);
86 void populate(char *);
89 char *doread(Ram*, vlong, long);
90 void dowrite(Ram*, char*, long, long);
92 Idmap *getpass(char*);
93 char *mapid(Idmap*,int);
94 Ram *poppath(Fileinf fi, int new);
95 Ram *popfile(Ram *dir, Fileinf fi);
97 Ram *lookup(Ram*, char*);