1al_register_bitmap_identifier(3) al_register_bitmap_identifier(3)
2
3
4
6 al_register_bitmap_identifier - Allegro 5 API
7
9 #include <allegro5/allegro.h>
10
11 bool al_register_bitmap_identifier(const char *extension,
12 bool (*identifier)(ALLEGRO_FILE *f))
13
15 Register an identify handler for al_identify_bitmap(3). The given
16 function will be used to detect files for the given extension. It will
17 be called with a single argument of type ALLEGRO_FILE(3) which is a
18 file handle opened for reading and located at the first byte of the
19 file. The handler should try to read as few bytes as possible to safe‐
20 ly determine if the given file contents correspond to the type with the
21 extension and return true in that case, false otherwise. The file han‐
22 dle must not be closed but there is no need to reset it to the begin‐
23 ning.
24
25 The extension should include the leading dot (`.') character. It will
26 be matched case-insensitively.
27
28 The identifier argument may be NULL to unregister an entry.
29
30 Returns true on success, false on error. Returns false if unregister‐
31 ing an entry that doesn’t exist.
32
34 5.1.12
35
37 al_identify_bitmap(3)
38
39
40
41Allegro reference manual al_register_bitmap_identifier(3)