al_fungetc(3)
π NAME π
al_fungetc β Allegro 5 API, coming at you from the Library Functions Manual bestie π (yes, we are absolutely in al_fungetc(3) territory).
β¨ SYNOPSIS β¨
#include <allegro5/allegro.h>
int al_fungetc(ALLEGRO_FILE *f, int c)
π DESCRIPTION π
Okay so al_fungetc is the βoops, put that byte backβ girlie π«. It ungets a single byte from a file β like you read it and now youβre gently yeeting it back for later reads.
Pushed-back bytes are not written to the file, bestie. Theyβre only made available for subsequent reads, and they come back in reverse order π. That detail is doing main character work, so donβt forget it.
How many pushbacks you get depends on the backend. The standard I/O backend only guarantees a single pushback; the real behavior depends on the libc implementation. So donβt be out here stacking pushbacks like limited-edition Stanley cups unless you know your backend can handle it π«Ά.
For backends that follow the standard behavior, the pushback buffer will be cleared after any seeking or writing. Also, calls to al_fseek(3) and al_ftell(3) are relative to the number of pushbacks. And if a pushback causes the position to become negative?
π¨ Warning bestie: the behavior ofal_fseek(3)andal_ftell(3)is undefined in that case. Not iconic. Do not collect $200. π
π SEE ALSO π
mwah π β signed off by the Allegro reference manual, al_fungetc(3) edition π source/version and all. The footer didnβt print a date, so Iβm not inventing one, bestie πΈ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms