summaryrefslogtreecommitdiffstats
path: root/autoreload.h
diff options
context:
space:
mode:
authorBert Münnich <ber.t@posteo.de>2017-05-17 20:07:32 +0200
committerBert Münnich <ber.t@posteo.de>2017-05-17 20:07:32 +0200
commit3724d3fc17dc6135a05608cab5bdf00c6978282d (patch)
tree048434245e8c09070f09b7b7851394c95536ba7c /autoreload.h
parentedb117e3bdb4d6bef4a4749d94144df8472c0a4d (diff)
downloadnsxiv-3724d3fc17dc6135a05608cab5bdf00c6978282d.tar.zst
Revised autoreload interface
Make the header only contain the public interface and nothing from the implementation. All functions get a handle to their self object, like the img_ and tns_ and win_ functions. All necessary data (file path) is also passed as an argument, so that no extern redeclarations are needed. Make arl_setup_dir() private, it's not called outside the module. Make arl_handle() return true if the file has changed, so that the reloading of the file can be done by the caller.
Diffstat (limited to 'autoreload.h')
-rw-r--r--autoreload.h18
1 files changed, 5 insertions, 13 deletions
diff --git a/autoreload.h b/autoreload.h
index 439b695..6a3053c 100644
--- a/autoreload.h
+++ b/autoreload.h
@@ -21,23 +21,15 @@
#include "types.h"
-void arl_cleanup(void);
-void arl_handle(void);
-void arl_init(void);
-void arl_setup(void);
-void arl_setup_dir(void);
-
typedef struct {
int fd;
int wd;
bool watching_dir;
-} autoreload_t;
-
-extern autoreload_t autoreload;
-extern int fileidx;
-extern fileinfo_t *files;
+} arl_t;
-void load_image(int);
-void redraw(void);
+void arl_cleanup(arl_t*);
+bool arl_handle(arl_t*, const char*);
+void arl_init(arl_t*);
+void arl_setup(arl_t*, const char*);
#endif /* AUTORELOAD_H */