AUPARSE_RESET(3)

πŸ“¦
version 4.2.1 Β· 2 versions
, in alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

πŸ’– AUPARSE_RESET πŸ’–

okay bestie, pull up a chair, because auparse_reset (that's the auparse_reset from the Linux Audit API, section 3 of the manual, iykyk) is genuinely one of the most underrated little functions in the whole audit library. no cap. it's the "ctrl+z but make it a full factory reset" of the parser world 🧚✨


✨ SYNOPSIS ✨

so first things first, you gotta tell the compiler you know about it:

#include <auparse.h>

int auparse_reset(auparse_state_t *au);"
yes the include goes at the top, yes the function signature is exactly that, no we are not editing it, it's giving canon πŸ’…

🌸 DESCRIPTION 🌸

okay so here's the tea β˜• β€” auparse_reset resets all internal cursors back to the beginning. like, all of them. every single one. it's not picking favourites, it's taking everyone back to the start line 🏁

and the way that it's thorough?? it closes files, it closes descriptors, and it frees memory buffers. that's a whole glow-up, that's a whole spring cleaning, that's a whole "new year new me" energy πŸŒˆπŸ¦‹

basically: your parser instance walks back in looking brand new and ready to re-read from the top. main character behaviour, honestly πŸ‘‘


πŸŽ€ RETURN VALUE πŸŽ€

  • -1 β€” something went wrong 😭 an error occurred, bestie, and it is not being subtle about it
  • 0 β€” success!! we ate, we devoured, no notes 🫢

πŸ¦‹ SEE ALSO πŸ¦‹

go read those too, they're the besties that live in the same friend group πŸ’œ


πŸ‘‘ AUTHOR πŸ‘‘

Steve Grubb. an absolute icon, a legend, a pioneer. we stan forever πŸ’–


and that's the whole page, bestie!! this one came from the Red Hat crew, dated Sep 2014, and it's page AUPARSE_RESET(3) of the Linux Audit API manual β€” go forth and reset responsibly βœ¨πŸ’…πŸŽ€