From 73b41687c8038ee69562fafd0693204509621c79 Mon Sep 17 00:00:00 2001 From: krasimir Date: Wed, 2 Sep 2015 07:12:36 +0000 Subject: added the minimal Haskell API for storing expressions/triples in the semantic graph --- src/runtime/haskell-bind/PGF2/FFI.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/runtime/haskell-bind/PGF2/FFI.hs') diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs index 295c1fde9..96b3eea35 100644 --- a/src/runtime/haskell-bind/PGF2/FFI.hs +++ b/src/runtime/haskell-bind/PGF2/FFI.hs @@ -76,6 +76,11 @@ foreign import ccall "gu/string.h gu_string_buf_freeze" withGuPool :: (Ptr GuPool -> IO a) -> IO a withGuPool f = bracket gu_new_pool gu_pool_free f +newOut :: Ptr GuPool -> IO (Ptr GuStringBuf, Ptr GuOut) +newOut pool = + do sb <- gu_string_buf pool + out <- gu_string_buf_out sb + return (sb,out) ------------------------------------------------------------------ -- libpgf API -- cgit v1.2.3