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

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

{-# LINE 3 "Bindings/Libgit2/Oid.hsc" #-}
module Bindings.Libgit2.Oid where
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 5 "Bindings/Libgit2/Oid.hsc" #-}

import Bindings.Libgit2.Common
import Bindings.Libgit2.Types
c'GIT_OID_RAWSZ = 20
c'GIT_OID_RAWSZ :: (Num a) => a

{-# LINE 9 "Bindings/Libgit2/Oid.hsc" #-}
c'GIT_OID_HEXSZ = 40
c'GIT_OID_HEXSZ :: (Num a) => a

{-# LINE 10 "Bindings/Libgit2/Oid.hsc" #-}
c'GIT_OID_MINPREFIXLEN = 4
c'GIT_OID_MINPREFIXLEN :: (Num a) => a

{-# LINE 11 "Bindings/Libgit2/Oid.hsc" #-}
{- struct _git_oid {
    unsigned char id[20];
}; -}

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

{-# LINE 16 "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 <- peekArray 20 (plusPtr p 0)
    return $ C'git_oid v0
  poke p (C'git_oid v0) = do
    pokeArray (plusPtr p 0) (take 20 v0)
    return ()

{-# LINE 17 "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 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 "git_oid_cmp" c'git_oid_cmp
  :: Ptr C'git_oid -> Ptr C'git_oid -> IO (CInt)
foreign import ccall "&git_oid_cmp" p'git_oid_cmp
  :: FunPtr (Ptr C'git_oid -> Ptr C'git_oid -> IO (CInt))

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

{-# LINE 27 "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 28 "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 29 "Bindings/Libgit2/Oid.hsc" #-}
{- typedef struct git_oid_shorten git_oid_shorten; -}
data C'git_oid_shorten = C'git_oid_shorten

{-# LINE 31 "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 32 "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 33 "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 34 "Bindings/Libgit2/Oid.hsc" #-}