summaryrefslogtreecommitdiffstats
path: root/lib/Foreign/C/String/Extra.hs
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Foreign/C/String/Extra.hs')
-rw-r--r--lib/Foreign/C/String/Extra.hs10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/Foreign/C/String/Extra.hs b/lib/Foreign/C/String/Extra.hs
new file mode 100644
index 0000000..a7b6dfe
--- /dev/null
+++ b/lib/Foreign/C/String/Extra.hs
@@ -0,0 +1,10 @@
+module Foreign.C.String.Extra where
+
+import Data.Word (Word8)
+import Foreign.C.String (castCCharToChar)
+import Foreign.C.Types (CChar)
+import qualified Data.Char as Char
+
+
+castCCharToWord8 :: CChar -> Word8
+castCCharToWord8 = fromIntegral . Char.ord . castCCharToChar