al_fungetc(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

πŸŽ€ 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 of al_fseek(3) and al_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