libixp

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

ixp_srv_walkandclone.3 (1908B)


      1 .TH "IXP_SRV_WALKANDCLONE" 3 "2010 Jun" "libixp Manual"
      2 
      3 .SH NAME
      4 .P
      5 ixp_srv_walkandclone, ixp_srv_readdir, ixp_srv_verifyfile, IxpLookupFn
      6 
      7 .SH SYNOPSIS
      8 .nf
      9   #include <ixp_srvutil.h>
     10   
     11   void ixp_srv_walkandclone(Ixp9Req *req, IxpLookupFn lookup);
     12   
     13   void ixp_srv_readdir(Ixp9Req *req, IxpLookupFn lookup, void (*dostat)(IxpStat *, IxpFileId *));
     14   
     15   bool ixp_srv_verifyfile(IxpFileId *file, IxpLookupFn lookup);
     16   
     17   typedef IxpFileId* (*IxpLookupFn)(IxpFileId*, char*);
     18 .fi
     19 
     20 .SH DESCRIPTION
     21 .P
     22 These convenience functions simplify the writing of basic and
     23 static file servers. They use a generic file lookup function
     24 to simplify the process of walking, cloning, and returning
     25 directory listings. Given the \fBIxpFileId(3)\fR of a directory and a
     26 filename name should return a new IxpFileId (allocated via
     27 \fBixp_srv_getfile(3)\fR) for the matching directory entry, or null
     28 if there is no match. If the passed name is null, IlookupR
     29 should return a linked list of IxpFileIds, one for each child
     30 directory entry.
     31 
     32 .P
     33 ixp_srv_walkandclone handles the moderately complex process
     34 of walking from a directory entry and cloning fids, and calls
     35 \fBixp_respond(3)\fR. It should be called in response to a TWalk
     36 request.
     37 
     38 .P
     39 ixp_srv_readdir should be called to handle read requests on
     40 directories. It prepares a stat for each child of the
     41 directory, taking into account the requested offset, and
     42 calls \fBixp_respond(3)\fR. The IdostatR parameter must be a
     43 function which fills the passed \fBIxpStat(3)\fR pointer based on
     44 the contents of the passed IxpFileId.
     45 
     46 .P
     47 ixp_srv_verifyfile returns whether a file still exists in the
     48 filesystem, and should be used by filesystems that invalidate
     49 files once they have been deleted.
     50 
     51 .SH SEE ALSO
     52 .P
     53 IxpFileId(3), ixp_getfile(3), ixp_freefile(3)
     54 
     55 
     56 .\" man code generated by txt2tags 2.5 (http://txt2tags.sf.net)
     57 .\" cmdline: txt2tags -o- ixp_srv_walkandclone.man3
     58