commit fb3d08c1f0590014fcb4230feb8fda8fa056773e from: Omar Polo date: Thu Oct 07 21:57:07 2021 UTC move declarations from telescope.h in fs.h and while there also publish various path. It's easier and better to have all of them exported from here instead of hardcoding them in other files (such as sandbox.c) commit - 444dad86beaaa60bd96790c7097aa66bb331e645 commit + fb3d08c1f0590014fcb4230feb8fda8fa056773e blob - e645e7b3ee272bc80cbf72eb8d497f07c7520b1b blob + f1886e6a9e17884a9a70e5ee83f284381102114d --- fs.c +++ fs.c @@ -68,17 +68,16 @@ static char xdg_data_base[PATH_MAX]; static char xdg_cache_base[PATH_MAX]; /* *_path_base variables are all equal to $HOME/.telescope if it exists */ -static char config_path_base[PATH_MAX]; -static char data_path_base[PATH_MAX]; -static char cache_path_base[PATH_MAX]; +char config_path_base[PATH_MAX]; +char data_path_base[PATH_MAX]; +char cache_path_base[PATH_MAX]; char config_path[PATH_MAX]; -static char lockfile_path[PATH_MAX]; -static char bookmark_file[PATH_MAX]; -static char known_hosts_file[PATH_MAX], known_hosts_tmp[PATH_MAX]; -static char crashed_file[PATH_MAX]; - -char session_file[PATH_MAX]; +char lockfile_path[PATH_MAX]; +char bookmark_file[PATH_MAX]; +char known_hosts_file[PATH_MAX], known_hosts_tmp[PATH_MAX]; +char crashed_file[PATH_MAX]; +char session_file[PATH_MAX]; static imsg_handlerfn *handlers[] = { [IMSG_GET] = handle_get, blob - d7b6931d477c232dd73707897491781aa4150416 blob + 1f10db34c83843710bbab528a99c41ae2dc9b291 --- fs.h +++ fs.h @@ -17,8 +17,25 @@ #ifndef FS_H #define FS_H +#include "compat.h" + #include +extern char config_path_base[PATH_MAX]; +extern char data_path_base[PATH_MAX]; +extern char cache_path_base[PATH_MAX]; + extern char config_path[PATH_MAX]; +extern char lockfile_path[PATH_MAX]; +extern char bookmark_file[PATH_MAX]; +extern char known_hosts_file[PATH_MAX], known_host_tmp[PATH_MAX]; +extern char crashed_file[PATH_MAX]; +extern char session_file[PATH_MAX]; +int fs_init(void); +int fs_main(void); +int last_time_crashed(void); +int lock_session(void); +int load_certs(struct ohash *); + #endif blob - ef98398b3626a915b01006ff3723470452943613 blob + d43af08f21967eca4a13ecff71102a4ca4893923 --- telescope.h +++ telescope.h @@ -283,16 +283,7 @@ int config_setvars(const char *, char *); int config_setcolor(int, const char *, int, int, int); int config_setattr(const char *, int, int, int); void config_apply_style(void); - -/* fs.c */ -extern char session_file[PATH_MAX]; -int fs_init(void); -int fs_main(void); -int last_time_crashed(void); -int lock_session(void); -int load_certs(struct ohash*); - /* help.c */ void recompute_help(void);