.TH "IXP_SRV_WALKANDCLONE" 3 "2012 Dec" "libixp Manual" .SH NAME .P ixp_srv_walkandclone, ixp_srv_readdir, ixp_srv_verifyfile, IxpLookupFn .SH SYNOPSIS .nf #include void ixp_srv_walkandclone(Ixp9Req *req, IxpLookupFn lookup); void ixp_srv_readdir(Ixp9Req *req, IxpLookupFn lookup, void (*dostat)(IxpStat *, IxpFileId *)); bool ixp_srv_verifyfile(IxpFileId *file, IxpLookupFn lookup); typedef IxpFileId* (*IxpLookupFn)(IxpFileId*, char*); .fi .SH DESCRIPTION .P These convenience functions simplify the writing of basic and static file servers. They use a generic file lookup function to simplify the process of walking, cloning, and returning directory listings. Given the \fBIxpFileId(3)\fR of a directory and a filename name should return a new IxpFileId (allocated via \fBixp_srv_getfile(3)\fR) for the matching directory entry, or null if there is no match. If the passed name is null, \fIlookup\fR should return a linked list of IxpFileIds, one for each child directory entry. .P ixp_srv_walkandclone handles the moderately complex process of walking from a directory entry and cloning fids, and calls \fBixp_respond(3)\fR. It should be called in response to a TWalk request. .P ixp_srv_readdir should be called to handle read requests on directories. It prepares a stat for each child of the directory, taking into account the requested offset, and calls \fBixp_respond(3)\fR. The \fIdostat\fR parameter must be a function which fills the passed \fBIxpStat(3)\fR pointer based on the contents of the passed IxpFileId. .P ixp_srv_verifyfile returns whether a file still exists in the filesystem, and should be used by filesystems that invalidate files once they have been deleted. .SH SEE ALSO .P IxpFileId(3), ixp_getfile(3), ixp_freefile(3) .\" man code generated by txt2tags 2.6 (http://txt2tags.org) .\" cmdline: txt2tags -o- ixp_srv_walkandclone.man3