1al_fgets(3) al_fgets(3)
2
3
4
6 al_fgets - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 char *al_fgets(ALLEGRO_FILE *f, char * const buf, size_t max)
12
14 Read a string of bytes terminated with a newline or end-of-file into
15 the buffer given. The line terminator(s), if any, are included in the
16 returned string. A maximum of max-1 bytes are read, with one byte be‐
17 ing reserved for a NUL terminator.
18
19 Parameters:
20
21 · f - file to read from
22
23 · buf - buffer to fill
24
25 · max - maximum size of buffer
26
27 Returns the pointer to buf on success. Returns NULL if an error oc‐
28 curred or if the end of file was reached without reading any bytes.
29
30 See al_fopen(3) about translations of end-of-line characters.
31
33 al_fget_ustr(3)
34
35
36
37Allegro reference manual al_fgets(3)