al_get_errno(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

✨ NAME ✨

al_get_errno β€” Allegro 5 API πŸ’–

So this whole page lives in the alleg5 manual, bestie, and it's literally just one little function that tells you why something went wrong. Short page, big mood. 🫢


🌸 SYNOPSIS 🌸

int al_get_errno(void)

πŸ’… DESCRIPTION πŸ’…

Okay so here's the tea β˜• β€” some Allegro functions are dramatic in a very specific way: they return an error code and they quietly set an error number on the side. Two-for-one. Iconic behaviour, honestly. πŸ‘‘

So when one of those functions hands you a sad little error code and you're like "okay but WHY", you call this function right here. It gives you back the last error number that was set. πŸ“

And the detail that matters: it's the last error number set for the calling thread. Not some global vibe floating around for everybody β€” your thread's number, periodt. 🧚 So if you've got multiple threads doing their own chaos, they each keep their own little receipts. Keep that in mind, iykyk. πŸ’œ

No parameters, no arguments, nothing to pass in β€” just call it and it returns an int. That's it. That's the whole function. ✨

πŸŽ€ SIGN-OFF πŸŽ€

That's the whole page, bestie β€” straight out of the Allegro reference manual, al_get_errno(3alleg5). Go forth and check your errno. Slay. πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from