1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62
|
.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 <ixp_srvutil.h>
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
|