module Bindings.Libgit2.Remote 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.Repository
import Bindings.Libgit2.Refspec
import Bindings.Libgit2.Net
import Bindings.Libgit2.Indexer
import Bindings.Libgit2.Strarray
import Bindings.Libgit2.Transport
import Bindings.Libgit2.Types
import Bindings.Libgit2.Oid
type C'git_remote_rename_problem_cb = FunPtr (CString -> Ptr () -> Ptr CInt)
foreign import ccall "wrapper" mk'git_remote_rename_problem_cb
:: (CString -> Ptr () -> Ptr CInt) -> IO C'git_remote_rename_problem_cb
foreign import ccall "dynamic" mK'git_remote_rename_problem_cb
:: C'git_remote_rename_problem_cb -> (CString -> Ptr () -> Ptr CInt)
foreign import ccall "git_remote_create" c'git_remote_create
:: Ptr (Ptr C'git_remote) -> Ptr C'git_repository -> CString -> CString -> IO (CInt)
foreign import ccall "&git_remote_create" p'git_remote_create
:: FunPtr (Ptr (Ptr C'git_remote) -> Ptr C'git_repository -> CString -> CString -> IO (CInt))
foreign import ccall "git_remote_create_inmemory" c'git_remote_create_inmemory
:: Ptr (Ptr C'git_remote) -> Ptr C'git_repository -> CString -> CString -> IO (CInt)
foreign import ccall "&git_remote_create_inmemory" p'git_remote_create_inmemory
:: FunPtr (Ptr (Ptr C'git_remote) -> Ptr C'git_repository -> CString -> CString -> IO (CInt))
foreign import ccall "git_remote_load" c'git_remote_load
:: Ptr (Ptr C'git_remote) -> Ptr C'git_repository -> CString -> IO (CInt)
foreign import ccall "&git_remote_load" p'git_remote_load
:: FunPtr (Ptr (Ptr C'git_remote) -> Ptr C'git_repository -> CString -> IO (CInt))
foreign import ccall "git_remote_save" c'git_remote_save
:: Ptr C'git_remote -> IO (CInt)
foreign import ccall "&git_remote_save" p'git_remote_save
:: FunPtr (Ptr C'git_remote -> IO (CInt))
foreign import ccall "git_remote_name" c'git_remote_name
:: Ptr C'git_remote -> IO (CString)
foreign import ccall "&git_remote_name" p'git_remote_name
:: FunPtr (Ptr C'git_remote -> IO (CString))
foreign import ccall "git_remote_url" c'git_remote_url
:: Ptr C'git_remote -> IO (CString)
foreign import ccall "&git_remote_url" p'git_remote_url
:: FunPtr (Ptr C'git_remote -> IO (CString))
foreign import ccall "git_remote_pushurl" c'git_remote_pushurl
:: Ptr C'git_remote -> IO (CString)
foreign import ccall "&git_remote_pushurl" p'git_remote_pushurl
:: FunPtr (Ptr C'git_remote -> IO (CString))
foreign import ccall "git_remote_set_url" c'git_remote_set_url
:: Ptr C'git_remote -> CString -> IO (CInt)
foreign import ccall "&git_remote_set_url" p'git_remote_set_url
:: FunPtr (Ptr C'git_remote -> CString -> IO (CInt))
foreign import ccall "git_remote_set_pushurl" c'git_remote_set_pushurl
:: Ptr C'git_remote -> CString -> IO (CInt)
foreign import ccall "&git_remote_set_pushurl" p'git_remote_set_pushurl
:: FunPtr (Ptr C'git_remote -> CString -> IO (CInt))
foreign import ccall "git_remote_set_fetchspec" c'git_remote_set_fetchspec
:: Ptr C'git_remote -> CString -> IO (CInt)
foreign import ccall "&git_remote_set_fetchspec" p'git_remote_set_fetchspec
:: FunPtr (Ptr C'git_remote -> CString -> IO (CInt))
foreign import ccall "git_remote_fetchspec" c'git_remote_fetchspec
:: Ptr C'git_remote -> IO (Ptr C'git_refspec)
foreign import ccall "&git_remote_fetchspec" p'git_remote_fetchspec
:: FunPtr (Ptr C'git_remote -> IO (Ptr C'git_refspec))
foreign import ccall "git_remote_set_pushspec" c'git_remote_set_pushspec
:: Ptr C'git_remote -> CString -> IO (CInt)
foreign import ccall "&git_remote_set_pushspec" p'git_remote_set_pushspec
:: FunPtr (Ptr C'git_remote -> CString -> IO (CInt))
foreign import ccall "git_remote_pushspec" c'git_remote_pushspec
:: Ptr C'git_remote -> IO (Ptr C'git_refspec)
foreign import ccall "&git_remote_pushspec" p'git_remote_pushspec
:: FunPtr (Ptr C'git_remote -> IO (Ptr C'git_refspec))
foreign import ccall "git_remote_connect" c'git_remote_connect
:: Ptr C'git_remote -> C'git_direction -> IO (CInt)
foreign import ccall "&git_remote_connect" p'git_remote_connect
:: FunPtr (Ptr C'git_remote -> C'git_direction -> IO (CInt))
foreign import ccall "git_remote_ls" c'git_remote_ls
:: Ptr C'git_remote -> C'git_headlist_cb -> Ptr () -> IO (CInt)
foreign import ccall "&git_remote_ls" p'git_remote_ls
:: FunPtr (Ptr C'git_remote -> C'git_headlist_cb -> Ptr () -> IO (CInt))
foreign import ccall "git_remote_download" c'git_remote_download
:: Ptr C'git_remote -> C'git_transfer_progress_callback -> Ptr () -> IO (CInt)
foreign import ccall "&git_remote_download" p'git_remote_download
:: FunPtr (Ptr C'git_remote -> C'git_transfer_progress_callback -> Ptr () -> IO (CInt))
foreign import ccall "git_remote_connected" c'git_remote_connected
:: Ptr C'git_remote -> IO (CInt)
foreign import ccall "&git_remote_connected" p'git_remote_connected
:: FunPtr (Ptr C'git_remote -> IO (CInt))
foreign import ccall "git_remote_stop" c'git_remote_stop
:: Ptr C'git_remote -> IO ()
foreign import ccall "&git_remote_stop" p'git_remote_stop
:: FunPtr (Ptr C'git_remote -> IO ())
foreign import ccall "git_remote_disconnect" c'git_remote_disconnect
:: Ptr C'git_remote -> IO ()
foreign import ccall "&git_remote_disconnect" p'git_remote_disconnect
:: FunPtr (Ptr C'git_remote -> IO ())
foreign import ccall "git_remote_free" c'git_remote_free
:: Ptr C'git_remote -> IO ()
foreign import ccall "&git_remote_free" p'git_remote_free
:: FunPtr (Ptr C'git_remote -> IO ())
foreign import ccall "git_remote_update_tips" c'git_remote_update_tips
:: Ptr C'git_remote -> IO (CInt)
foreign import ccall "&git_remote_update_tips" p'git_remote_update_tips
:: FunPtr (Ptr C'git_remote -> IO (CInt))
foreign import ccall "git_remote_valid_url" c'git_remote_valid_url
:: CString -> IO (CInt)
foreign import ccall "&git_remote_valid_url" p'git_remote_valid_url
:: FunPtr (CString -> IO (CInt))
foreign import ccall "git_remote_supported_url" c'git_remote_supported_url
:: CString -> IO (CInt)
foreign import ccall "&git_remote_supported_url" p'git_remote_supported_url
:: FunPtr (CString -> IO (CInt))
foreign import ccall "git_remote_list" c'git_remote_list
:: Ptr C'git_strarray -> Ptr C'git_repository -> IO (CInt)
foreign import ccall "&git_remote_list" p'git_remote_list
:: FunPtr (Ptr C'git_strarray -> Ptr C'git_repository -> IO (CInt))
foreign import ccall "git_remote_check_cert" c'git_remote_check_cert
:: Ptr C'git_remote -> CInt -> IO ()
foreign import ccall "&git_remote_check_cert" p'git_remote_check_cert
:: FunPtr (Ptr C'git_remote -> CInt -> IO ())
foreign import ccall "git_remote_set_cred_acquire_cb" c'git_remote_set_cred_acquire_cb
:: Ptr C'git_remote -> C'git_cred_acquire_cb -> Ptr () -> IO ()
foreign import ccall "&git_remote_set_cred_acquire_cb" p'git_remote_set_cred_acquire_cb
:: FunPtr (Ptr C'git_remote -> C'git_cred_acquire_cb -> Ptr () -> IO ())
foreign import ccall "git_remote_set_transport" c'git_remote_set_transport
:: Ptr C'git_remote -> Ptr C'git_transport -> IO (CInt)
foreign import ccall "&git_remote_set_transport" p'git_remote_set_transport
:: FunPtr (Ptr C'git_remote -> Ptr C'git_transport -> IO (CInt))
type C'git_remote_completion_type = CUInt
c'GIT_REMOTE_COMPLETION_DOWNLOAD = 0
c'GIT_REMOTE_COMPLETION_DOWNLOAD :: (Num a) => a
c'GIT_REMOTE_COMPLETION_INDEXING = 1
c'GIT_REMOTE_COMPLETION_INDEXING :: (Num a) => a
c'GIT_REMOTE_COMPLETION_ERROR = 2
c'GIT_REMOTE_COMPLETION_ERROR :: (Num a) => a
type C'git_remote_callbacks_progress_callback = FunPtr (CString -> CInt -> Ptr () -> IO ())
foreign import ccall "wrapper" mk'git_remote_callbacks_progress_callback
:: (CString -> CInt -> Ptr () -> IO ()) -> IO C'git_remote_callbacks_progress_callback
foreign import ccall "dynamic" mK'git_remote_callbacks_progress_callback
:: C'git_remote_callbacks_progress_callback -> (CString -> CInt -> Ptr () -> IO ())
type C'git_remote_callbacks_completion_callback = FunPtr (C'git_remote_completion_type -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_remote_callbacks_completion_callback
:: (C'git_remote_completion_type -> Ptr () -> IO CInt) -> IO C'git_remote_callbacks_completion_callback
foreign import ccall "dynamic" mK'git_remote_callbacks_completion_callback
:: C'git_remote_callbacks_completion_callback -> (C'git_remote_completion_type -> Ptr () -> IO CInt)
type C'git_remote_callbacks_update_tips_callback = FunPtr (CString -> Ptr C'git_oid -> Ptr C'git_oid -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_remote_callbacks_update_tips_callback
:: (CString -> Ptr C'git_oid -> Ptr C'git_oid -> Ptr () -> IO CInt) -> IO C'git_remote_callbacks_update_tips_callback
foreign import ccall "dynamic" mK'git_remote_callbacks_update_tips_callback
:: C'git_remote_callbacks_update_tips_callback -> (CString -> Ptr C'git_oid -> Ptr C'git_oid -> Ptr () -> IO CInt)
data C'git_remote_callbacks = C'git_remote_callbacks{
c'git_remote_callbacks'version :: CUInt,
c'git_remote_callbacks'progress :: C'git_remote_callbacks_progress_callback,
c'git_remote_callbacks'completion :: C'git_remote_callbacks_completion_callback,
c'git_remote_callbacks'update_tips :: C'git_remote_callbacks_update_tips_callback,
c'git_remote_callbacks'payload :: Ptr ()
} deriving (Eq,Show)
p'git_remote_callbacks'version p = plusPtr p 0
p'git_remote_callbacks'version :: Ptr (C'git_remote_callbacks) -> Ptr (CUInt)
p'git_remote_callbacks'progress p = plusPtr p 4
p'git_remote_callbacks'progress :: Ptr (C'git_remote_callbacks) -> Ptr (C'git_remote_callbacks_progress_callback)
p'git_remote_callbacks'completion p = plusPtr p 8
p'git_remote_callbacks'completion :: Ptr (C'git_remote_callbacks) -> Ptr (C'git_remote_callbacks_completion_callback)
p'git_remote_callbacks'update_tips p = plusPtr p 12
p'git_remote_callbacks'update_tips :: Ptr (C'git_remote_callbacks) -> Ptr (C'git_remote_callbacks_update_tips_callback)
p'git_remote_callbacks'payload p = plusPtr p 16
p'git_remote_callbacks'payload :: Ptr (C'git_remote_callbacks) -> Ptr (Ptr ())
instance Storable C'git_remote_callbacks where
sizeOf _ = 20
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
v3 <- peekByteOff p 12
v4 <- peekByteOff p 16
return $ C'git_remote_callbacks v0 v1 v2 v3 v4
poke p (C'git_remote_callbacks v0 v1 v2 v3 v4) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
pokeByteOff p 12 v3
pokeByteOff p 16 v4
return ()
foreign import ccall "git_remote_set_callbacks" c'git_remote_set_callbacks
:: Ptr C'git_remote -> Ptr C'git_remote_callbacks -> IO (CInt)
foreign import ccall "&git_remote_set_callbacks" p'git_remote_set_callbacks
:: FunPtr (Ptr C'git_remote -> Ptr C'git_remote_callbacks -> IO (CInt))
foreign import ccall "git_remote_stats" c'git_remote_stats
:: Ptr C'git_remote -> IO (Ptr C'git_transfer_progress)
foreign import ccall "&git_remote_stats" p'git_remote_stats
:: FunPtr (Ptr C'git_remote -> IO (Ptr C'git_transfer_progress))
type C'git_remote_autotag_option_t = CUInt
c'GIT_REMOTE_DOWNLOAD_TAGS_UNSET = 0
c'GIT_REMOTE_DOWNLOAD_TAGS_UNSET :: (Num a) => a
c'GIT_REMOTE_DOWNLOAD_TAGS_NONE = 1
c'GIT_REMOTE_DOWNLOAD_TAGS_NONE :: (Num a) => a
c'GIT_REMOTE_DOWNLOAD_TAGS_AUTO = 2
c'GIT_REMOTE_DOWNLOAD_TAGS_AUTO :: (Num a) => a
c'GIT_REMOTE_DOWNLOAD_TAGS_ALL = 3
c'GIT_REMOTE_DOWNLOAD_TAGS_ALL :: (Num a) => a
foreign import ccall "git_remote_autotag" c'git_remote_autotag
:: Ptr C'git_remote -> IO (C'git_remote_autotag_option_t)
foreign import ccall "&git_remote_autotag" p'git_remote_autotag
:: FunPtr (Ptr C'git_remote -> IO (C'git_remote_autotag_option_t))
foreign import ccall "git_remote_set_autotag" c'git_remote_set_autotag
:: Ptr C'git_remote -> C'git_remote_autotag_option_t -> IO ()
foreign import ccall "&git_remote_set_autotag" p'git_remote_set_autotag
:: FunPtr (Ptr C'git_remote -> C'git_remote_autotag_option_t -> IO ())
foreign import ccall "git_remote_rename" c'git_remote_rename
:: Ptr C'git_remote -> CString -> C'git_remote_rename_problem_cb -> Ptr () -> IO (CInt)
foreign import ccall "&git_remote_rename" p'git_remote_rename
:: FunPtr (Ptr C'git_remote -> CString -> C'git_remote_rename_problem_cb -> Ptr () -> IO (CInt))
foreign import ccall "git_remote_update_fetchhead" c'git_remote_update_fetchhead
:: Ptr C'git_remote -> IO (CInt)
foreign import ccall "&git_remote_update_fetchhead" p'git_remote_update_fetchhead
:: FunPtr (Ptr C'git_remote -> IO (CInt))
foreign import ccall "git_remote_set_update_fetchhead" c'git_remote_set_update_fetchhead
:: Ptr C'git_remote -> CInt -> IO ()
foreign import ccall "&git_remote_set_update_fetchhead" p'git_remote_set_update_fetchhead
:: FunPtr (Ptr C'git_remote -> CInt -> IO ())
foreign import ccall "git_remote_is_valid_name" c'git_remote_is_valid_name
:: CString -> IO (CInt)
foreign import ccall "&git_remote_is_valid_name" p'git_remote_is_valid_name
:: FunPtr (CString -> IO (CInt))