comparison util.h @ 1295:96ad1b9bbb3a

Make save directory configurable. Satisfies ticket:4
author Michael Pavone <pavone@retrodev.com>
date Tue, 21 Mar 2017 21:40:47 -0700
parents 5905593d6828
children 5ceb316c479a
comparison
equal deleted inserted replaced
1294:a719e2c98b54 1295:96ad1b9bbb3a
1 #ifndef UTIL_H_ 1 #ifndef UTIL_H_
2 #define UTIL_H_ 2 #define UTIL_H_
3 3
4 #include <stdio.h> 4 #include <stdio.h>
5 #include <time.h> 5 #include <time.h>
6 #include "tern.h"
6 7
7 typedef struct { 8 typedef struct {
8 char *name; 9 char *name;
9 uint8_t is_dir; 10 uint8_t is_dir;
10 } dir_entry; 11 } dir_entry;
48 //Returns the user's home directory 49 //Returns the user's home directory
49 char * get_home_dir(); 50 char * get_home_dir();
50 //Returns an appropriate path for storing config files 51 //Returns an appropriate path for storing config files
51 char const *get_config_dir(); 52 char const *get_config_dir();
52 //Returns an appropriate path for saving non-config data like savestates 53 //Returns an appropriate path for saving non-config data like savestates
53 char const *get_save_dir(); 54 char const *get_userdata_dir();
54 //Reads a file bundled with the executable 55 //Reads a file bundled with the executable
55 char *read_bundled_file(char *name, uint32_t *sizeret); 56 char *read_bundled_file(char *name, uint32_t *sizeret);
56 //Retunrs an array of normal files and directories residing in a directory 57 //Retunrs an array of normal files and directories residing in a directory
57 dir_entry *get_dir_list(char *path, size_t *numret); 58 dir_entry *get_dir_list(char *path, size_t *numret);
58 //Frees a dir list returned by get_dir_list 59 //Frees a dir list returned by get_dir_list