af_history(3)
π af_history(3) β the AtFS history functions, bestie edition π
okay so this is a page from the Attribute Filesystem (AtFS) manual, and it's literally all about the history functions β af_histories and af_access. we're gonna get you fluent in ASO history lookups, no cap. π¦
β¨ NAME β¨
af_histories, af_access β AtFS history functions. that's the whole vibe. πΈ
β¨ SYNOPSIS β¨
#include <atfs.h>
char**af_histories (char *path, char *pattern)
char**af_cachenames (char *path, char *pattern);
int af_access (char *path, char *name, char *type, int mode)
look at that lil trio. π«Ά
β¨ DESCRIPTION β¨
π af_histories
so af_histories hands you back a list of source history names from the directory that path points at, filtered by whatever pattern you gave it. and like, important: histories in a directory are represented by at least one version. that's the rule, periodt. π
the pattern has to be ed(1) patterns β the kind that are processable by re_comp(3) and re_exec(3). don't come at it with anything else, bestie, it won't eat. π
the resulting list from af_histories lives in allocated memory, so use free(3) to free it up for further allocation when you're done. and here's the iconic part: af_histories returns an empty list when no histories are found β not a NULL pointer. exclamation mark in the original, we respect it. β
π af_cachenames
af_cachenames does literally the same thing as af_histories... except it does it on derived object caches. same energy, different target. π
π af_access
af_access determines the existence of an object history. here's the tea:
- if any ASO (any version) exists with the given
path,nameandtypeattributes,af_accessreturns zero π - otherwise it returns -1 π
the mode argument can be either of these two:
AF_CLASS_SOURCEβ indicating that only source objects shall be searched πAF_CLASS_DERIVEDβ which means that only the derived object cache shall be searched for existence of a matching ASO π
pick one, don't be chaotic about it. π
β¨ SEE ALSO β¨
ed(1), re_comp(3), re_exec(3), free(3) β go read those too, they're the supporting cast and they ate. π
β¨ DIAGNOSTICS β¨
upon error,-1or a null pointer (depending on the return type) is returned, andaf_errnois set to the corresponding error number. so yeah β if things go sideways, checkaf_errno, that's where the receipts are. π§
and that's the whole page, bestie!! this one's from AtFS-1.71, dated Fri Jun 25 14:33:09 1993 β vintage but still serving. π mwah, go forth and free your memory. π
π¦ where this page comes from
- debian bookworm: atfs-dev 1.4pl6-15+b1
- ubuntu jammy: atfs-dev 1.4pl6-15
- ubuntu noble: atfs-dev 1.4pl6-16.1build1
- ubuntu resolute: atfs-dev 1.4pl6-17
- ubuntu stonking: atfs-dev 1.4pl6-17
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms