From 70be447f74b87c11557d2b5b1463005fddb0495a Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Fri, 6 Nov 2015 12:19:39 -0800 Subject: Menu ROM now pulls real file names from the OS rather than using a fake list --- util.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index ffa3385..24750e9 100644 --- a/util.h +++ b/util.h @@ -3,6 +3,11 @@ #include +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 -- cgit v1.2.3