1 /* LBS: An LFS-inspired filesystem backup system
2 * Copyright (C) 2007 Michael Vrable
4 * When creating backup snapshots, maintain a local database of data blocks and
5 * checksums, in addition to the data contents (which may be stored remotely).
6 * This database is consulted when attempting to build incremental snapshots,
7 * as it says which objects can be reused.
9 * The database is implemented as an SQLite3 database, but this implementation
10 * detail is kept internal to this file, so that the storage format may be
13 #ifndef _LBS_LOCALDB_H
14 #define _LBS_LOCALDB_H
24 void Open(const char *path, const char *snapshot_name);
26 void StoreObject(const ObjectReference& ref,
27 const std::string &checksum, int64_t size);
28 ObjectReference FindObject(const std::string &checksum, int64_t size);
29 bool IsOldObject(const std::string &checksum, int64_t size);
30 void UseObject(const ObjectReference& ref);
35 sqlite3_stmt *Prepare(const char *sql);
36 int64_t SegmentToId(const std::string &segment);
37 std::string IdToSegment(int64_t segmentid);
40 #endif // _LBS_LOCALDB_H