IXP_SRV_WALKANDCLONE(3)

πŸ“¦ version 0-unstable-2022-04, in nixos 26.05, nixpkgs unstable

πŸ¦‹ 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 calls ixp_respond(3). It should be called in response to a TWalk request. πŸšΆβ€β™€οΈβœ¨
  • 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 ixp_respond(3). The dostat parameter must be a function which fills the passed IxpStat(3) pointer based on the contents of the passed IxpFileId. πŸ“πŸ’–
  • 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