lbry-rocksdb/rocksdb/comparator.pxd
hofmockel a83a15e1a8 Better error reporting in python comparators
* Written to the rocksdb log-file
* raise an exception back to rocksdb
2014-01-24 17:11:41 +01:00

23 lines
706 B
Cython

from libcpp.string cimport string
from slice_ cimport Slice
from logger cimport Logger
from std_memory cimport shared_ptr
cdef extern from "rocksdb/comparator.h" namespace "rocksdb":
cdef cppclass Comparator:
const char* Name()
int Compare(const Slice&, const Slice&) const
cdef extern const Comparator* BytewiseComparator() nogil except +
ctypedef int (*compare_func)(
void*,
Logger*,
string&,
const Slice&,
const Slice&)
cdef extern from "cpp/comparator_wrapper.hpp" namespace "py_rocks":
cdef cppclass ComparatorWrapper:
ComparatorWrapper(string, void*, compare_func) nogil except +
void set_info_log(shared_ptr[Logger]) nogil except+