add cast{US}CharToChar and castCharTo{US}Char
authorSimon Marlow <marlowsd@gmail.com>
Wed, 14 Jul 2010 15:17:18 +0000 (15:17 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Wed, 14 Jul 2010 15:17:18 +0000 (15:17 +0000)
report/libs/Foreign-C-String.tex

index d1dcb9e..6112d48 100644 (file)
@@ -5,7 +5,8 @@
 module Foreign.C.String (
     CString,  CStringLen,  peekCString,  peekCStringLen,  newCString, 
     newCStringLen,  withCString,  withCStringLen,  charIsRepresentable, 
-    castCharToCChar,  castCCharToChar,  peekCAString,  peekCAStringLen, 
+    castCharToCChar,  castCCharToChar,  castCharToCUChar,  castCUCharToChar, 
+    castCharToCSChar,  castCSCharToChar,  peekCAString,  peekCAStringLen, 
     newCAString,  newCAStringLen,  withCAString,  withCAStringLen,  CWString, 
     CWStringLen,  peekCWString,  peekCWStringLen,  newCWString, 
     newCWStringLen,  withCWString,  withCWStringLen
@@ -177,6 +178,42 @@ Convert a C byte, representing a Latin-1 character, to the corresponding
 \end{haddockdesc}
 \begin{haddockdesc}
 \item[\begin{tabular}{@{}l}
+castCharToCUChar\ ::\ Char\ ->\ CUChar
+\end{tabular}]\haddockbegindoc
+Convert a Haskell character to a C \haddocktt{unsigned\ char}.
+ This function is only safe on the first 256 characters.
+\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+castCUCharToChar\ ::\ CUChar\ ->\ Char
+\end{tabular}]\haddockbegindoc
+Convert a C \haddocktt{unsigned\ char}, representing a Latin-1 character, to
+ the corresponding Haskell character.
+\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+castCharToCSChar\ ::\ Char\ ->\ CSChar
+\end{tabular}]\haddockbegindoc
+Convert a Haskell character to a C \haddocktt{signed\ char}.
+ This function is only safe on the first 256 characters.
+\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
+castCSCharToChar\ ::\ CSChar\ ->\ Char
+\end{tabular}]\haddockbegindoc
+Convert a C \haddocktt{signed\ char}, representing a Latin-1 character, to the
+ corresponding Haskell character.
+\par
+
+\end{haddockdesc}
+\begin{haddockdesc}
+\item[\begin{tabular}{@{}l}
 peekCAString\ ::\ CString\ ->\ IO\ String
 \end{tabular}]\haddockbegindoc
 Marshal a NUL terminated C string into a Haskell string.