summaryrefslogtreecommitdiff
path: root/src/runtime/haskell-bind/PGF2
diff options
context:
space:
mode:
authorKrasimir Angelov <kr.angelov@gmail.com>2017-08-29 11:58:12 +0200
committerKrasimir Angelov <kr.angelov@gmail.com>2017-08-29 11:58:12 +0200
commit20b72f477a189a35d85e0dd99c4762e23dfa196d (patch)
treebf53e636336f4b533a08a965331731fa44647484 /src/runtime/haskell-bind/PGF2
parentd4026a64f4a350813c5eed12d5c3eeb18649df58 (diff)
added bracketedLinearize in the Haskell binding
Diffstat (limited to 'src/runtime/haskell-bind/PGF2')
-rw-r--r--src/runtime/haskell-bind/PGF2/FFI.hs24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs
index ae217b46a..d01084d62 100644
--- a/src/runtime/haskell-bind/PGF2/FFI.hs
+++ b/src/runtime/haskell-bind/PGF2/FFI.hs
@@ -55,6 +55,9 @@ foreign import ccall "gu/exn.h gu_exn_is_raised"
foreign import ccall "gu/exn.h gu_exn_caught_"
gu_exn_caught :: Ptr GuExn -> CString -> IO Bool
+foreign import ccall "gu/exn.h gu_exn_raise_"
+ gu_exn_raise :: Ptr GuExn -> CString -> IO (Ptr ())
+
gu_exn_type_GuErrno = Ptr "GuErrno"# :: CString
gu_exn_type_PgfLinNonExist = Ptr "PgfLinNonExist"# :: CString
@@ -144,6 +147,7 @@ type PgfType = Ptr ()
data PgfCallbacksMap
data PgfOracleCallback
data PgfCncTree
+data PgfLinFuncs
foreign import ccall "pgf/pgf.h pgf_read"
pgf_read :: CString -> Ptr GuPool -> Ptr GuExn -> IO (Ptr PgfPGF)
@@ -202,9 +206,29 @@ foreign import ccall "pgf/pgf.h pgf_lzr_wrap_linref"
foreign import ccall "pgf/pgf.h pgf_lzr_linearize_simple"
pgf_lzr_linearize_simple :: Ptr PgfConcr -> Ptr PgfCncTree -> CInt -> Ptr GuOut -> Ptr GuExn -> Ptr GuPool -> IO ()
+foreign import ccall "pgf/pgf.h pgf_lzr_linearize"
+ pgf_lzr_linearize :: Ptr PgfConcr -> Ptr PgfCncTree -> CInt -> Ptr (Ptr PgfLinFuncs) -> Ptr GuPool -> IO ()
+
foreign import ccall "pgf/pgf.h pgf_lzr_get_table"
pgf_lzr_get_table :: Ptr PgfConcr -> Ptr PgfCncTree -> Ptr CInt -> Ptr (Ptr CString) -> IO ()
+type SymbolTokenCallback = Ptr (Ptr PgfLinFuncs) -> CString -> IO ()
+type PhraseCallback = Ptr (Ptr PgfLinFuncs) -> CString -> CInt -> CInt -> CString -> IO ()
+type NonExistCallback = Ptr (Ptr PgfLinFuncs) -> IO ()
+type MetaCallback = Ptr (Ptr PgfLinFuncs) -> CInt -> IO ()
+
+foreign import ccall "wrapper"
+ wrapSymbolTokenCallback :: SymbolTokenCallback -> IO (FunPtr SymbolTokenCallback)
+
+foreign import ccall "wrapper"
+ wrapPhraseCallback :: PhraseCallback -> IO (FunPtr PhraseCallback)
+
+foreign import ccall "wrapper"
+ wrapSymbolNonExistCallback :: NonExistCallback -> IO (FunPtr NonExistCallback)
+
+foreign import ccall "wrapper"
+ wrapSymbolMetaCallback :: MetaCallback -> IO (FunPtr MetaCallback)
+
foreign import ccall "pgf/pgf.h pgf_align_words"
pgf_align_words :: Ptr PgfConcr -> PgfExpr -> Ptr GuExn -> Ptr GuPool -> IO (Ptr GuSeq)