Streamly.Internal.Data.CString
MutByteArray representing null terminated c strings. All APIs in this module are unsafe and caution must be used when using them. Completely experimental. Everything is subject to change without notice.
Documentation
splice :: MutByteArray -> MutByteArray -> IO Int Source #
Join two null terminated cstrings, the null byte of the first string is overwritten. Does not check the destination length or source length. Destination must have enough space to accomodate src.
Returns the offset of the null byte.
Unsafe
spliceCString :: MutByteArray -> CString -> IO Int Source #
Join a null terminated cstring MutByteByteArray with a null terminated cstring Ptr.
splicePtrN :: MutByteArray -> Ptr Word8 -> Int -> IO Int Source #
Append specified number of bytes from a Ptr to a MutByteArray CString. The null byte of CString is overwritten and the result is terminated with a null byte.
putCString :: MutByteArray -> Int -> CString -> IO Int Source #
putCString dst dstOffset cstr
writes the cstring cstr at dstOffset in
the dst MutByteArray. The result is terminated by a null byte.