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
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)
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)
foreign import ccall "inline_git_tree_free" c'git_tree_free
:: Ptr C'git_tree -> IO ()
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))
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))
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))
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))
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))
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))
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))
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))
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 ())
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))
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))
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))
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))
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))
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))
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))
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 ())
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))
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 ())
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))
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))
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))
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)
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 ())
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))
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)
type C'git_treewalk_mode = CUInt
c'GIT_TREEWALK_PRE = 0
c'GIT_TREEWALK_PRE :: (Num a) => a
c'GIT_TREEWALK_POST = 1
c'GIT_TREEWALK_POST :: (Num a) => a
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))