~singpolyma/tokyocabinet-haskell

ref: af8273e0c45915ec74cbfdd088b21f12046c9de6 tokyocabinet-haskell/Database/TokyoCabinet/Map/C.hs -rw-r--r-- 3.0 KiB View raw
af8273e0Stephen Paul Weber Let cabal know about the tests, and fix warnings 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
{-# LANGUAGE ForeignFunctionInterface, EmptyDataDecls #-}
module Database.TokyoCabinet.Map.C where

import Data.Word

import Foreign.Ptr
import Foreign.C.Types
import Foreign.C.String
import Foreign.ForeignPtr

import Database.TokyoCabinet.List.C

data Map k v = Map { unMap :: !(ForeignPtr MAP) }

data MAP

foreign import ccall safe "tcmapnew"
  c_tcmapnew :: IO (Ptr MAP)

foreign import ccall safe "tcmapnew2"
  c_tcmapnew2 :: Word32 -> IO (Ptr MAP)

foreign import ccall safe "tcmapdup"
  c_tcmapdup :: Ptr MAP -> IO (Ptr MAP)

foreign import ccall safe "tcmapdel"
  c_tcmapdel :: Ptr MAP -> IO ()

foreign import ccall safe "&tcmapdel"
  tcmapFinalizer :: FunPtr (Ptr MAP -> IO ())

foreign import ccall safe "tcmapput"
  c_tcmapput :: Ptr MAP -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> IO ()

foreign import ccall safe "tcmapput2"
  c_tcmapput2 :: Ptr MAP -> CString -> CString -> IO ()

foreign import ccall safe "tcmapputkeep"
  c_tcmapputkeep :: Ptr MAP -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> IO Bool

foreign import ccall safe "tcmapputkeep2"
  c_tcmapputkeep2 :: Ptr MAP -> CString -> CString -> IO Bool

foreign import ccall safe "tcmapputcat"
  c_tcmapputcat :: Ptr MAP -> Ptr Word8 -> CInt -> Ptr Word8 -> CInt -> IO ()

foreign import ccall safe "tcmapputcat2"
  c_tcmapputcat2 :: Ptr MAP -> CString -> CString -> IO ()

foreign import ccall safe "tcmapout"
  c_tcmapout :: Ptr MAP -> Ptr Word8 -> CInt -> IO Bool

foreign import ccall safe "tcmapout2"
  c_tcmapout2 :: Ptr MAP -> CString -> IO Bool

foreign import ccall safe "tcmapget"
  c_tcmapget :: Ptr MAP -> Ptr Word8 -> CInt -> Ptr CInt -> IO (Ptr Word8)

foreign import ccall safe "tcmapget2"
  c_tcmapget2 :: Ptr MAP -> CString -> IO CString

foreign import ccall safe "tcmapmove"
  c_tcmapmove :: Ptr MAP -> Ptr Word8 -> CInt -> Bool -> IO Bool

foreign import ccall safe "tcmapmove2"
  c_tcmapmove2 :: Ptr MAP -> CString -> Bool -> IO Bool

foreign import ccall safe "tcmapiterinit"
  c_tcmapiterinit :: Ptr MAP -> IO ()

foreign import ccall safe "tcmapiternext"
  c_tcmapiternext :: Ptr MAP -> Ptr CInt -> IO (Ptr Word8)

foreign import ccall safe "tcmapiternext2"
  c_tcmapiternext2 :: Ptr MAP -> IO CString

foreign import ccall safe "tcmaprnum"
  c_tcmaprnum :: Ptr MAP -> IO Word64

foreign import ccall safe "tcmapmsiz"
  c_tcmapmsiz :: Ptr MAP -> IO Word64

foreign import ccall safe "tcmapkeys"
  c_tcmapkeys :: Ptr MAP -> IO (Ptr LIST)

foreign import ccall safe "tcmapvals"
  c_tcmapvals :: Ptr MAP -> IO (Ptr LIST)

foreign import ccall safe "tcmapaddint"
  c_tcmapaddint :: Ptr MAP -> Ptr Word8 -> CInt -> CInt -> IO CInt

foreign import ccall safe "tcmapadddouble"
  c_tcmapadddouble :: Ptr MAP -> Ptr Word8 -> CInt -> CDouble -> IO CDouble

foreign import ccall safe "tcmapclear"
  c_tcmapclear :: Ptr MAP -> IO ()

foreign import ccall safe "tcmapcutfront"
  c_tcmapcutfront :: Ptr MAP -> CInt -> IO ()

foreign import ccall safe "tcmapdump"
  c_tcmapdump :: Ptr MAP -> Ptr CInt -> IO (Ptr Word8)

foreign import ccall safe "tcmapload"
  c_tcmapload :: Ptr Word8 -> CInt -> IO (Ptr MAP)