-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathleveldb_mcpe.pxd
196 lines (170 loc) · 5.47 KB
/
leveldb_mcpe.pxd
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
from libcpp.string cimport string
from libcpp cimport bool
cdef extern from "leveldb/db.h" namespace "leveldb" nogil:
cdef cppclass DB:
DB() except +
# ~DB() except +
Status Open(
const Options &options,
const string &name,
DB** dbptr,
)
Status Put(
const WriteOptions &options,
const Slice &key,
const Slice &value
)
Status Delete(
const WriteOptions& options,
const Slice& key
)
Status Write(
const WriteOptions& options,
WriteBatch* updates
)
Status Get(
const ReadOptions & options,
const Slice & key,
string *value
)
Iterator * NewIterator(
const ReadOptions& options
)
const Snapshot * GetSnapshot()
void ReleaseSnapshot(
const Snapshot * snapshot
)
bool GetProperty(
const Slice& property, string* value
)
void GetApproximateSizes(
const Range* range, int n, unsigned long long* sizes
)
void CompactRange(
const Slice * begin, const Slice * end
)
void SuspendCompaction()
void ResumeCompaction()
Status DestroyDB(const string& name, const Options& options)
Status RepairDB(const string& dbname, const Options& options)
cdef cppclass Snapshot:
pass
cdef cppclass Range:
Slice start
Slice limit
Range()
Range(const Slice& s, const Slice& l)
cdef extern from "leveldb/status.h" namespace "leveldb" nogil:
cdef cppclass Status:
enum Code:
kOk = 0,
kNotFound = 1,
kCorruption = 2,
kNotSupported = 3,
kInvalidArgument = 4,
kIOError = 5
Status() except +
# ~Status() except +
bool ok()
bool IsNotFound()
bool IsCorruption()
bool IsIOError()
bool IsNotSupportedError()
bool IsInvalidArgument()
string ToString()
cdef extern from "leveldb/options.h" namespace "leveldb" nogil:
cdef cppclass Options:
Options() except +
const Comparator * comparator
bool create_if_missing
bool error_if_exists
bool paranoid_checks
Env * env
Logger * info_log
size_t write_buffer_size
int max_open_files
Cache * block_cache
size_t block_size
int block_restart_interval
size_t max_file_size
Compressor * compressors[256]
bool reuse_logs
const FilterPolicy * filter_policy
cdef cppclass ReadOptions:
bool verify_checksums
bool fill_cache
const Snapshot* snapshot
DecompressAllocator* decompress_allocator
ReadOptions() except +
cdef cppclass WriteOptions:
bool sync
WriteOptions() except +
cdef extern from "leveldb/write_batch.h" namespace "leveldb" nogil:
cdef cppclass WriteBatch:
WriteBatch()
void Put(const Slice& key, const Slice& value)
void Delete(const Slice& key)
void Clear()
size_t ApproximateSize()
cdef extern from "leveldb/iterator.h" namespace "leveldb" nogil:
cdef cppclass Iterator:
Iterator()
bool Valid()
void SeekToFirst()
void SeekToLast()
void Seek(const Slice& target)
void Next()
void Prev()
Slice key()
Slice value()
Status status()
cdef extern from "leveldb/decompress_allocator.h" namespace "leveldb" nogil:
cdef cppclass DecompressAllocator:
pass
cdef extern from "leveldb/comparator.h" namespace "leveldb" nogil:
cdef cppclass Comparator:
pass
# ~Comparator() except +
cdef extern from "leveldb/env.h" namespace "leveldb" nogil:
ctypedef struct va_list
cdef cppclass Env:
pass
cdef cppclass Logger:
Logger()
# ~Logger()
void Logv(const char * format, va_list ap)
cdef extern from "leveldb/cache.h" namespace "leveldb" nogil:
cdef cppclass Cache:
Cache() except +
Cache * NewLRUCache(size_t capacity)
cdef extern from "leveldb/slice.h" namespace "leveldb" nogil:
cdef cppclass Slice:
Slice() except +
Slice(const char * d, size_t n) except +
Slice(const string &s) except +
Slice(const char * s) except +
const char * data()
size_t size()
bool empty()
void clear()
string ToString()
cdef extern from "leveldb/compressor.h" namespace "leveldb" nogil:
cdef cppclass Compressor:
pass
cdef extern from "leveldb/filter_policy.h" namespace "leveldb" nogil:
cdef cppclass FilterPolicy:
const char* Name() except +
void CreateFilter(const Slice* keys, int n, string* dst)
bool KeyMayMatch(const Slice& key, const Slice& filter)
const FilterPolicy * NewBloomFilterPolicy(int bits_per_key)
cdef extern from "leveldb/compressor.h" namespace "leveldb" nogil:
cdef cppclass Compressor:
pass
cdef extern from "leveldb/zlib_compressor.h" namespace "leveldb" nogil:
cdef cppclass ZlibCompressor(Compressor):
ZlibCompressor(int compressionLevel) except +
cdef cppclass ZlibCompressorRaw(Compressor):
ZlibCompressorRaw(int compressionLevel) except +
cdef extern from "leveldb/decompress_allocator.h" namespace "leveldb" nogil:
cdef cppclass DecompressAllocator:
pass