ALLEGRO_FS_INTERFACE(3alleg5)
π NAME π
okay bestie, welcome to ALLEGRO_FS_INTERFACE β the Allegro 5 API page that's literally all about the filesystem interface. yes, that one. the one that makes your files go β¨. (this is page 3alleg5, in case you were wondering which manual you wandered into π«Ά)
β¨ SYNOPSIS β¨
first things first, you gotta bring it in:
#include <allegro5/allegro.h>
typedef struct ALLEGRO_FS_INTERFACE ALLEGRO_FS_INTERFACE;
that's it. that's the vibe. ALLEGRO_FS_INTERFACE is a struct, you don't poke at its guts, you just hand it the function pointers and let it cook. π
π¦ DESCRIPTION π¦
so here's the tea: this is the whole menu of functions you can provide for a filesystem. like, if you're building your own filesystem backend, these are the slots you fill in. no cap.
here's every single one, and yes we're listing all of them because none of them are skippable:
ALLEGRO_FS_ENTRY * fs_create_entry (const char *path);
void fs_destroy_entry (ALLEGRO_FS_ENTRY *e);
const char * fs_entry_name (ALLEGRO_FS_ENTRY *e);
bool fs_update_entry (ALLEGRO_FS_ENTRY *e);
uint32_t fs_entry_mode (ALLEGRO_FS_ENTRY *e);
time_t fs_entry_atime (ALLEGRO_FS_ENTRY *e);
time_t fs_entry_mtime (ALLEGRO_FS_ENTRY *e);
time_t fs_entry_ctime (ALLEGRO_FS_ENTRY *e);
off_t fs_entry_size (ALLEGRO_FS_ENTRY *e);
bool fs_entry_exists (ALLEGRO_FS_ENTRY *e);
bool fs_remove_entry (ALLEGRO_FS_ENTRY *e);
fs_create_entryβ makes a brand newALLEGRO_FS_ENTRY *from aconst char *path. new entry, who dis πfs_destroy_entryβ takes anALLEGRO_FS_ENTRY *eand cleans it up. give it a lil goodbye kiss πfs_entry_nameβ hands you back the name as aconst char *. it's giving "what's your name bestie"fs_update_entryβ refreshes the entry, returns abool. glow-up time β¨fs_entry_modeβ the mode, as auint32_tfs_entry_atimeβ access time, as atime_tfs_entry_mtimeβ modification time, as atime_tfs_entry_ctimeβ change time, as atime_tfs_entry_sizeβ size, as anoff_tfs_entry_existsβ does it exist?bool. vibe check π«Άfs_remove_entryβ yeets the entry, returns abool
and then the directory squad, because folders are also main characters:
bool fs_open_directory (ALLEGRO_FS_ENTRY *e);
ALLEGRO_FS_ENTRY * fs_read_directory (ALLEGRO_FS_ENTRY *e);
bool fs_close_directory(ALLEGRO_FS_ENTRY *e);
fs_open_directoryβ opens up a directory entry, returns aboolfs_read_directoryβ reads out of it and gives you anALLEGRO_FS_ENTRY *. iconic.fs_close_directoryβ closes it back up, returns abool
then the path-based besties, working straight off strings:
bool fs_filename_exists(const char *path);
bool fs_remove_filename(const char *path);
char * fs_get_current_directory(void);
bool fs_change_directory(const char *path);
bool fs_make_directory(const char *path);
fs_filename_existsβ is there a file at thisconst char *path?bool. another vibe check πfs_remove_filenameβ deletes whatever's atconst char *path, returns aboolfs_get_current_directoryβ takesvoid, gives you back achar *with where you're currently at πfs_change_directoryβ moves you to theconst char *path, returns aboolfs_make_directoryβ makes a new directory atconst char *path, returns abool. nesting era πΈ
and last but never least, the file opener:
ALLEGRO_FILE * fs_open_file(ALLEGRO_FS_ENTRY *e);
fs_open_fileβ takes anALLEGRO_FS_ENTRY *eand gives you back anALLEGRO_FILE *. the grand finale, the moment, the π periodt.
fr fr, that's the entire interface. don't skip any of them, the filesystem needs all of its little guys.
and that's the page bestie, you ate it π this was pulled from the Allegro reference manual, page ALLEGRO_FS_INTERFACE(3alleg5) β go build something cute with it, ily, mwah ππ«Ά
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms