leveldb-haskell-fork-0.3.3: Haskell bindings to LevelDB

Portabilitynon-portable
Stabilityexperimental
Maintainerkim.altintop@gmail.com
Safe HaskellNone

Database.LevelDB.C

Description

 

Synopsis

Documentation

type DBName = CStringSource

type ErrPtr = Ptr CStringSource

type Key = CStringSource

type Val = CStringSource

newtype CompressionOpt Source

Constructors

CompressionOpt 

Fields

compressionOpt :: CInt
 

Instances

c_leveldb_put :: LevelDBPtr -> WriteOptionsPtr -> Key -> CSize -> Val -> CSize -> ErrPtr -> IO ()Source

c_leveldb_getSource

Arguments

:: LevelDBPtr 
-> ReadOptionsPtr 
-> Key 
-> CSize 
-> Ptr CSize

value length

-> ErrPtr 
-> IO CString 

Returns NULL if not found. A malloc()ed array otherwise. Stores the length of the array in *vallen.

c_leveldb_property_value :: LevelDBPtr -> CString -> IO CStringSource

Returns NULL if property name is unknown. Else returns a pointer to a malloc()-ed null-terminated value.

c_leveldb_approximate_sizesSource

Arguments

:: LevelDBPtr 
-> CInt

num ranges

-> Ptr CString 
-> Ptr CSize

range start keys (array)

-> Ptr CString 
-> Ptr CSize

range limit keys (array)

-> Ptr Word64

array of approx. sizes of ranges

-> IO () 

c_leveldb_iter_seek :: IteratorPtr -> Key -> CSize -> IO ()Source

c_leveldb_writebatch_put :: WriteBatchPtr -> Key -> CSize -> Val -> CSize -> IO ()Source

c_leveldb_writebatch_iterateSource

Arguments

:: WriteBatchPtr 
-> Ptr ()

state

-> FunPtr (Ptr () -> Key -> CSize -> Val -> CSize)

put

-> FunPtr (Ptr () -> Key -> CSize)

delete

-> IO () 

type StatePtr = Ptr ()Source

type CompareFun = StatePtr -> CString -> CSize -> CString -> CSize -> IO CIntSource

type NameFun = StatePtr -> CStringSource

mkCmp :: CompareFun -> IO (FunPtr CompareFun)Source

Make a FunPtr to a user-defined comparator function

mkDest :: Destructor -> IO (FunPtr Destructor)Source

Make a destructor FunPtr

mkName :: NameFun -> IO (FunPtr NameFun)Source

Make a name FunPtr

type CreateFilterFunSource

Arguments

 = StatePtr 
-> Ptr CString

key array

-> Ptr CSize

key length array

-> CInt

num keys

-> Ptr CSize

filter length

-> IO CString

the filter

type KeyMayMatchFunSource

Arguments

 = StatePtr 
-> CString

key

-> CSize

key length

-> CString

filter

-> CSize

filter length

-> IO CUChar

whether key is in filter

mkCF :: CreateFilterFun -> IO (FunPtr CreateFilterFun)Source

Make a FunPtr to a user-defined create_filter function

mkKMM :: KeyMayMatchFun -> IO (FunPtr KeyMayMatchFun)Source

Make a FunPtr to a user-defined key_may_match function