iv_fatal(3)

✨ iv_fatal β€” ivykis programmer's manual ✨

okay bestie, pull up a chair, because we're talking about iv_fatal(3) and iv_set_fatal_msg_handler β€” the ivykis fatal error condition handling duo πŸ’€βœ¨ iykyk.


πŸŽ€ NAME πŸŽ€

iv_fatal, iv_set_fatal_msg_handler β€” ivykis fatal error condition handling


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <iv.h>

void iv_fatal(const char *fmt, ...);
void iv_set_fatal_msg_handler(void (*handler)(const char *msg));

πŸ’– DESCRIPTION πŸ’–

so. iv_fatal aborts the running program 😭 β€” like, the whole thing, gone β€” but it might emit an error message first. That fmt parameter? It's a printf(3)-style format string, and it's literally the message that gets logged. Very demure, very mindful of your logs.

If no handler is set (which is the default, the factory setting, the no-makeup-makeup look), then the formatted message gets sent to syslog, with critical severity πŸ”₯. Otherwise, the handler you set with iv_set_fatal_msg_handler is used instead. Your handler, your rules πŸ’….

Also important: iv_fatal is also used internally by ivykis, whenever a fatal situation is detected. So she's not just a public-facing icon, she's working behind the scenes too. main character energy fr fr πŸ‘‘

Now, iv_set_fatal_msg_handler β€” you use this to set an alternative function to call from iv_fatal, as opposed to syslog. And the argument you pass should be a function that does not return, and takes a single string as its argument β€” that string being the formatted error message. No cap: if your handler returns, you've broken the vibe. It's giving "must not return" periodt.

⚠️ warning bestie: the handler you set has to not return, and it takes exactly one string argument β€” the formatted error message. Don't get cute with it.

🌸 SEE ALSO 🌸


and that's the whole page, bestie 🫢 go forth and handle your fatal errors with grace πŸ’–πŸ§šβœ¨

ivykis Β· 2012-06-18 Β· iv_fatal(3) β€” mwah, iconic, no notes πŸ’…πŸŽ€