2014-01-13 19:52:22 +01:00
|
|
|
from libcpp.string cimport string
|
|
|
|
from slice_ cimport Slice
|
2014-01-24 17:11:41 +01:00
|
|
|
from logger cimport Logger
|
|
|
|
from std_memory cimport shared_ptr
|
|
|
|
|
2014-01-13 19:52:22 +01:00
|
|
|
cdef extern from "rocksdb/comparator.h" namespace "rocksdb":
|
|
|
|
cdef cppclass Comparator:
|
|
|
|
const char* Name()
|
|
|
|
int Compare(const Slice&, const Slice&) const
|
|
|
|
|
2014-01-17 20:06:17 +01:00
|
|
|
cdef extern const Comparator* BytewiseComparator() nogil except +
|
2014-01-13 19:52:22 +01:00
|
|
|
|
2014-01-24 17:11:41 +01:00
|
|
|
ctypedef int (*compare_func)(
|
|
|
|
void*,
|
|
|
|
Logger*,
|
|
|
|
string&,
|
|
|
|
const Slice&,
|
|
|
|
const Slice&)
|
2014-01-13 19:52:22 +01:00
|
|
|
|
|
|
|
cdef extern from "cpp/comparator_wrapper.hpp" namespace "py_rocks":
|
|
|
|
cdef cppclass ComparatorWrapper:
|
2014-01-17 20:06:17 +01:00
|
|
|
ComparatorWrapper(string, void*, compare_func) nogil except +
|
2014-01-24 17:11:41 +01:00
|
|
|
void set_info_log(shared_ptr[Logger]) nogil except+
|