A C string is a reference to an array of C characters terminated by NUL.
Moduleghc-internal-9.1003.0Haskell2010
GHC.Internal.Foreign.C.String.Encoding
Foreign marshalling support for CStrings with configurable encodings
- 2 types
- 10 values
- Packageghc-internal-9.1003.0
- Exports12
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceEncoding.hs
C strings with a configurable encoding
2 declarationsA string with explicit length information in bytes instead of a terminating NUL (allowing NUL characters in the middle of the string).
Conversion of C strings into Haskell strings
2 declarationsMarshal a NUL terminated C string into a Haskell string.
Marshal a C string with explicit length into a Haskell string.
Conversion of Haskell strings into C strings
3 declarationsMarshal a Haskell string into a NUL terminated C string.
the Haskell string may not contain any NUL characters
new storage is allocated for the C string and must be explicitly freed using free or finalizerFree.
Marshal a Haskell string into a C string (ie, character array) with explicit length information.
Note that this does not NUL terminate the resulting string.
new storage is allocated for the C string and must be explicitly freed using free or finalizerFree.
Marshal a Haskell string into a NUL-terminated C string (ie, character array) with explicit length information.
new storage is allocated for the C string and must be explicitly freed using free or finalizerFree.
Conversion of Haskell strings into C strings using temporary storage
5 declarationsMarshal a Haskell string into a NUL terminated C string using temporary storage.
the Haskell string may not contain any NUL characters
the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
Marshal a Haskell string into a C string (ie, character array) in temporary storage, with explicit length information.
Note that this does not NUL terminate the resulting string.
the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
Marshal a Haskell string into a NUL-terminated C string (ie, character array) in temporary storage, with explicit length information.
the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
Marshal a list of Haskell strings into an array of NUL terminated C strings using temporary storage.
the Haskell strings may not contain any NUL characters
the memory is freed when the subcomputation terminates (either normally or via an exception), so the pointer to the temporary storage must not be used after this.
Determines whether a character can be accurately encoded in a
Foreign.C.String.CString.
Pretty much anyone who uses this function is in a state of sin because whether or not a character is encodable will, in general, depend on the context in which it occurs.