gd_error_count(3)

✨ gd_error_count(3) β€” the GetData manual, bestie edition ✨

okay so we're in the GETDATA section of the manual, and today's topic is gd_error_count β€” the little counter that tells you how many oopsies the GetData library has been collecting on your behalf πŸ’…


🌸 NAME 🌸

gd_error_count β€” reports the number of errors encountered by the GetData library πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

#inlcude <getdata.h>

int gd_error_count(DIRFILE *dirfile);

(yes bestie, that #inlcude is exactly what the page says, no cap β€” copy it character for character or the compiler will simply not know you 🫢)


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea β˜•οΈ The first time you call gd_error_count() with the DIRFILE object dirfile, it hands you back the number of errors the GetData library ran into while it was operating on dirfile since dirfile was created. iconic. ✨

but β€” and this is the plot twist β€” calling this function resets the internal count. so every call after that returns only the errors encountered since the previous call to this function, for that specific DIRFILE. it's giving "what have you done for me lately" energy 😭

important: the errors themselves are not cached by the library. like, the count is real but the receipts are gone. if you want the actual error status of the last library call on dirfile β€” which might be GD_E_OK, meaning no error at all, slay β€” you go call gd_error(3) instead. πŸ‘‘

🌈 RETURN VALUE 🌈

gd_error_count() always returns the number of GetData errors encountered since the last time it was called, or since the dirfile was created. so basically the count since the last vibe check. πŸ’œ

and if no error has happened over that window? it returns zero. zero errors, zero stress, main character behaviour. 🧚


⭐ HISTORY ⭐

gd_error_count() first appeared in GetData-0.8.0. a classic, an icon, a legend. πŸŽ€


πŸ’– SEE ALSO πŸ’–


and that's the whole page, bestie 🫢 this was Version 0.10.0, dated 25 December 2016 β€” go forth and count your errors, but like, in a cute way πŸ’…βœ¨