sttransaction(3)
π NAME π
okay so this is sttransaction(3) from the ShapeTools Toolkit Library bestie, and it's all about simple transaction handling β¨ two lil things live here: stAbortThis and stThisTransaction.
β¨ SYNOPSIS β¨
#include <config.h>
#include <sttk.h>
void stAbortThis (int domsg);
struct stTransactionstThisTransaction;
yes the missing space in struct stTransactionstThisTransaction; is canon, we do not touch the sacred text π copy it exactly, iykyk.
π DESCRIPTION π
so stAbortThis is part of a simple transaction mechanism, built on top of setjmp(3) and longjmp(3). Here's the vibe: a transaction gets started by setting a return point β you do that by calling setjmp(3) β and then you can abort it any time by calling stAbortThis. When you do, it:
- spits out a short abort message π¬
- cleans up the temporary files (that's
stRmRegisteredFiles(3)doing the heavy lifting π§Ή) - does a whole
longjmp(3)moment, yeeting you right back to the transaction start point π¦
The structure variable stThisTransaction carries the info about the current transaction. Main character energy fr. It has these fields:
struct stTransaction {
char tr_fname[MAXPATHLEN+1];
int tr_done;
int tr_seqno;
int tr_rc;
jmp_buf tr_env;
};
okay so breaking down how you actually use it:
- When you set the transaction return point by calling
setjmp(3), thetr_envfield is the one that must be used as the argument tosetjmp. No substitutions, bestie. - The name of the concerned file should go in the
tr_fnamefield. - The
tr_doneflag should be cleared. tr_seqnois the serial number of the current transaction, and you must increase it at the beginning of each new transaction. Every time. No skipping π- The
tr_rcreturn code can be set to whatever appropriate return code fits when something went wrong and the transaction was aborted. - If the application doesn't set it,
tr_rcwill be set to null bystAbortThison abortion of the transaction. (the original page literally says "nun null" and I love that for it, but yeah β null π) - On successful completion,
tr_doneshould be setTRUE. periodt. π
π SEE ALSO π
and that's the whole page, bestie π«Ά this was sttransaction(3) from the ShapeTools Toolkit Library, and yes it really is dated Thu Jun 24 17:43:37 1993 β vintage icon behavior fr, we stan a timeless baddie π
π¦ 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