summaryrefslogtreecommitdiffstats
path: root/lib/Foreign/C/String/Extra.hs
blob: a7b6dfeb37993e51b615e78ed79e9631a029f6f6 (plain)
1
2
3
4
5
6
7
8
9
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