atlog(3)

πŸ’… atlog β€” log and lock handling, bestie edition ✨

ok so real talk, this page is about two little functions that handle comments and locks on your software objects. Their government names are atSetComment and atUnlock, and honestly? they're the duo of the century. 🫢


✨ SYNOPSIS ✨

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

int atSetComment (Af_key *aso, int commentType, char *commentText, int mode);

int atUnlock (Af_key *aso);

🌸 DESCRIPTION 🌸

πŸŽ€ atSetComment

atSetComment sets a comment attribute for the attributed software object aso. You pass it a commentType, and bestie, there are exactly three valid ones. Let's go:

  • AT_COMMENT_INTENT β€” for expressing a change intent, aka describing the modifications you're planning to make. manifesting the diff fr fr ✨
  • AT_COMMENT_DESCR β€” for issuing a descriptive text expressing the purpose of the document. like, what IS this thing? πŸ’­
  • AT_COMMENT_LOG β€” for writing a change log describing the changes actually made. receipts, periodt πŸ“

The commentText argument is where you can hand over a default text. Depending on the mode (more on that in a sec), the user gets asked to enter the comment attribute value. When a default text is given, it'll be offered up for modification. And when you pass in a commentText argument, the previous value of the corresponding comment attribute gets used as the default text. cute, right? πŸ’–

🌈 the mode field

With the mode field you can influence how atSetComment behaves. Three flags can be set:

  • AT_FROMSTDIN β€” advises atSetComment to read the user input from standard input. If you don't set this, an editor gets started instead. your choice bestie 🧚
  • AT_REUSE β€” causes reuse of the comment text expressed during the previous invocation of atSetComment, if there was any. recycling is iconic πŸ’œ
  • AT_CONFIRM β€” lets the user confirm that a comment shall be expressed. Without it, atSetComment just asks for the comment text with no prior confirmation. Heads up though: this flag is ignored when AT_FROMSTDIN is set and the change comment is taken from standard input. so don't count on it there πŸ™ˆ

πŸ”“ atUnlock

atUnlock unlocks aso by calling af_unlock (peep the manual page af_lock(3) if you wanna go deeper). And if a change intent was previously set for aso? bestie, it gets eliminated. gone. poof. πŸ’€βœ¨


😭 DIAGNOSTICS 😭

atSetComment and atUnlock return FALSE (zero) on error. Not only that β€” the atError variable gets set, and afErrMsg holds a diagnostic message. so like, you'll know. the vibes will be off and the error message will tell you why πŸ”₯


πŸ¦‹ ENVIRONMENT πŸ¦‹

  • EDITOR β€” the default editor to be called. pick your fighter πŸ’…

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, no notes. go forth and comment responsibly. 🌸

this was brought to you by AtFStk-1.12, dated Fri Jun 25 16:39:38 1993 β€” yeah it's vintage, it's archival, it's giving ✨timeless✨. mwah πŸ’‹

πŸ“¦ where this page comes from