1al_feof(3) al_feof(3)
2
3
4
6 al_feof - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 bool al_feof(ALLEGRO_FILE *f)
12
14 Returns true if the end-of-file indicator has been set on the file,
15 i.e. we have attempted to read past the end of the file.
16
17 This does not return true if we simply are at the end of the file. The
18 following code correctly reads two bytes, even when the file contains
19 exactly two bytes:
20
21 int b1 = al_fgetc(f);
22 int b2 = al_fgetc(f);
23 if (al_feof(f)) {
24 /* At least one byte was unsuccessfully read. */
25 report_error();
26 }
27
29 al_ferror(3), al_fclearerr(3)
30
31
32
33Allegro reference manual al_feof(3)