diff options
| author | krasimir <krasimir@chalmers.se> | 2015-09-04 10:02:42 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2015-09-04 10:02:42 +0000 |
| commit | 0b392e8cff9ecac3ea12e99dc4c4b8e11377f82b (patch) | |
| tree | ebea0dbb090b7bdb6cd54eb07fe9584a7f64edbf /src/runtime/haskell-bind/SG | |
| parent | e9f7aa0e33d2daa6f182e03b20e06eb19f320259 (diff) | |
the Haskell binding now covers everything in the libsg API
Diffstat (limited to 'src/runtime/haskell-bind/SG')
| -rw-r--r-- | src/runtime/haskell-bind/SG/FFI.hs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/runtime/haskell-bind/SG/FFI.hs b/src/runtime/haskell-bind/SG/FFI.hs index 2874082bb..37c7f8c3a 100644 --- a/src/runtime/haskell-bind/SG/FFI.hs +++ b/src/runtime/haskell-bind/SG/FFI.hs @@ -8,6 +8,7 @@ import GHC.Ptr import Data.Int data SgSG +data SgTripleResult type SgId = Int64 foreign import ccall "sg/sg.h sg_open" @@ -28,10 +29,26 @@ foreign import ccall "sg/sg.h sg_rollback" foreign import ccall "sg/sg.h sg_insert_expr" sg_insert_expr :: Ptr SgSG -> PgfExpr -> Ptr GuExn -> IO SgId +foreign import ccall "sg/sg.h sg_get_expr" + sg_get_expr :: Ptr SgSG -> SgId -> Ptr GuPool -> Ptr GuExn -> IO PgfExpr + foreign import ccall "sg/sg.h sg_insert_triple" sg_insert_triple :: Ptr SgSG -> SgTriple -> Ptr GuExn -> IO SgId -type SgTriple = Ptr SgId +foreign import ccall "sg/sg.h sg_get_triple" + sg_get_triple :: Ptr SgSG -> SgId -> SgTriple -> Ptr GuPool -> Ptr GuExn -> IO CInt + +foreign import ccall "sg/sg.h sg_query_triple" + sg_query_triple :: Ptr SgSG -> SgTriple -> Ptr GuExn -> IO (Ptr SgTripleResult) + +foreign import ccall "sg/sg.h sg_triple_result_fetch" + sg_triple_result_fetch :: Ptr SgTripleResult -> Ptr SgId -> SgTriple -> Ptr GuPool -> Ptr GuExn -> IO CInt + +foreign import ccall "sg/sg.h sg_triple_result_close" + sg_triple_result_close :: Ptr SgTripleResult -> Ptr GuExn -> IO () + + +type SgTriple = Ptr PgfExpr withTriple :: (SgTriple -> IO a) -> IO a withTriple = allocaArray 3 |
