dedup

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

commit 4e73487301009733d5a9566a1e040da861bc295a
parent 7a2e4a88b5471cb53583ea7df33ec8c79efa5e38
Author: sin <sin@2f30.org>
Date:   Sat, 27 Apr 2019 18:49:39 +0100

Style fix

Diffstat:
Mbcompress.c | 4++--
Mblock.h | 38+++++++++++++++++++-------------------
Mbstorage.c | 28++++++++++++++--------------
Mchunker.c | 2+-
Mchunker.h | 11+++++------
Mdup-unpack.c | 2+-
Msnap.c | 4++--
Msnap.h | 14+++++++-------
8 files changed, 51 insertions(+), 52 deletions(-)

diff --git a/bcompress.c b/bcompress.c @@ -18,8 +18,8 @@ #define CDSNAPPYTYPE 0x201 #define CDSIZE (8 + 8) -extern int pack(unsigned char *dst, char *fmt, ...); -extern int unpack(unsigned char *src, char *fmt, ...); +extern int pack(unsigned char *, char *, ...); +extern int unpack(unsigned char *, char *, ...); static int bccreat(struct bctx *bctx, char *path, int mode, struct bparam *bpar); static int bcopen(struct bctx *bctx, char *path, int flags, int mode, struct bparam *bpar); diff --git a/block.h b/block.h @@ -18,31 +18,31 @@ struct bparam { * Block operations structure. * This is implemented by each of the block layers. */ struct bops { - int (*creat)(struct bctx *bctx, char *path, int mode, struct bparam *bpar); - int (*open)(struct bctx *bctx, char *path, int flags, int mode, struct bparam *bpar); - int (*put)(struct bctx *bctx, void *buf, size_t n, unsigned char *md); - int (*get)(struct bctx *bctx, unsigned char *md, void *buf, size_t *n); - int (*rm)(struct bctx *bctx, unsigned char *md); - int (*gc)(struct bctx *bctx); - int (*check)(struct bctx *bctx, unsigned char *md); - int (*sync)(struct bctx *bctx); - int (*close)(struct bctx *bctx); + int (*creat)(struct bctx *, char *, int, struct bparam *); + int (*open)(struct bctx *, char *, int, int, struct bparam *); + int (*put)(struct bctx *, void *, size_t, unsigned char *); + int (*get)(struct bctx *, unsigned char *, void *, size_t *); + int (*rm)(struct bctx *, unsigned char *); + int (*gc)(struct bctx *); + int (*check)(struct bctx *, unsigned char *); + int (*sync)(struct bctx *); + int (*close)(struct bctx *); }; /* block.c */ -extern int bcreat(char *path, int mode, struct bparam *bpar, struct bctx **bctx); -extern int bopen(char *path, int flags, int mode, struct bparam *bpar, struct bctx **bctx); -extern int bput(struct bctx *bctx, void *buf, size_t n, unsigned char *md); -extern int bget(struct bctx *bctx, unsigned char *md, void *buf, size_t *n); -extern int brm(struct bctx *bctx, unsigned char *md); -extern int bgc(struct bctx *bctx); -extern int bcheck(struct bctx *bctx, unsigned char *md); -extern int bsync(struct bctx *bctx); -extern int bclose(struct bctx *bctx); +extern int bcreat(char *, int, struct bparam *, struct bctx **); +extern int bopen(char *, int, int, struct bparam *, struct bctx **); +extern int bput(struct bctx *, void *, size_t, unsigned char *); +extern int bget(struct bctx *, unsigned char *, void *, size_t *); +extern int brm(struct bctx *, unsigned char *); +extern int bgc(struct bctx *); +extern int bcheck(struct bctx *, unsigned char *); +extern int bsync(struct bctx *); +extern int bclose(struct bctx *); struct bparam *bparamdef(void); /* bcompat.c */ -extern int punchhole(int fd, off_t offset, off_t len); +extern int punchhole(int, off_t, off_t); /* bcompress.c */ extern struct bops *bcompressops(void); diff --git a/bstorage.c b/bstorage.c @@ -49,20 +49,20 @@ #define CSNAPPYTYPE 1 #define HBLAKE2BTYPE 0 -extern ssize_t xread(int fd, void *buf, size_t nbytes); -extern ssize_t xwrite(int fd, void *buf, size_t nbytes); -extern int pack(unsigned char *dst, char *fmt, ...); -extern int unpack(unsigned char *src, char *fmt, ...); - -static int bscreat(struct bctx *bctx, char *path, int mode, struct bparam *bpar); -static int bsopen(struct bctx *bctx, char *path, int flags, int mode, struct bparam *bpar); -static int bsput(struct bctx *bctx, void *buf, size_t n, unsigned char *md); -static int bsget(struct bctx *bctx, unsigned char *md, void *buf, size_t *n); -static int bsrm(struct bctx *bctx, unsigned char *md); -static int bsgc(struct bctx *bctx); -static int bscheck(struct bctx *bctx, unsigned char *md); -static int bssync(struct bctx *bctx); -static int bsclose(struct bctx *bctx); +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 *, ...); + +static int bscreat(struct bctx *, char *, int, struct bparam *); +static int bsopen(struct bctx *, char *, int, int, struct bparam *); +static int bsput(struct bctx *, void *, size_t, unsigned char *); +static int bsget(struct bctx *, unsigned char *, void *, size_t *); +static int bsrm(struct bctx *, unsigned char *); +static int bsgc(struct bctx *); +static int bscheck(struct bctx *, unsigned char *); +static int bssync(struct bctx *); +static int bsclose(struct bctx *); static struct bops bops = { .creat = bscreat, diff --git a/chunker.c b/chunker.c @@ -6,7 +6,7 @@ #define ROTL(x, y) (((x) << (y)) | ((x) >> (32 - (y)))) -extern ssize_t xread(int fd, void *buf, size_t nbytes); +extern ssize_t xread(int, void *, size_t); struct chunker { unsigned char *buf; diff --git a/chunker.h b/chunker.h @@ -1,8 +1,7 @@ struct chunker; -extern struct chunker *copen(int fd, size_t minsize, size_t maxsize, - size_t mask, size_t winsize); -extern int cclose(struct chunker *c); -extern ssize_t cfill(struct chunker *c); -extern void *cget(struct chunker *c, size_t *csize); -extern int cdrain(struct chunker *c); +extern struct chunker *copen(int, size_t, size_t, size_t, size_t); +extern int cclose(struct chunker *); +extern ssize_t cfill(struct chunker *); +extern void *cget(struct chunker *, size_t *); +extern int cdrain(struct chunker *); diff --git a/dup-unpack.c b/dup-unpack.c @@ -12,7 +12,7 @@ #include "config.h" #include "snap.h" -extern ssize_t xwrite(int fd, void *buf, size_t nbytes); +extern ssize_t xwrite(int, void *, size_t); int verbose; char *argv0; diff --git a/snap.c b/snap.c @@ -14,8 +14,8 @@ #include "queue.h" #include "snap.h" -extern ssize_t xread(int fd, void *buf, size_t nbytes); -extern ssize_t xwrite(int fd, void *buf, size_t nbytes); +extern ssize_t xread(int, void *, size_t); +extern ssize_t xwrite(int, void *, size_t); struct mdnode { unsigned char md[MDSIZE]; diff --git a/snap.h b/snap.h @@ -4,10 +4,10 @@ enum { struct sctx; -extern int screat(char *path, int mode, struct sctx **sctx); -extern int sopen(char *path, int flags, int mode, struct sctx **sctx); -extern int sput(struct sctx *sctx, unsigned char *md); -extern int sget(struct sctx *sctx, unsigned char *md); -extern int srewind(struct sctx *sctx); -extern int ssync(struct sctx *sctx); -extern int sclose(struct sctx *sctx); +extern int screat(char *, int, struct sctx **); +extern int sopen(char *, int flags, int, struct sctx **); +extern int sput(struct sctx *, unsigned char *); +extern int sget(struct sctx *, unsigned char *); +extern int srewind(struct sctx *); +extern int ssync(struct sctx *); +extern int sclose(struct sctx *);