Mercurial > repos > blastem
diff 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 |
line wrap: on
line diff
--- a/util.h Mon Oct 28 19:37:30 2013 -0700 +++ b/util.h Mon Oct 28 21:48:46 2013 -0700 @@ -13,6 +13,13 @@ long file_size(FILE * f); //Strips whitespace and non-printable characters from the beginning and end of a string char * strip_ws(char * text); +//Inserts a null after the first word, returns a pointer to the second word char * split_keyval(char * text); +//Should be called by main with the value of argv[0] for use by get_exe_dir +void set_exe_str(char * str); +//Returns the directory the executable is in +char * get_exe_dir(); +//Returns the contents of a symlink in a newly allocated string +char * readlink_alloc(char * path); #endif //UTIL_H_