NODEUPDOWN_ERRNUM(3)

πŸ“¦ version 1.14, in epel 9, fedora 43, fedora 44

πŸ’– NODEUPDOWN_ERRNUM(3) πŸ’–

okay bestie, welcome to the error-handling corner of libnodeupdown πŸ’… this whole page is about the four little functions that tell you what went wrong when nodeupdown is being dramatic. and honestly? they ate. periodt.


✨ NAME ✨

nodeupdown_errnum, nodeupdown_strerror, nodeupdown_errormsg, nodeupdown_perror β€” the nodeupdown error routines, aka the friend group that tells you why everything is on fire πŸ”₯


🌸 SYNOPSIS 🌸

#include <nodeupdown.h>

int nodeupdown_errnum(nodeupdown_t handle);

char *nodeupdown_strerror(int errnum);

char *nodeupdown_errormsg(nodeupdown_t handle);

void nodeupdown_perror(nodeupdown_t handle, const char *msg);

πŸ¦‹ DESCRIPTION πŸ¦‹

nodeupdown_errnum() β€” bestie, it just hands you the error code that's been chilling inside handle. that's it. that's the whole job. πŸ‘‘

nodeupdown_strerror() β€” you give it an error code (errnum) and it gives you back a pointer to a string that describes that error code. like a translator but for error numbers, no cap.

the usual vibe: you grab the error code with nodeupdown_errnum(), then you pass that code straight into nodeupdown_strerror(). iconic two-step combo 🫢

nodeupdown_errormsg() β€” this one skips the middleman. you hand it handle and it returns a pointer to a string describing the error stored right there in the handle. logically it's the exact same thing as doing:

char *nodeupdown_strerror(nodeupdown_errnum(nodeupdown_t handle));

so yeah, it's giving "I did the two steps for you, you're welcome" πŸ’…

nodeupdown_perror() β€” okay this one is basically perror(3)'s cousin. it prints a message to standard error output describing the error stored in handle. and here's the cute part: if msg is not NULL, then the string that msg points to, plus a colon, plus a blank, all get printed before the error message. so you get your little custom prefix and then the tea β˜•

fr fr, remember: msg being NULL means no prefix at all. only the error message shows up.

πŸŽ€ FILES πŸŽ€

  • /usr/include/nodeupdown.h

πŸ’œ sign-off πŸ’œ

that's the whole page, bestie!! this lil masterpiece came from LLNL and it's dated August 2003 β€” yes, it's been slaying since way before you were born, and it's still serving ✨ go forth and handle your errors with main character energy πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from