posix-api-0.7.2.0: posix bindings
Safe HaskellSafe-Inferred
LanguageHaskell2010

Foreign.C.String.Managed

Synopsis

Documentation

fromBytes :: Bytes -> ManagedCString Source #

Copies the slice, appending a NUL byte to the end.

fromLatinString :: String -> ManagedCString Source #

Convert a String consisting of only characters representable by ISO-8859-1. These are encoded with ISO-8859-1. Any character with a codepoint above U+00FF is replaced by an unspecified byte.

pinnedFromBytes :: Bytes -> ManagedCString Source #

Copies the slice into pinned memory, appending a NUL byte to the end.

contents :: ManagedCString -> CString Source #

Get a pointer to the payload of the managed C string. The behavior is undefined if the argument is not pinned.