al_register_sample_identifier(3)

NAME

al_register_sample_identifier - Allegro 5 API

SYNOPSIS

    #include <allegro5/allegro_audio.h>
    bool al_register_sample_identifier(const char *ext,
       bool (*identifier)(ALLEGRO_FILE* fp))

DESCRIPTION

Register an identify handler for al_identify_sample(3). The given function will be used to detect files for the given extension. It will be called with a single argument of type ALLEGRO_FILE(3) which is a file handle opened for reading and located at the first byte of the file. The handler should try to read as few bytes as possible to safely determine if the given file contents correspond to the type with the extension and return true in that case, false otherwise. The file handle must not be closed but there is no need to reset it to the beginning.

The extension should include the leading dot (`.') character. It will be matched case-insensitively.

The identifier argument may be NULL to unregister an entry.

Returns true on success, false on error. Returns false if unregistering an entry that doesn’t exist.

SINCE

5.2.8

SEE ALSO

al_identify_bitmap(3)