diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-11-29 19:53:34 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2021-11-29 19:53:34 +0300 |
commit | 8e07de9d952f8f27273296f1b6ae58550ce1e98b (patch) | |
tree | c653d6d2b4a2e2251ce0ff44ad4740d91e20b1da /include/fs.h | |
parent | ef0a23b0636a8c7f4a3c802ff76645261e8b225f (diff) | |
download | revela-8e07de9d952f8f27273296f1b6ae58550ce1e98b.tar.gz revela-8e07de9d952f8f27273296f1b6ae58550ce1e98b.zip |
Update adjacent images to inserted/removed
Now the program checks if the html of the next and previous images was
updated if a new image was inserted or an old image removed, and updates
them if needed.
Also make rmextra and filesync respect dry run mode.
Diffstat (limited to 'include/fs.h')
-rw-r--r-- | include/fs.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/include/fs.h b/include/fs.h index 218958b..d48ac9f 100644 --- a/include/fs.h +++ b/include/fs.h @@ -6,6 +6,8 @@ #include "hashmap.h" +typedef bool (*preremove_fn)(const char *path, void *data); + enum nmkdir_res { NMKDIR_ERROR, NMKDIR_NOOP, @@ -49,7 +51,7 @@ int file_is_uptodate(const char *path, const struct timespec *srcmtim); */ void setdatetime(const char *path, const struct timespec *mtim); -bool rmentry(const char *path); +bool rmentry(const char *path, bool dry); /* * Recursively deletes extaneous files from directory, keeping files in the @@ -57,7 +59,8 @@ bool rmentry(const char *path); * The number is not the total number of files on all subdirectories, but only * the number of files/dirs deleted from the directory pointed by path. */ -ssize_t rmextra(const char *path, struct hashmap *preserved); +ssize_t rmextra(const char *path, struct hashmap *preserved, preremove_fn, + void *data, bool dry); /* * Copies file(s) truncating and overwritting the file(s) in the destination @@ -67,6 +70,6 @@ ssize_t rmextra(const char *path, struct hashmap *preserved); * timestamps do not match. */ bool filesync(const char *restrict srcpath, const char *restrict dstpath, - struct hashmap *preserved); + struct hashmap *preserved, bool dry); #endif |