al_fread16be(3alleg5)

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

πŸ’– al_fread16be β€” Allegro 5 API πŸ’–

okay bestie, welcome to the al_fread16be(3alleg5) page, part of the Allegro reference manual ✨ it's giving "tiny function, huge personality" and honestly? we're obsessed 🫢


✨ NAME ✨

al_fread16be β€” it's the Allegro 5 API, babe πŸ’… that's the whole vibe


🌸 SYNOPSIS 🌸

lowkey the whole summoning ritual is just this:

#include <allegro5/allegro.h>

int16_t al_fread16be(ALLEGRO_FILE *f)

no cap, that's it. copy it exactly, she's precise πŸ‘‘


πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she do? she reads a 16-bit word in big-endian format, which means MSB first β€” most significant byte walking in the door first like she owns the place πŸ’…βœ¨

and the receipts:

  • On success, she returns the 16-bit word. ate. πŸ”₯
  • On failure, she returns EOF (-1). 😭
πŸ’€ CAREFUL BESTIE β€” -1 is also a totally valid return value, so you literally cannot tell "we got -1 as data" from "something went wrong" just by looking at the return. Use al_feof(3alleg5) to check if the end of the file was reached prematurely, or al_ferror(3alleg5) to check if an error occurred. fr fr, do not skip this step, it's not a drill πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page, bestie πŸŽ€ al_fread16be(3alleg5), straight out of the Allegro reference manual β€” mwah, sending you a big 16-bit kiss, MSB first obviously πŸ’–βœ¨πŸ¦‹πŸ§šβ€β™€οΈ

πŸ“¦ where this page comes from