al_fungetc(3alleg5)
π al_fungetc π
okay bestie, so this is a page from the Allegro 5 manual β the al_fungetc one, specifically. sit down, grab a strawberry, and let's get into it π
β¨ NAME β¨
al_fungetc β Allegro 5 API π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
int al_fungetc(ALLEGRO_FILE *f, int c)
π¦ DESCRIPTION π¦
so basically it ungets a single byte from a file. like, you take a byte that was already read and you shove it back in there. and the pushed-back bytes? they are NOT written to the file, no ma'am. they just hang around, made available for the reads that come after β and in reverse order, because of course they do π
the number of pushbacks you get depends on the backend, fr fr. the standard I/O backend only guarantees you a single pushback β and honestly even that depends on the libc implementation. so don't get greedy π
for backends that follow the standard behavior: the pushback buffer gets cleared after any seeking or writing. also, calls to al_fseek(3alleg5) and al_ftell(3alleg5) are relative to the number of pushbacks. and if a pushback makes the position go negative?? the behavior of al_fseek(3alleg5) and al_ftell(3alleg5) is undefined. not undefined in a cute mysterious way, undefined in a "we literally cannot tell you what happens" way π
β οΈ heads up bestie: undefined behavior is not a vibe. if you're pushing back past the start of the file, you're on your own. proceed with caution π«Ά
π SEE ALSO π
and that's the whole page, bestie π it's from the Allegro reference manual, and the footer was just doing its little al_fungetc(3alleg5) thing again β iconic of it honestly. mwah, go push some bytes back πβ¨
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms