# HG changeset patch # User Henry S. Thompson # Date 1737636808 0 # Node ID 3ac7e5ec07f9dac33a8dbf207b974c4154e49afd # Parent cbcdabf6819d5c4d2484f489ab9c958934843d4b renamed cpython class Cdb to CCdb to avoid name conflict with cdb.Cdb diff -r cbcdabf6819d -r 3ac7e5ec07f9 lib/python/cc/lmh/db.pyx --- a/lib/python/cc/lmh/db.pyx Thu Jan 23 12:27:57 2025 +0000 +++ b/lib/python/cc/lmh/db.pyx Thu Jan 23 12:53:28 2025 +0000 @@ -6,30 +6,29 @@ cimport cdb import sys, timeit -cdef class Cdb: +cdef class CCdb: cdef cdb.Cdb* _c_cdb - def __cinit__(self): self._c_cdb = cdb.cdb_new() - cdef int find(self: Cdb, p: bytes): + cdef int find(self, p: bytes): return cdb.cdb_find(self._c_cdb, p, len(p)) - cdef char[::1] init(self: Cdb, fno: int): + cdef char[::1] init(self, fno: int): cdb.cdb_init(self._c_cdb,fno) cdef char[::1] _mview = (cdb.cdb_mmap()) return _mview probe: bytes = sys.argv[2].encode('utf8') -cdef Cdb CC +cdef CCdb CC -cdef Cdb testMe(): +cdef CCdb testMe(): global probe res: int print('testing...') - cd = Cdb() + cd = CCdb() with open(sys.argv[1],'rb') as dbf: mv = cd.init(dbf.fileno()) cdb.cdb_findstart(cd._c_cdb)