module Bindings.Libgit2.Net 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.Oid
import Bindings.Libgit2.Types
type C'git_direction = CUInt
c'GIT_DIRECTION_FETCH = 0
c'GIT_DIRECTION_FETCH :: (Num a) => a
c'GIT_DIRECTION_PUSH = 1
c'GIT_DIRECTION_PUSH :: (Num a) => a
data C'git_remote_head = C'git_remote_head{
c'git_remote_head'local :: CInt,
c'git_remote_head'oid :: C'git_oid,
c'git_remote_head'loid :: C'git_oid,
c'git_remote_head'name :: CString
} deriving (Eq,Show)
p'git_remote_head'local p = plusPtr p 0
p'git_remote_head'local :: Ptr (C'git_remote_head) -> Ptr (CInt)
p'git_remote_head'oid p = plusPtr p 4
p'git_remote_head'oid :: Ptr (C'git_remote_head) -> Ptr (C'git_oid)
p'git_remote_head'loid p = plusPtr p 24
p'git_remote_head'loid :: Ptr (C'git_remote_head) -> Ptr (C'git_oid)
p'git_remote_head'name p = plusPtr p 44
p'git_remote_head'name :: Ptr (C'git_remote_head) -> Ptr (CString)
instance Storable C'git_remote_head where
sizeOf _ = 48
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 24
v3 <- peekByteOff p 44
return $ C'git_remote_head v0 v1 v2 v3
poke p (C'git_remote_head v0 v1 v2 v3) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 24 v2
pokeByteOff p 44 v3
return ()
type C'git_headlist_cb = FunPtr (Ptr (C'git_remote_head) -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_headlist_cb
:: (Ptr (C'git_remote_head) -> Ptr () -> IO CInt) -> IO C'git_headlist_cb
foreign import ccall "dynamic" mK'git_headlist_cb
:: C'git_headlist_cb -> (Ptr (C'git_remote_head) -> Ptr () -> IO CInt)