atbindrule(3)

✨ NAME ✨

atbindrule is the manual page (section 3, library vibes, we love that for her πŸ’…) for the version bind rule squad: atBindAddRule, atBindDelRule, atBindRuleFile, atBindDisplayErrors, atBindTestRule, atBindShowRules, and atBindListRules β€” aka, like, all the version bind rule handling bestie could ever need πŸŽ€


🌸 SYNOPSIS 🌸

#include <atfs.h>
#include <atfstk.h>

int  atBindAddRule (char *ruleName, char *ruleBody, char *srcFile, int
srcLine);

int  atBindDelRule (char *ruleName);

int  atBindRuleFile (char *fileName);

int  atBindDisplayErrors;

int  atBindTestRule (char *ruleName);

int  atBindShowRules (void);

char**atBindListRules (void);

πŸ’– DESCRIPTION πŸ’–

okay so the atBind module is basically keeping an internal database of every single version bind rule it knows about. it's the group chat of rules, and it never forgets 🫢

🌟 The functions, one by one 🌟

atBindAddRule stores a brand new rule in that internal database. she wants the rule name (and yes, the rule name can optionally come with parameter definitions attached, slay) plus the rule body, both as string arguments. on top of that you may also hand her the filename (srcFile) of the file the rule got read from, and the line inside that file (srcLine) β€” that's literally just so the error messages can be proper and actually point at stuff instead of being vague and useless 😭. atBindAddRule returns -1 on error, and 0 otherwise.

atBindDelRule yeets a previously defined rule out of the internal database. she returns a negative return value (-1) when no rule with the given name was found in the internal database. bye bestie πŸ‘‹

atBindRuleFile scans a file that's full of version bind rules and adds every single rule in it to the internal database. she returns the number of version bind rules that got successfully added to the internal database. heads up though β€” a zero return value may also indicate an error, so don't get too comfy with that zero, it's giving ambiguous 🚩

atBindDisplayErrors is a switch, not a function, and she may be set TRUE to enable error reporting while version binding rules are being parsed. those error messages get written directly to standard error. initially, atBindDisplayErrors is set FALSE. turn her on when you want the tea β˜•

AtBindTestRule reports whether ruleName is defined as a version binding rule or not. she returns a non zero (TRUE) value when the name is defined, otherwise FALSE. vibe check on a rule name, essentially πŸ”

atBindShowRules dumps the internal database to the standard output. return value is always TRUE. she never fails, she never flops, main character energy only πŸ‘‘

atBindListRules returns all known bind rule names in a list. that list's memory is allocated by use of malloc(3) β€” so yeah, it's yours to free, bestie, no cap. on error, atBindListRules returns a null pointer.


🚨 DIAGNOSTICS 🚨

when things go wrong, each routine returns a null value, the variable atBindError gets set true (non-zero), and an explaining message gets copied into the atBindErrorMsg string buffer. atBindError gets cleared on successful calls, but the message buffer just… remains unchanged. she's holding onto that memory, literally πŸ’€

🌈 ENVIRONMENT 🌈

  • SHAPETOOLS β€” a list of path names that acts as the search space for files containing version bind rules. those bind rule files must be named BindRules. the default path is /usr/local/lib/shape.

πŸŽ€ FILES πŸŽ€

  • $SHAPETOOLS/BindRules

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page fr fr, go forth and bind those rules πŸ’œ

this was AtFStk-1.12, dated Tue Jun 29 16:16:26 1993 β€” iconic vintage energy, we stan a timeless manual πŸ¦‹βœ¨

πŸ“¦ where this page comes from