1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
#ifndef OBJ_BACKEND_H
#define OBJ_BACKEND_H
#include <glib.h>
#include "obj-store.h"
typedef struct ObjBackend ObjBackend;
struct ObjBackend {
int (*read) (ObjBackend *bend,
const char *repo_id,
int version,
const char *obj_id,
void **data,
int *len);
int (*write) (ObjBackend *bend,
const char *repo_id,
int version,
const char *obj_id,
void *data,
int len,
gboolean need_sync);
gboolean (*exists) (ObjBackend *bend,
const char *repo_id,
int version,
const char *obj_id);
void (*delete) (ObjBackend *bend,
const char *repo_id,
int version,
const char *obj_id);
int (*foreach_obj) (ObjBackend *bend,
const char *repo_id,
int version,
SeafObjFunc process,
void *user_data);
int (*copy) (ObjBackend *bend,
const char *src_repo_id,
int src_version,
const char *dst_repo_id,
int dst_version,
const char *obj_id);
int (*remove_store) (ObjBackend *bend,
const char *store_id);
void *priv;
};
#endif
|