al_fwrite16le(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’Ύ al_fwrite16le β€” Allegro 5 API πŸŽ€

okay bestie, so this one lives in the Allegro 5 manual β€” you already know the vibe, it's page al_fwrite16le(3alleg5) and it's giving ✨tiny little byte-pusher✨ energy. Let's get into it.


✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

size_t al_fwrite16le(ALLEGRO_FILE *f, int16_t w)

πŸ’… DESCRIPTION πŸ’…

So basically, al_fwrite16le() writes a 16-bit word out to a file in little-endian format β€” that means LSB first (least significant byte goes out the door first, she's an eager queen πŸ‘‘).

And then she tells you how it went: the return value is the number of bytes written. So like:

  • 2 on success β€” slay, both bytes made it πŸ’–
  • less than 2 on an error β€” not slay, something went sideways 😭

That's it, that's the whole function. Small, iconic, does exactly one job, periodt.

ngl this is the kind of function that lowkey saves you when you're hand-rolling a binary file format and endianness is trying to ruin your whole life. iykyk πŸ¦‹

🌸 SEE ALSO 🌸


Allegro reference manual β€’ al_fwrite16le(3alleg5) β€” mwah, that's the whole page bestie, go write some bytes πŸ«ΆπŸ’œπŸŒˆ

πŸ“¦ where this page comes from