Mercurial > repos > blastem
comparison util.h @ 496:6fc71114d145
Extract function to determine executable directory from load_config so it can be used elsewhere
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Mon, 28 Oct 2013 21:48:46 -0700 |
parents | 39cad98d2789 |
children | 2e1b3b258523 |
comparison
equal
deleted
inserted
replaced
495:39cad98d2789 | 496:6fc71114d145 |
---|---|
11 char * alloc_concat_m(int num_parts, char ** parts); | 11 char * alloc_concat_m(int num_parts, char ** parts); |
12 //Returns the size of a file using fseek and ftell | 12 //Returns the size of a file using fseek and ftell |
13 long file_size(FILE * f); | 13 long file_size(FILE * f); |
14 //Strips whitespace and non-printable characters from the beginning and end of a string | 14 //Strips whitespace and non-printable characters from the beginning and end of a string |
15 char * strip_ws(char * text); | 15 char * strip_ws(char * text); |
16 //Inserts a null after the first word, returns a pointer to the second word | |
16 char * split_keyval(char * text); | 17 char * split_keyval(char * text); |
18 //Should be called by main with the value of argv[0] for use by get_exe_dir | |
19 void set_exe_str(char * str); | |
20 //Returns the directory the executable is in | |
21 char * get_exe_dir(); | |
22 //Returns the contents of a symlink in a newly allocated string | |
23 char * readlink_alloc(char * path); | |
17 | 24 |
18 #endif //UTIL_H_ | 25 #endif //UTIL_H_ |