From df0602723dcb0dd9a558aba9b29cdde8e7c4f6c9 Mon Sep 17 00:00:00 2001 From: "kr.angelov" Date: Wed, 10 Sep 2014 15:41:53 +0000 Subject: now release the FunPtr:s that are allocated for each literal callback --- src/runtime/haskell-bind/PGF2/FFI.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/runtime/haskell-bind/PGF2') diff --git a/src/runtime/haskell-bind/PGF2/FFI.hs b/src/runtime/haskell-bind/PGF2/FFI.hs index 9b0f9961e..a467f7ddc 100644 --- a/src/runtime/haskell-bind/PGF2/FFI.hs +++ b/src/runtime/haskell-bind/PGF2/FFI.hs @@ -97,6 +97,7 @@ data PgfFullFormEntry data PgfMorphoCallback data PgfPrintContext data PgfType +data PgfLiteralCallback foreign import ccall "pgf/pgf.h pgf_read" pgf_read :: CString -> Ptr GuPool -> Ptr GuExn -> IO (Ptr PgfPGF) @@ -146,9 +147,6 @@ foreign import ccall "pgf/pgf.h pgf_linearize" foreign import ccall "pgf/pgf.h pgf_parse" pgf_parse :: Ptr PgfConcr -> CString -> CString -> Ptr GuExn -> Ptr GuPool -> Ptr GuPool -> IO (Ptr GuEnum) -foreign import ccall "pgf/pgf.h pgf_concr_get_pool" - pgf_concr_get_pool :: Ptr PgfConcr -> IO (Ptr GuPool) - type LiteralMatchCallback = Ptr () -> CInt -> CString -> Ptr CInt -> Ptr GuPool -> IO (Ptr PgfExprProb) foreign import ccall "wrapper" @@ -159,8 +157,11 @@ type LiteralPredictCallback = Ptr () -> CInt -> CString -> Ptr GuPool -> IO (Ptr foreign import ccall "wrapper" wrapLiteralPredictCallback :: LiteralPredictCallback -> IO (FunPtr LiteralPredictCallback) +foreign import ccall + hspgf_new_literal_callback :: Ptr PgfConcr -> IO (Ptr PgfLiteralCallback) + foreign import ccall "pgf/pgf.h pgf_concr_add_literal" - pgf_concr_add_literal :: Ptr PgfConcr -> CString -> Ptr () -> Ptr GuExn -> IO () + pgf_concr_add_literal :: Ptr PgfConcr -> CString -> Ptr PgfLiteralCallback -> Ptr GuExn -> IO () foreign import ccall "pgf/pgf.h pgf_lookup_morpho" pgf_lookup_morpho :: Ptr PgfConcr -> CString -> Ptr PgfMorphoCallback -> Ptr GuExn -> IO () -- cgit v1.2.3