dedup

deduplicating backup program
git clone git://git.2f30.org/dedup
Log | Files | Refs | README | LICENSE

commit 3a24ddb8e397799f7af86d11941bd9c7e73470fd
parent 2bcadad9aeff4e80c870f8106e8c8e5cb904c3ca
Author: sin <sin@2f30.org>
Date:   Sun,  5 May 2019 17:18:52 +0100

Put misc declarations in misc.h

Diffstat:
MMakefile | 1+
Mbstorage.c | 3+--
Mchunker.c | 4++--
Mdup-unpack.c | 3+--
Mkey.c | 5+----
Amisc.h | 2++
Msnap.c | 4+---
7 files changed, 9 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile @@ -9,6 +9,7 @@ HDR = \ chunker.h \ config.h \ key.h \ + misc.h \ queue.h \ snap.h \ tree.h \ diff --git a/bstorage.c b/bstorage.c @@ -26,6 +26,7 @@ #include "block.h" #include "config.h" +#include "misc.h" #include "queue.h" #include "tree.h" @@ -53,8 +54,6 @@ #define BDSIZE (8 + 8 + 8 + 8 + (MDSIZE)) /* misc helpers */ -extern ssize_t xread(int, void *, size_t); -extern ssize_t xwrite(int, void *, size_t); extern int pack(unsigned char *, char *, ...); extern int unpack(unsigned char *, char *, ...); diff --git a/chunker.c b/chunker.c @@ -4,9 +4,9 @@ #include <string.h> #include <unistd.h> -#define ROTL(x, y) (((x) << (y)) | ((x) >> (32 - (y)))) +#include "misc.h" -extern ssize_t xread(int, void *, size_t); +#define ROTL(x, y) (((x) << (y)) | ((x) >> (32 - (y)))) struct chunker { unsigned char *buf; diff --git a/dup-unpack.c b/dup-unpack.c @@ -12,10 +12,9 @@ #include "block.h" #include "config.h" #include "key.h" +#include "misc.h" #include "snap.h" -extern ssize_t xwrite(int, void *, size_t); - int verbose; char *argv0; diff --git a/key.c b/key.c @@ -4,10 +4,7 @@ #include <sodium.h> #include "config.h" - -/* misc helpers */ -extern ssize_t xread(int, void *, size_t); -extern ssize_t xwrite(int, void *, size_t); +#include "misc.h" int keygen(unsigned char *key, size_t n) diff --git a/misc.h b/misc.h @@ -0,0 +1,2 @@ +extern ssize_t xread(int, void *, size_t); +extern ssize_t xwrite(int, void *, size_t); diff --git a/snap.c b/snap.c @@ -13,14 +13,12 @@ #include <unistd.h> #include "config.h" +#include "misc.h" #include "queue.h" #include "snap.h" #define NERRBUF 128 -extern ssize_t xread(int, void *, size_t); -extern ssize_t xwrite(int, void *, size_t); - struct mdnode { unsigned char md[MDSIZE]; SLIST_ENTRY(mdnode) e;