From 94eea1e7324e6599decb73b78d13b111dd5b2621 Mon Sep 17 00:00:00 2001 From: Mike Pavone Date: Mon, 28 Oct 2013 21:48:46 -0700 Subject: Extract function to determine executable directory from load_config so it can be used elsewhere --- util.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'util.h') diff --git a/util.h b/util.h index e3e2e86..d82ac50 100644 --- a/util.h +++ b/util.h @@ -13,6 +13,13 @@ char * alloc_concat_m(int num_parts, char ** parts); 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_ -- cgit v1.2.3