def nextkey(self, key): with _lock: self.__check_closed() key = lib.gdbm_nextkey(self.__ll_dbm, _fromstr(key)) if key.dptr: res = bytes(ffi.buffer(key.dptr, key.dsize)) lib.free(key.dptr) return res
def nextkey(self, key): with _lock: self.__check_closed() key = lib.gdbm_nextkey(self.__ll_dbm, _fromstr(key)) if key.dptr: res = str(ffi.buffer(key.dptr, key.dsize)) lib.free(key.dptr) return res
def __keys(self): self.__check_closed() l = [] key = lib.gdbm_firstkey(self.__ll_dbm) while key.dptr: l.append(bytes(ffi.buffer(key.dptr, key.dsize))) nextkey = lib.gdbm_nextkey(self.__ll_dbm, key) lib.free(key.dptr) key = nextkey return l
def __keys(self): self.__check_closed() l = [] key = lib.gdbm_firstkey(self.__ll_dbm) while key.dptr: l.append(str(ffi.buffer(key.dptr, key.dsize))) nextkey = lib.gdbm_nextkey(self.__ll_dbm, key) lib.free(key.dptr) key = nextkey return l