yamlstar 0.1.18.0 → 0.1.19.0
raw patch · 2 files changed
+11/−10 lines, 2 files
Files
- lib/YAMLStar/FFI.hs +10/−9
- yamlstar.cabal +1/−1
lib/YAMLStar/FFI.hs view
@@ -34,16 +34,16 @@ c_graal_tear_down_isolate :: GraalIsolateThreadPtr -> IO CInt foreign import ccall "yamlstar_load"- c_yamlstar_load :: CLLong -> CString -> IO CString+ c_yamlstar_load :: CLLong -> CString -> CString -> IO CString foreign import ccall "yamlstar_load_all"- c_yamlstar_load_all :: CLLong -> CString -> IO CString+ c_yamlstar_load_all :: CLLong -> CString -> CString -> IO CString foreign import ccall "yamlstar_dump"- c_yamlstar_dump :: CLLong -> CString -> IO CString+ c_yamlstar_dump :: CLLong -> CString -> CString -> IO CString foreign import ccall "yamlstar_dump_all"- c_yamlstar_dump_all :: CLLong -> CString -> IO CString+ c_yamlstar_dump_all :: CLLong -> CString -> CString -> IO CString foreign import ccall "yamlstar_version" c_yamlstar_version :: CLLong -> IO CString@@ -85,14 +85,15 @@ then return BS.empty else BS.packCString cResult -callWithInput :: (CLLong -> CString -> IO CString) -> BS.ByteString -> IO LBS.ByteString+callWithInput :: (CLLong -> CString -> CString -> IO CString) -> BS.ByteString -> IO LBS.ByteString callWithInput func input = withGraalIsolate $ \isolateThread -> BSU.unsafeUseAsCString input $ \cInput -> do- cResult <- func (threadId isolateThread) cInput- if cResult == nullPtr- then return LBS.empty- else LBS.fromStrict <$> BS.packCString cResult+ BSU.unsafeUseAsCString (BS.pack [123, 125]) $ \cOpts -> do+ cResult <- func (threadId isolateThread) cInput cOpts+ if cResult == nullPtr+ then return LBS.empty+ else LBS.fromStrict <$> BS.packCString cResult threadId :: GraalIsolateThreadPtr -> CLLong threadId = fromIntegral . ptrToIntPtr
yamlstar.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: yamlstar-version: 0.1.18.0+version: 0.1.19.0 synopsis: Haskell bindings for YAMLStar description: Haskell bindings for YAMLStar, a pure YAML 1.2 loader. license: MIT