module Bindings.Libgit2.Refs 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.Strarray
foreign import ccall "git_reference_lookup" c'git_reference_lookup
:: Ptr (Ptr C'git_reference) -> Ptr C'git_repository -> CString -> IO (CInt)
foreign import ccall "&git_reference_lookup" p'git_reference_lookup
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_repository -> CString -> IO (CInt))
foreign import ccall "git_reference_name_to_id" c'git_reference_name_to_id
:: Ptr C'git_oid -> Ptr C'git_repository -> CString -> IO (CInt)
foreign import ccall "&git_reference_name_to_id" p'git_reference_name_to_id
:: FunPtr (Ptr C'git_oid -> Ptr C'git_repository -> CString -> IO (CInt))
foreign import ccall "git_reference_symbolic_create" c'git_reference_symbolic_create
:: Ptr (Ptr C'git_reference) -> Ptr C'git_repository -> CString -> CString -> CInt -> IO (CInt)
foreign import ccall "&git_reference_symbolic_create" p'git_reference_symbolic_create
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_repository -> CString -> CString -> CInt -> IO (CInt))
foreign import ccall "git_reference_create" c'git_reference_create
:: Ptr (Ptr C'git_reference) -> Ptr C'git_repository -> CString -> Ptr C'git_oid -> CInt -> IO (CInt)
foreign import ccall "&git_reference_create" p'git_reference_create
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_repository -> CString -> Ptr C'git_oid -> CInt -> IO (CInt))
foreign import ccall "git_reference_target" c'git_reference_target
:: Ptr C'git_reference -> IO (Ptr C'git_oid)
foreign import ccall "&git_reference_target" p'git_reference_target
:: FunPtr (Ptr C'git_reference -> IO (Ptr C'git_oid))
foreign import ccall "git_reference_symbolic_target" c'git_reference_symbolic_target
:: Ptr C'git_reference -> IO (CString)
foreign import ccall "&git_reference_symbolic_target" p'git_reference_symbolic_target
:: FunPtr (Ptr C'git_reference -> IO (CString))
foreign import ccall "git_reference_type" c'git_reference_type
:: Ptr C'git_reference -> IO (C'git_ref_t)
foreign import ccall "&git_reference_type" p'git_reference_type
:: FunPtr (Ptr C'git_reference -> IO (C'git_ref_t))
foreign import ccall "git_reference_name" c'git_reference_name
:: Ptr C'git_reference -> IO (CString)
foreign import ccall "&git_reference_name" p'git_reference_name
:: FunPtr (Ptr C'git_reference -> IO (CString))
foreign import ccall "git_reference_resolve" c'git_reference_resolve
:: Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> IO (CInt)
foreign import ccall "&git_reference_resolve" p'git_reference_resolve
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> IO (CInt))
foreign import ccall "git_reference_owner" c'git_reference_owner
:: Ptr C'git_reference -> IO (Ptr C'git_repository)
foreign import ccall "&git_reference_owner" p'git_reference_owner
:: FunPtr (Ptr C'git_reference -> IO (Ptr C'git_repository))
foreign import ccall "git_reference_symbolic_set_target" c'git_reference_symbolic_set_target
:: Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> CString -> IO (CInt)
foreign import ccall "&git_reference_symbolic_set_target" p'git_reference_symbolic_set_target
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> CString -> IO (CInt))
foreign import ccall "git_reference_set_target" c'git_reference_set_target
:: Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> Ptr C'git_oid -> IO (CInt)
foreign import ccall "&git_reference_set_target" p'git_reference_set_target
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> Ptr C'git_oid -> IO (CInt))
foreign import ccall "git_reference_rename" c'git_reference_rename
:: Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> CString -> CInt -> IO (CInt)
foreign import ccall "&git_reference_rename" p'git_reference_rename
:: FunPtr (Ptr (Ptr C'git_reference) -> Ptr C'git_reference -> CString -> CInt -> IO (CInt))
foreign import ccall "git_reference_delete" c'git_reference_delete
:: Ptr C'git_reference -> IO (CInt)
foreign import ccall "&git_reference_delete" p'git_reference_delete
:: FunPtr (Ptr C'git_reference -> IO (CInt))
foreign import ccall "git_reference_list" c'git_reference_list
:: Ptr C'git_strarray -> Ptr C'git_repository -> CUInt -> IO (CInt)
foreign import ccall "&git_reference_list" p'git_reference_list
:: FunPtr (Ptr C'git_strarray -> Ptr C'git_repository -> CUInt -> IO (CInt))
type C'git_reference_foreach_cb = FunPtr (CString -> Ptr () -> Ptr CInt)
foreign import ccall "wrapper" mk'git_reference_foreach_cb
:: (CString -> Ptr () -> Ptr CInt) -> IO C'git_reference_foreach_cb
foreign import ccall "dynamic" mK'git_reference_foreach_cb
:: C'git_reference_foreach_cb -> (CString -> Ptr () -> Ptr CInt)
foreign import ccall "git_reference_foreach" c'git_reference_foreach
:: Ptr C'git_repository -> CUInt -> C'git_reference_foreach_cb -> Ptr () -> IO (CInt)
foreign import ccall "&git_reference_foreach" p'git_reference_foreach
:: FunPtr (Ptr C'git_repository -> CUInt -> C'git_reference_foreach_cb -> Ptr () -> IO (CInt))
foreign import ccall "git_reference_free" c'git_reference_free
:: Ptr C'git_reference -> IO ()
foreign import ccall "&git_reference_free" p'git_reference_free
:: FunPtr (Ptr C'git_reference -> IO ())
foreign import ccall "git_reference_cmp" c'git_reference_cmp
:: Ptr C'git_reference -> Ptr C'git_reference -> IO (CInt)
foreign import ccall "&git_reference_cmp" p'git_reference_cmp
:: FunPtr (Ptr C'git_reference -> Ptr C'git_reference -> IO (CInt))
foreign import ccall "git_reference_foreach_glob" c'git_reference_foreach_glob
:: Ptr C'git_repository -> CString -> CUInt -> C'git_reference_foreach_cb -> Ptr () -> IO (CInt)
foreign import ccall "&git_reference_foreach_glob" p'git_reference_foreach_glob
:: FunPtr (Ptr C'git_repository -> CString -> CUInt -> C'git_reference_foreach_cb -> Ptr () -> IO (CInt))
foreign import ccall "git_reference_has_log" c'git_reference_has_log
:: Ptr C'git_reference -> IO (CInt)
foreign import ccall "&git_reference_has_log" p'git_reference_has_log
:: FunPtr (Ptr C'git_reference -> IO (CInt))
foreign import ccall "git_reference_is_branch" c'git_reference_is_branch
:: Ptr C'git_reference -> IO (CInt)
foreign import ccall "&git_reference_is_branch" p'git_reference_is_branch
:: FunPtr (Ptr C'git_reference -> IO (CInt))
foreign import ccall "git_reference_is_remote" c'git_reference_is_remote
:: Ptr C'git_reference -> IO (CInt)
foreign import ccall "&git_reference_is_remote" p'git_reference_is_remote
:: FunPtr (Ptr C'git_reference -> IO (CInt))
type C'git_reference_normalize_t = CUInt
c'GIT_REF_FORMAT_NORMAL = 0
c'GIT_REF_FORMAT_NORMAL :: (Num a) => a
c'GIT_REF_FORMAT_ALLOW_ONELEVEL = 1
c'GIT_REF_FORMAT_ALLOW_ONELEVEL :: (Num a) => a
c'GIT_REF_FORMAT_REFSPEC_PATTERN = 2
c'GIT_REF_FORMAT_REFSPEC_PATTERN :: (Num a) => a
foreign import ccall "git_reference_normalize_name" c'git_reference_normalize_name
:: CString -> CSize -> CString -> CUInt -> IO (CInt)
foreign import ccall "&git_reference_normalize_name" p'git_reference_normalize_name
:: FunPtr (CString -> CSize -> CString -> CUInt -> IO (CInt))
foreign import ccall "git_reference_peel" c'git_reference_peel
:: Ptr (Ptr C'git_object) -> Ptr C'git_reference -> C'git_otype -> IO (CInt)
foreign import ccall "&git_reference_peel" p'git_reference_peel
:: FunPtr (Ptr (Ptr C'git_object) -> Ptr C'git_reference -> C'git_otype -> IO (CInt))
foreign import ccall "git_reference_is_valid_name" c'git_reference_is_valid_name
:: CString -> IO (CInt)
foreign import ccall "&git_reference_is_valid_name" p'git_reference_is_valid_name
:: FunPtr (CString -> IO (CInt))