IXP_SRV_WALKANDCLONE(3)
π¦ IXP_SRV_WALKANDCLONE(3) β Library Functions Manual π¦
okay so bestie, welcome to the Library Functions Manual page for IXP_SRV_WALKANDCLONE(3) β long name, main character energy, we love her. π
β¨
π NAME π
ixp_srv_walkandclone, ixp_srv_readdir, ixp_srv_verifyfile, IxpLookupFn
β¨ SYNOPSIS β¨
#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*);
π DESCRIPTION π
These convenience functions are here to make writing basic and static file servers way less of a whole thing. They use a generic file lookup function so walking, cloning, and returning directory listings is simplified. π«Ά
The lookup function vibe: given the IxpFileId(3) of a directory and a filename, name should return a new IxpFileId (allocated via ixp_srv_getfile(3)) for the matching directory entry, or null if thereβs no match. If the passed name is null, lookup should return a linked list of IxpFileIds, one for each child directory entry. Periodt. π
ixp_srv_walkandcloneβ handles the moderately complex process of walking from a directory entry and cloning fids, then callsixp_respond(3). It should be called in response to aTWalkrequest. πΆββοΈβ¨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 callsixp_respond(3). Thedostatparameter must be a function which fills the passedIxpStat(3)pointer based on the contents of the passedIxpFileId. ππ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. π΅οΈββοΈπ
π SEE ALSO π
IxpFileId(3), ixp_getfile(3), ixp_freefile(3)
xoxo, from the libixp Manual, 2012 Dec, page IXP_SRV_WALKANDCLONE(3) πβ¨
π¦ where this page comes from
- nixos 26.05: libixp 0-unstable-2022-04-04
- nixpkgs unstable: libixp 0-unstable-2022-04-04
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms