Mercurial > repos > blastem
diff util.h @ 866:69a6ec208111
Menu ROM now pulls real file names from the OS rather than using a fake list
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Fri, 06 Nov 2015 12:19:39 -0800 |
parents | 792be135d3af |
children | 54ffba3768d6 |
line wrap: on
line diff
--- a/util.h Fri Nov 06 11:44:51 2015 -0800 +++ b/util.h Fri Nov 06 12:19:39 2015 -0800 @@ -3,6 +3,11 @@ #include <stdio.h> +typedef struct { + char *name; + uint8_t is_dir; +} dir_entry; + //Utility functions //Allocates a new string containing the concatenation of first and second @@ -23,6 +28,10 @@ char * get_exe_dir(); //Returns the user's home directory char * get_home_dir(); +//Retunrs an array of normal files and directories residing in a directory +dir_entry *get_dir_list(char *path, size_t *numret); +//Frees a dir list returned by get_dir_list +void free_dir_list(dir_entry *list, size_t numentries); //Returns the contents of a symlink in a newly allocated string char * readlink_alloc(char * path); //Prints an error message to stderr and to a message box if not in headless mode and then exits