libixp

git clone git://oldgit.suckless.org/libixp/
Log | Files | Refs | LICENSE

ixp_srvutil.h (1715B)


      1 
      2 typedef struct IxpDirtab	IxpDirtab;
      3 typedef struct IxpFileId	IxpFileId;
      4 typedef struct IxpPendingLink	IxpPendingLink;
      5 typedef struct IxpPending	IxpPending;
      6 typedef struct IxpQueue		IxpQueue;
      7 typedef struct IxpRequestLink	IxpRequestLink;
      8 
      9 typedef IxpFileId* (*IxpLookupFn)(IxpFileId*, char*);
     10 
     11 struct IxpPendingLink {
     12 	/* Private members */
     13 	IxpPendingLink*	next;
     14 	IxpPendingLink*	prev;
     15 	IxpFid*		fid;
     16 	IxpQueue*	queue;
     17 	IxpPending*	pending;
     18 };
     19 
     20 struct IxpRequestLink {
     21 	/* Private members */
     22 	IxpRequestLink*	next;
     23 	IxpRequestLink*	prev;
     24 	Ixp9Req*	req;
     25 };
     26 
     27 struct IxpPending {
     28 	/* Private members */
     29 	IxpRequestLink	req;
     30 	IxpPendingLink	fids;
     31 };
     32 
     33 struct IxpDirtab {
     34 	char*	name;
     35 	uint8_t	qtype;
     36 	uint	type;
     37 	uint	perm;
     38 	uint	flags;
     39 };
     40 
     41 struct IxpFileId {
     42 	IxpFileId*	next;
     43 	IxpFileIdU	p;
     44 	bool		pending;
     45 	uint		id;
     46 	uint		index;
     47 	IxpDirtab	tab;
     48 	uint		nref;
     49 	char		volatil;
     50 };
     51 
     52 enum {
     53 	FLHide = 1,
     54 };
     55 
     56 bool	ixp_pending_clunk(Ixp9Req*);
     57 void	ixp_pending_flush(Ixp9Req*);
     58 int	ixp_pending_print(IxpPending*, const char*, ...);
     59 void	ixp_pending_pushfid(IxpPending*, IxpFid*);
     60 void	ixp_pending_respond(Ixp9Req*);
     61 int	ixp_pending_vprint(IxpPending*, const char*, va_list ap);
     62 void	ixp_pending_write(IxpPending*, const char*, long);
     63 IxpFileId*	ixp_srv_clonefiles(IxpFileId*);
     64 void	ixp_srv_data2cstring(Ixp9Req*);
     65 void	ixp_srv_freefile(IxpFileId*);
     66 void	ixp_srv_readbuf(Ixp9Req*, char*, uint);
     67 void	ixp_srv_readdir(Ixp9Req*, IxpLookupFn, void (*)(IxpStat*, IxpFileId*));
     68 bool	ixp_srv_verifyfile(IxpFileId*, IxpLookupFn);
     69 void	ixp_srv_walkandclone(Ixp9Req*, IxpLookupFn);
     70 void	ixp_srv_writebuf(Ixp9Req*, char**, uint*, uint);
     71 char*	ixp_srv_writectl(Ixp9Req*, char* (*)(void*, IxpMsg*));
     72 IxpFileId* ixp_srv_getfile(void);
     73 
     74