diff options
| author | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-07 21:31:33 +0200 |
|---|---|---|
| committer | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-07 21:31:33 +0200 |
| commit | 4f680b728b580a0eda89197801ab6adb54ab3258 (patch) | |
| tree | 94d28ba0ba48085f9be255ef9cfe1738bb166c4f /src/runtime/haskell-bind/PGF2/FFI.hs | |
| parent | 60bd12a952dae70e23f8f79077ce41dd86043d34 (diff) | |
a light API in the Haskell binding for accessing the internal data structures
Diffstat (limited to 'src/runtime/haskell-bind/PGF2/FFI.hs')
| -rw-r--r-- | src/runtime/haskell-bind/PGF2/FFI.hs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs index 9a65c186f..8ca2d1c98 100644 --- a/src/runtime/haskell-bind/PGF2/FFI.hs +++ b/src/runtime/haskell-bind/PGF2/FFI.hs @@ -28,10 +28,12 @@ data GuKind data GuType data GuString data GuStringBuf +data GuMap data GuMapItor data GuOut data GuSeq data GuPool +type GuVariant = Ptr () foreign import ccall fopen :: CString -> CString -> IO (Ptr ()) @@ -96,6 +98,19 @@ foreign import ccall unsafe "gu/utf8.h gu_utf8_encode" foreign import ccall unsafe "gu/seq.h gu_make_seq" gu_make_seq :: CInt -> CInt -> Ptr GuPool -> IO (Ptr GuSeq) +foreign import ccall unsafe "gu/map.h gu_map_find_default" + gu_map_find_default :: Ptr GuMap -> Ptr a -> IO (Ptr b) + +foreign import ccall "gu/map.h gu_map_iter" + gu_map_iter :: Ptr GuMap -> Ptr GuMapItor -> Ptr GuExn -> IO () + +foreign import ccall unsafe "gu/variant.h gu_variant_tag" + gu_variant_tag :: GuVariant -> IO CInt + +foreign import ccall unsafe "gu/variant.h gu_variant_data" + gu_variant_data :: GuVariant -> IO (Ptr a) + + withGuPool :: (Ptr GuPool -> IO a) -> IO a withGuPool f = bracket gu_new_pool gu_pool_free f |
