{-# LINE 1 "Data/Rope/Internals.hsc" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LINE 2 "Data/Rope/Internals.hsc" #-}

module Data.Rope.Internals where

import Foreign.Ptr
import Foreign.ForeignPtr
import Foreign.Storable
import Foreign.C.Types
import Data.Word
import GHC.Base

foreign import ccall unsafe "sys/mman.h mmap" c_mmap::
  Ptr a->CSize->CInt->CInt->CInt->CInt->IO (Ptr Word8)

foreign import ccall unsafe "sys/mman.h munmap" c_munmap::
  Ptr a->CSize->IO()



{-# LINE 20 "Data/Rope/Internals.hsc" #-}

c_PROT_NONE::CInt
c_PROT_NONE= 0
{-# LINE 23 "Data/Rope/Internals.hsc" #-}
c_PROT_READ::CInt
c_PROT_READ= 1
{-# LINE 25 "Data/Rope/Internals.hsc" #-}
c_PROT_WRITE::CInt
c_PROT_WRITE= 2
{-# LINE 27 "Data/Rope/Internals.hsc" #-}
c_PROT_EXEC::CInt
c_PROT_EXEC= 4
{-# LINE 29 "Data/Rope/Internals.hsc" #-}

c_MAP_SHARED::CInt
c_MAP_SHARED= 1
{-# LINE 32 "Data/Rope/Internals.hsc" #-}

c_MAP_FILE::CInt
c_MAP_FILE= 0
{-# LINE 35 "Data/Rope/Internals.hsc" #-}


w2c::Word8->Char
w2c=unsafeChr.fromIntegral

c2w::Char->Word8
c2w=fromIntegral.ord