Safe Haskell | None |
---|---|
Language | Haskell2010 |
Helper functions used by Compilation module.
Synopsis
- peekUTF8CString :: CString -> IO String
- newUTF8CString :: String -> IO CString
- withUTF8CString :: String -> (CString -> IO a) -> IO a
- newCStringFromBS :: ByteString -> IO CString
Documentation
peekUTF8CString :: CString -> IO String Source #
Marshal a NUL terminated C string (UTF-8 encoded) into Haskell string.
It is equivalent to peekCString
but with different encoding.
newUTF8CString :: String -> IO CString Source #
Marshal a Haskell string into a NUL terminated C string (UTF-8 encoded).
It is equivalent to newCString
but with different encoding.
withUTF8CString :: String -> (CString -> IO a) -> IO a Source #
Marshal a Haskell string into a C string (i.e., character array)
in temporary storage, with explicit length information.
It is equivalent to withCString
but with different encoding.
newCStringFromBS :: ByteString -> IO CString Source #
Copies ByteString
to newly allocated CString
. The result must be
explicitly freed using free
or finalizerFree
.