{-# LINE 1 "Bindings/Libgit2/Oid.hsc" #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LINE 2 "Bindings/Libgit2/Oid.hsc" #-}

{-# LINE 3 "Bindings/Libgit2/Oid.hsc" #-}

{-# LINE 4 "Bindings/Libgit2/Oid.hsc" #-}
module Bindings.Libgit2.Oid where
import Foreign.Ptr
import Foreign.Ptr (Ptr,FunPtr,plusPtr)
import Foreign.Ptr (wordPtrToPtr,castPtrToFunPtr)
import Foreign.Storable
import Foreign.C.Types
import Foreign.C.String (CString,CStringLen,CWString,CWStringLen)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Marshal.Array (peekArray,pokeArray)
import Data.Int
import Data.Word

{-# LINE 7 "Bindings/Libgit2/Oid.hsc" #-}

import Bindings.Libgit2.Common
import Bindings.Libgit2.Types
{- typedef struct git_oid {
            unsigned char id[20];
        } git_oid; -}

{-# LINE 14 "Bindings/Libgit2/Oid.hsc" #-}

{-# LINE 15 "Bindings/Libgit2/Oid.hsc" #-}
data C'git_oid = C'git_oid{
  c'git_oid'id :: [CUChar]
} deriving (Eq,Show)
p'git_oid'id p = plusPtr p 0
p'git_oid'id :: Ptr (C'git_oid) -> Ptr (CUChar)
instance Storable C'git_oid where
  sizeOf _ = 20
  alignment _ = 1
  peek p = do
    v0 <- let s = div 20 $ sizeOf $ (undefined :: CUChar) in peekArray s (plusPtr p 0)
    return $ C'git_oid v0
  poke p (C'git_oid v0) = do
    let s = div 20 $ sizeOf $ (undefined :: CUChar)
    pokeArray (plusPtr p 0) (take s v0)
    return ()

{-# LINE 16 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_fromstr" c'git_oid_fromstr
  :: Ptr C'git_oid -> CString -> IO (CInt)
foreign import ccall "&git_oid_fromstr" p'git_oid_fromstr
  :: FunPtr (Ptr C'git_oid -> CString -> IO (CInt))

{-# LINE 17 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_fromstrp" c'git_oid_fromstrp
  :: Ptr C'git_oid -> CString -> IO (CInt)
foreign import ccall "&git_oid_fromstrp" p'git_oid_fromstrp
  :: FunPtr (Ptr C'git_oid -> CString -> IO (CInt))

{-# LINE 18 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_fromstrn" c'git_oid_fromstrn
  :: Ptr C'git_oid -> CString -> CSize -> IO (CInt)
foreign import ccall "&git_oid_fromstrn" p'git_oid_fromstrn
  :: FunPtr (Ptr C'git_oid -> CString -> CSize -> IO (CInt))

{-# LINE 19 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_fromraw" c'git_oid_fromraw
  :: Ptr C'git_oid -> Ptr CUChar -> IO ()
foreign import ccall "&git_oid_fromraw" p'git_oid_fromraw
  :: FunPtr (Ptr C'git_oid -> Ptr CUChar -> IO ())

{-# LINE 20 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_fmt" c'git_oid_fmt
  :: CString -> Ptr C'git_oid -> IO ()
foreign import ccall "&git_oid_fmt" p'git_oid_fmt
  :: FunPtr (CString -> Ptr C'git_oid -> IO ())

{-# LINE 21 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_pathfmt" c'git_oid_pathfmt
  :: CString -> Ptr C'git_oid -> IO ()
foreign import ccall "&git_oid_pathfmt" p'git_oid_pathfmt
  :: FunPtr (CString -> Ptr C'git_oid -> IO ())

{-# LINE 22 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_allocfmt" c'git_oid_allocfmt
  :: Ptr C'git_oid -> IO (CString)
foreign import ccall "&git_oid_allocfmt" p'git_oid_allocfmt
  :: FunPtr (Ptr C'git_oid -> IO (CString))

{-# LINE 23 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_tostr" c'git_oid_tostr
  :: CString -> CSize -> Ptr C'git_oid -> IO (CString)
foreign import ccall "&git_oid_tostr" p'git_oid_tostr
  :: FunPtr (CString -> CSize -> Ptr C'git_oid -> IO (CString))

{-# LINE 24 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_cpy" c'git_oid_cpy
  :: Ptr C'git_oid -> Ptr C'git_oid -> IO ()
foreign import ccall "&git_oid_cpy" p'git_oid_cpy
  :: FunPtr (Ptr C'git_oid -> Ptr C'git_oid -> IO ())

{-# LINE 25 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "inline_git_oid_cmp" c'git_oid_cmp
  :: Ptr C'git_oid -> Ptr C'git_oid -> IO (CInt)

{-# LINE 26 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "inline_git_oid_equal" c'git_oid_equal
  :: Ptr C'git_oid -> Ptr C'git_oid -> IO (CInt)

{-# LINE 27 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_ncmp" c'git_oid_ncmp
  :: Ptr C'git_oid -> Ptr C'git_oid -> CSize -> IO (CInt)
foreign import ccall "&git_oid_ncmp" p'git_oid_ncmp
  :: FunPtr (Ptr C'git_oid -> Ptr C'git_oid -> CSize -> IO (CInt))

{-# LINE 28 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_streq" c'git_oid_streq
  :: Ptr C'git_oid -> CString -> IO (CInt)
foreign import ccall "&git_oid_streq" p'git_oid_streq
  :: FunPtr (Ptr C'git_oid -> CString -> IO (CInt))

{-# LINE 29 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_iszero" c'git_oid_iszero
  :: Ptr C'git_oid -> IO (CInt)
foreign import ccall "&git_oid_iszero" p'git_oid_iszero
  :: FunPtr (Ptr C'git_oid -> IO (CInt))

{-# LINE 30 "Bindings/Libgit2/Oid.hsc" #-}
{- typedef struct git_oid_shorten git_oid_shorten; -}
data C'git_oid_shorten = C'git_oid_shorten

{-# LINE 32 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_shorten_new" c'git_oid_shorten_new
  :: CSize -> IO (Ptr C'git_oid_shorten)
foreign import ccall "&git_oid_shorten_new" p'git_oid_shorten_new
  :: FunPtr (CSize -> IO (Ptr C'git_oid_shorten))

{-# LINE 33 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_shorten_add" c'git_oid_shorten_add
  :: Ptr C'git_oid_shorten -> CString -> IO (CInt)
foreign import ccall "&git_oid_shorten_add" p'git_oid_shorten_add
  :: FunPtr (Ptr C'git_oid_shorten -> CString -> IO (CInt))

{-# LINE 34 "Bindings/Libgit2/Oid.hsc" #-}
foreign import ccall "git_oid_shorten_free" c'git_oid_shorten_free
  :: Ptr C'git_oid_shorten -> IO ()
foreign import ccall "&git_oid_shorten_free" p'git_oid_shorten_free
  :: FunPtr (Ptr C'git_oid_shorten -> IO ())

{-# LINE 35 "Bindings/Libgit2/Oid.hsc" #-}