Sophie

Sophie

distrib > Mageia > 5 > i586 > media > core-release > by-pkgid > 6e204a966e8c42d976f99a1700ce5f20 > files > 2300

ghc-7.4.2-4.mga5.i586.rpm

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>GHC.Foreign</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_GHC-Foreign.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">base-4.5.1.0: Basic libraries</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Portability</th><td>non-portable</td></tr><tr><th>Stability</th><td>internal</td></tr><tr><th>Maintainer</th><td>libraries@haskell.org</td></tr><tr><th>Safe Haskell</th><td>Trustworthy</td></tr></table><p class="caption">GHC.Foreign</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">C strings with a configurable encoding
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Foreign marshalling support for CStrings with configurable encodings
</p></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><a href="#v:peekCString">peekCString</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; CString -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:peekCStringLen">peekCStringLen</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; CStringLen -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-String.html#t:String">String</a></li><li class="src short"><a href="#v:newCString">newCString</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; <a href="System-IO.html#t:IO">IO</a> CString</li><li class="src short"><a href="#v:newCStringLen">newCStringLen</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; <a href="System-IO.html#t:IO">IO</a> CStringLen</li><li class="src short"><a href="#v:withCString">withCString</a> ::  <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; (CString -&gt; <a href="System-IO.html#t:IO">IO</a> a) -&gt; <a href="System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:withCStringLen">withCStringLen</a> ::  <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; (CStringLen -&gt; <a href="System-IO.html#t:IO">IO</a> a) -&gt; <a href="System-IO.html#t:IO">IO</a> a</li><li class="src short"><a href="#v:charIsRepresentable">charIsRepresentable</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-Char.html#t:Char">Char</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></li></ul></div><div id="interface"><h1 id="g:1">C strings with a configurable encoding
</h1><div class="top"><p class="src"><a name="v:peekCString" class="def">peekCString</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; CString -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-String.html#t:String">String</a></p><div class="doc"><p>Marshal a NUL terminated C string into a Haskell string.
</p></div></div><div class="top"><p class="src"><a name="v:peekCStringLen" class="def">peekCStringLen</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; CStringLen -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-String.html#t:String">String</a></p><div class="doc"><p>Marshal a C string with explicit length into a Haskell string.
</p></div></div><div class="top"><p class="src"><a name="v:newCString" class="def">newCString</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; <a href="System-IO.html#t:IO">IO</a> CString</p><div class="doc"><p>Marshal a Haskell string into a NUL terminated C string.
</p><ul><li> the Haskell string may <em>not</em> contain any NUL characters
</li><li> new storage is allocated for the C string and must be
   explicitly freed using <code><a href="Foreign-Marshal-Alloc.html#v:free">free</a></code> or
   <code><a href="Foreign-Marshal-Alloc.html#v:finalizerFree">finalizerFree</a></code>.
</li></ul></div></div><div class="top"><p class="src"><a name="v:newCStringLen" class="def">newCStringLen</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; <a href="System-IO.html#t:IO">IO</a> CStringLen</p><div class="doc"><p>Marshal a Haskell string into a C string (ie, character array) with
 explicit length information.
</p><ul><li> new storage is allocated for the C string and must be
   explicitly freed using <code><a href="Foreign-Marshal-Alloc.html#v:free">free</a></code> or
   <code><a href="Foreign-Marshal-Alloc.html#v:finalizerFree">finalizerFree</a></code>.
</li></ul></div></div><div class="top"><p class="src"><a name="v:withCString" class="def">withCString</a> ::  <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; (CString -&gt; <a href="System-IO.html#t:IO">IO</a> a) -&gt; <a href="System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Marshal a Haskell string into a NUL terminated C string using temporary
 storage.
</p><ul><li> the Haskell string may <em>not</em> contain any NUL characters
</li><li> the memory is freed when the subcomputation terminates (either
   normally or via an exception), so the pointer to the temporary
   storage must <em>not</em> be used after this.
</li></ul></div></div><div class="top"><p class="src"><a name="v:withCStringLen" class="def">withCStringLen</a> ::  <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-String.html#t:String">String</a> -&gt; (CStringLen -&gt; <a href="System-IO.html#t:IO">IO</a> a) -&gt; <a href="System-IO.html#t:IO">IO</a> a</p><div class="doc"><p>Marshal a Haskell string into a C string (ie, character array)
 in temporary storage, with explicit length information.
</p><ul><li> the memory is freed when the subcomputation terminates (either
   normally or via an exception), so the pointer to the temporary
   storage must <em>not</em> be used after this.
</li></ul></div></div><div class="top"><p class="src"><a name="v:charIsRepresentable" class="def">charIsRepresentable</a> :: <a href="GHC-IO-Encoding-Types.html#t:TextEncoding">TextEncoding</a> -&gt; <a href="Data-Char.html#t:Char">Char</a> -&gt; <a href="System-IO.html#t:IO">IO</a> <a href="Data-Bool.html#t:Bool">Bool</a></p><div class="doc"><p>Determines whether a character can be accurately encoded in a <code>CString</code>.
</p><p>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.
</p></div></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.11.0</p></div></body></html>