File: obj-backend.h

package info (click to toggle)
seafile 6.2.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 3,468 kB
  • sloc: ansic: 34,270; python: 5,192; makefile: 249; sh: 239
file content (54 lines) | stat: -rw-r--r-- 1,713 bytes parent folder | download | duplicates (5)
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