diff options
| author | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-05 10:07:43 +0200 |
|---|---|---|
| committer | Krasimir Angelov <kr.angelov@gmail.com> | 2017-09-05 10:07:43 +0200 |
| commit | 30b7ba04c701ef156992eb53a7b65accebfa9f21 (patch) | |
| tree | bce5f12c8d7180452eae0c66502f095fc0ea3daa /src/runtime/haskell-bind/PGF2.hsc | |
| parent | 85cf2d9f5a1018219beb51c1172842cddda1f544 (diff) | |
added exprFunctions in the Haskell binding
Diffstat (limited to 'src/runtime/haskell-bind/PGF2.hsc')
| -rw-r--r-- | src/runtime/haskell-bind/PGF2.hsc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/runtime/haskell-bind/PGF2.hsc b/src/runtime/haskell-bind/PGF2.hsc index 4990a1926..dfddb9708 100644 --- a/src/runtime/haskell-bind/PGF2.hsc +++ b/src/runtime/haskell-bind/PGF2.hsc @@ -39,7 +39,7 @@ module PGF2 (-- * PGF mkFloat,unFloat, mkMeta,unMeta, mkCId, - exprHash, exprSize, + exprHash, exprSize, exprFunctions, treeProbability, -- ** Types @@ -338,6 +338,16 @@ exprSize (Expr c_expr touch1) = touch1 return (fromIntegral size) +exprFunctions :: Expr -> [Fun] +exprFunctions (Expr c_expr touch) = + unsafePerformIO $ + withGuPool $ \tmpPl -> do + seq <- pgf_expr_functions c_expr tmpPl + len <- (#peek GuSeq, len) seq + arr <- peekArray (fromIntegral (len :: CInt)) (seq `plusPtr` (#offset GuSeq, data)) + funs <- mapM peekUtf8CString arr + touch + return funs ----------------------------------------------------------------------------- -- Graphviz |
