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

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

{-# LINE 4 "Bindings/Libgit2/Tree.hsc" #-}

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

import Bindings.Libgit2.Common
import Bindings.Libgit2.Types
import Bindings.Libgit2.Oid
import Bindings.Libgit2.Object
foreign import ccall "inline_git_tree_lookup" c'git_tree_lookup
  :: Ptr (Ptr C'git_tree) -> Ptr C'git_repository -> Ptr C'git_oid -> IO (CInt)

{-# LINE 14 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "inline_git_tree_lookup_prefix" c'git_tree_lookup_prefix
  :: Ptr (Ptr C'git_tree) -> Ptr C'git_repository -> Ptr C'git_oid -> CSize -> IO (CInt)

{-# LINE 15 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "inline_git_tree_free" c'git_tree_free
  :: Ptr C'git_tree -> IO ()

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

{-# LINE 17 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_owner" c'git_tree_owner
  :: Ptr C'git_tree -> IO (Ptr C'git_repository)
foreign import ccall "&git_tree_owner" p'git_tree_owner
  :: FunPtr (Ptr C'git_tree -> IO (Ptr C'git_repository))

{-# LINE 18 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entrycount" c'git_tree_entrycount
  :: Ptr C'git_tree -> IO (CSize)
foreign import ccall "&git_tree_entrycount" p'git_tree_entrycount
  :: FunPtr (Ptr C'git_tree -> IO (CSize))

{-# LINE 19 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_byname" c'git_tree_entry_byname
  :: Ptr C'git_tree -> CString -> IO (Ptr C'git_tree_entry)
foreign import ccall "&git_tree_entry_byname" p'git_tree_entry_byname
  :: FunPtr (Ptr C'git_tree -> CString -> IO (Ptr C'git_tree_entry))

{-# LINE 20 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_byindex" c'git_tree_entry_byindex
  :: Ptr C'git_tree -> CSize -> IO (Ptr C'git_tree_entry)
foreign import ccall "&git_tree_entry_byindex" p'git_tree_entry_byindex
  :: FunPtr (Ptr C'git_tree -> CSize -> IO (Ptr C'git_tree_entry))

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

{-# LINE 22 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_bypath" c'git_tree_entry_bypath
  :: Ptr (Ptr C'git_tree_entry) -> Ptr C'git_tree -> CString -> IO (CInt)
foreign import ccall "&git_tree_entry_bypath" p'git_tree_entry_bypath
  :: FunPtr (Ptr (Ptr C'git_tree_entry) -> Ptr C'git_tree -> CString -> IO (CInt))

{-# LINE 23 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_dup" c'git_tree_entry_dup
  :: Ptr C'git_tree_entry -> IO (Ptr C'git_tree_entry)
foreign import ccall "&git_tree_entry_dup" p'git_tree_entry_dup
  :: FunPtr (Ptr C'git_tree_entry -> IO (Ptr C'git_tree_entry))

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

{-# LINE 25 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_name" c'git_tree_entry_name
  :: Ptr C'git_tree_entry -> IO (CString)
foreign import ccall "&git_tree_entry_name" p'git_tree_entry_name
  :: FunPtr (Ptr C'git_tree_entry -> IO (CString))

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

{-# LINE 27 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_type" c'git_tree_entry_type
  :: Ptr C'git_tree_entry -> IO (C'git_otype)
foreign import ccall "&git_tree_entry_type" p'git_tree_entry_type
  :: FunPtr (Ptr C'git_tree_entry -> IO (C'git_otype))

{-# LINE 28 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_filemode" c'git_tree_entry_filemode
  :: Ptr C'git_tree_entry -> IO (C'git_filemode_t)
foreign import ccall "&git_tree_entry_filemode" p'git_tree_entry_filemode
  :: FunPtr (Ptr C'git_tree_entry -> IO (C'git_filemode_t))

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

{-# LINE 30 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_entry_to_object" c'git_tree_entry_to_object
  :: Ptr (Ptr C'git_object) -> Ptr C'git_repository -> Ptr C'git_tree_entry -> IO (CInt)
foreign import ccall "&git_tree_entry_to_object" p'git_tree_entry_to_object
  :: FunPtr (Ptr (Ptr C'git_object) -> Ptr C'git_repository -> Ptr C'git_tree_entry -> IO (CInt))

{-# LINE 31 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_create" c'git_treebuilder_create
  :: Ptr (Ptr C'git_treebuilder) -> Ptr C'git_tree -> IO (CInt)
foreign import ccall "&git_treebuilder_create" p'git_treebuilder_create
  :: FunPtr (Ptr (Ptr C'git_treebuilder) -> Ptr C'git_tree -> IO (CInt))

{-# LINE 32 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_clear" c'git_treebuilder_clear
  :: Ptr C'git_treebuilder -> IO ()
foreign import ccall "&git_treebuilder_clear" p'git_treebuilder_clear
  :: FunPtr (Ptr C'git_treebuilder -> IO ())

{-# LINE 33 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_entrycount" c'git_treebuilder_entrycount
  :: Ptr C'git_treebuilder -> IO (CUInt)
foreign import ccall "&git_treebuilder_entrycount" p'git_treebuilder_entrycount
  :: FunPtr (Ptr C'git_treebuilder -> IO (CUInt))

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

{-# LINE 35 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_get" c'git_treebuilder_get
  :: Ptr C'git_treebuilder -> CString -> IO (Ptr C'git_tree_entry)
foreign import ccall "&git_treebuilder_get" p'git_treebuilder_get
  :: FunPtr (Ptr C'git_treebuilder -> CString -> IO (Ptr C'git_tree_entry))

{-# LINE 36 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_insert" c'git_treebuilder_insert
  :: Ptr (Ptr C'git_tree_entry) -> Ptr C'git_treebuilder -> CString -> Ptr C'git_oid -> C'git_filemode_t -> IO (CInt)
foreign import ccall "&git_treebuilder_insert" p'git_treebuilder_insert
  :: FunPtr (Ptr (Ptr C'git_tree_entry) -> Ptr C'git_treebuilder -> CString -> Ptr C'git_oid -> C'git_filemode_t -> IO (CInt))

{-# LINE 37 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_remove" c'git_treebuilder_remove
  :: Ptr C'git_treebuilder -> CString -> IO (CInt)
foreign import ccall "&git_treebuilder_remove" p'git_treebuilder_remove
  :: FunPtr (Ptr C'git_treebuilder -> CString -> IO (CInt))

{-# LINE 38 "Bindings/Libgit2/Tree.hsc" #-}
{- typedef int (* git_treebuilder_filter_cb)(const git_tree_entry * entry,
                                          void * payload); -}
type C'git_treebuilder_filter_cb = FunPtr (Ptr (C'git_tree_entry) -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_treebuilder_filter_cb
  :: (Ptr (C'git_tree_entry) -> Ptr () -> IO CInt) -> IO C'git_treebuilder_filter_cb
foreign import ccall "dynamic" mK'git_treebuilder_filter_cb
  :: C'git_treebuilder_filter_cb -> (Ptr (C'git_tree_entry) -> Ptr () -> IO CInt)

{-# LINE 41 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_filter" c'git_treebuilder_filter
  :: Ptr C'git_treebuilder -> C'git_treebuilder_filter_cb -> Ptr () -> IO ()
foreign import ccall "&git_treebuilder_filter" p'git_treebuilder_filter
  :: FunPtr (Ptr C'git_treebuilder -> C'git_treebuilder_filter_cb -> Ptr () -> IO ())

{-# LINE 42 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_treebuilder_write" c'git_treebuilder_write
  :: Ptr C'git_oid -> Ptr C'git_repository -> Ptr C'git_treebuilder -> IO (CInt)
foreign import ccall "&git_treebuilder_write" p'git_treebuilder_write
  :: FunPtr (Ptr C'git_oid -> Ptr C'git_repository -> Ptr C'git_treebuilder -> IO (CInt))

{-# LINE 43 "Bindings/Libgit2/Tree.hsc" #-}
{- typedef int (* git_treewalk_cb)(const char * root,
                                const git_tree_entry * entry,
                                void * payload); -}
type C'git_treewalk_cb = FunPtr (CString -> Ptr (C'git_tree_entry) -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_treewalk_cb
  :: (CString -> Ptr (C'git_tree_entry) -> Ptr () -> IO CInt) -> IO C'git_treewalk_cb
foreign import ccall "dynamic" mK'git_treewalk_cb
  :: C'git_treewalk_cb -> (CString -> Ptr (C'git_tree_entry) -> Ptr () -> IO CInt)

{-# LINE 47 "Bindings/Libgit2/Tree.hsc" #-}
{- typedef enum {
            GIT_TREEWALK_PRE = 0, GIT_TREEWALK_POST = 1
        } git_treewalk_mode; -}
type C'git_treewalk_mode = CUInt

{-# LINE 51 "Bindings/Libgit2/Tree.hsc" #-}
c'GIT_TREEWALK_PRE = 0
c'GIT_TREEWALK_PRE :: (Num a) => a

{-# LINE 52 "Bindings/Libgit2/Tree.hsc" #-}
c'GIT_TREEWALK_POST = 1
c'GIT_TREEWALK_POST :: (Num a) => a

{-# LINE 53 "Bindings/Libgit2/Tree.hsc" #-}
foreign import ccall "git_tree_walk" c'git_tree_walk
  :: Ptr C'git_tree -> C'git_treewalk_mode -> C'git_treewalk_cb -> Ptr () -> IO (CInt)
foreign import ccall "&git_tree_walk" p'git_tree_walk
  :: FunPtr (Ptr C'git_tree -> C'git_treewalk_mode -> C'git_treewalk_cb -> Ptr () -> IO (CInt))

{-# LINE 54 "Bindings/Libgit2/Tree.hsc" #-}