diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-11-06 12:19:39 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-11-06 12:19:39 -0800 |
commit | 70be447f74b87c11557d2b5b1463005fddb0495a (patch) | |
tree | 9c871702bd0b40fd1ecb05bcb27dd824f9eb8c48 /util.h | |
parent | 60f60cd2c5236b0ba5654174c5faeb4a2d218fc9 (diff) |
Menu ROM now pulls real file names from the OS rather than using a fake list
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 @@ void set_exe_str(char * str); 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 |