al_fgets(3)

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

πŸ’– NAME πŸ’–

al_fgets β€” Allegro 5 API, bestie. This page is from the Library Functions Manual, and it’s the al_fgets(3) moment β€” slay πŸ’….

✨ SYNOPSIS ✨

#include <allegro5/allegro.h>

char *al_fgets(ALLEGRO_FILE *f, char * const buf, size_t max)

🌸 DESCRIPTION 🌸

Okay so al_fgets reads a string of bytes into the buffer you gave it, and it keeps going until it hits a newline or end-of-file. The line terminator(s), if any, are included in the returned string β€” yes, they come along for the ride. It reads a maximum of max-1 bytes, because one byte is reserved for a NUL terminator. boundaries, bestie.

Parameters:

  • f β€” file to read from
  • buf β€” buffer to fill
  • max β€” maximum size of buffer

It returns the pointer to buf on success πŸ’–. It returns NULL if an error occurred or if the end of file was reached without reading any bytes 😭.

See al_fopen(3) about translations of end-of-line characters. iykyk.

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’Œ cute sign-off: that’s the whole vibe from the Allegro reference manual, page al_fgets(3). The date slot is not printed in this footer, so we’re not inventing one β€” bye 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