dedup

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

block.h (1308B)


      1 enum {
      2 	B_READ  = 1 << 0,
      3 	B_RDWR	= 1 << 1,
      4 };
      5 	
      6 struct bctx {
      7 	void *gctx;	/* generic layer context (unused) */
      8 	void *cctx;	/* compression layer context */
      9 	void *ectx;	/* encryption layer context */
     10 	void *sctx;	/* storage layer context */
     11 };
     12 
     13 /*
     14  * Block operations structure.
     15  * This is implemented by each of the block layers.
     16  */
     17 struct bops {
     18 	int (*creat)(struct bctx *, char *, int);
     19 	int (*open)(struct bctx *, char *, int, int);
     20 	int (*put)(struct bctx *, void *, size_t, unsigned char *);
     21 	int (*get)(struct bctx *, unsigned char *, void *, size_t *);
     22 	int (*rm)(struct bctx *, unsigned char *);
     23 	int (*gc)(struct bctx *);
     24 	int (*sync)(struct bctx *);
     25 	int (*close)(struct bctx *);
     26 };
     27 
     28 /* block.c */
     29 extern int bcreat(char *, int, struct bctx **);
     30 extern int bopen(char *, int, int, struct bctx **);
     31 extern int bput(struct bctx *, void *, size_t, unsigned char *);
     32 extern int bget(struct bctx *, unsigned char *, void *, size_t *);
     33 extern int brm(struct bctx *, unsigned char *);
     34 extern int bgc(struct bctx *);
     35 extern int bcheck(struct bctx *, unsigned char *);
     36 extern int bsync(struct bctx *);
     37 extern int bclose(struct bctx *);
     38 
     39 /* bcompress.c */
     40 extern struct bops *bcompressops(void);
     41 
     42 /* bencrypt.c */
     43 struct bops *bencryptops(void);
     44 
     45 /* bstorage.c */
     46 extern struct bops *bstorageops(void);