module Bindings.Libgit2.Submodule where
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
type C'git_submodule_update_t = CUInt
c'GIT_SUBMODULE_UPDATE_CHECKOUT = 0
c'GIT_SUBMODULE_UPDATE_CHECKOUT :: (Num a) => a
c'GIT_SUBMODULE_UPDATE_REBASE = 1
c'GIT_SUBMODULE_UPDATE_REBASE :: (Num a) => a
c'GIT_SUBMODULE_UPDATE_MERGE = 2
c'GIT_SUBMODULE_UPDATE_MERGE :: (Num a) => a
type C'git_submodule_ignore_t = CUInt
c'GIT_SUBMODULE_IGNORE_ALL = 0
c'GIT_SUBMODULE_IGNORE_ALL :: (Num a) => a
c'GIT_SUBMODULE_IGNORE_DIRTY = 1
c'GIT_SUBMODULE_IGNORE_DIRTY :: (Num a) => a
c'GIT_SUBMODULE_IGNORE_UNTRACKED = 2
c'GIT_SUBMODULE_IGNORE_UNTRACKED :: (Num a) => a
c'GIT_SUBMODULE_IGNORE_NONE = 3
c'GIT_SUBMODULE_IGNORE_NONE :: (Num a) => a
data C'git_submodule = C'git_submodule{
c'git_submodule'name :: CString,
c'git_submodule'path :: CString,
c'git_submodule'url :: CString,
c'git_submodule'oid :: C'git_oid,
c'git_submodule'update :: C'git_submodule_update_t,
c'git_submodule'ignore :: C'git_submodule_ignore_t,
c'git_submodule'fetch_recurse :: CInt,
c'git_submodule'refcount :: CInt
} deriving (Eq,Show)
p'git_submodule'name p = plusPtr p 0
p'git_submodule'name :: Ptr (C'git_submodule) -> Ptr (CString)
p'git_submodule'path p = plusPtr p 4
p'git_submodule'path :: Ptr (C'git_submodule) -> Ptr (CString)
p'git_submodule'url p = plusPtr p 8
p'git_submodule'url :: Ptr (C'git_submodule) -> Ptr (CString)
p'git_submodule'oid p = plusPtr p 12
p'git_submodule'oid :: Ptr (C'git_submodule) -> Ptr (C'git_oid)
p'git_submodule'update p = plusPtr p 32
p'git_submodule'update :: Ptr (C'git_submodule) -> Ptr (C'git_submodule_update_t)
p'git_submodule'ignore p = plusPtr p 36
p'git_submodule'ignore :: Ptr (C'git_submodule) -> Ptr (C'git_submodule_ignore_t)
p'git_submodule'fetch_recurse p = plusPtr p 40
p'git_submodule'fetch_recurse :: Ptr (C'git_submodule) -> Ptr (CInt)
p'git_submodule'refcount p = plusPtr p 44
p'git_submodule'refcount :: Ptr (C'git_submodule) -> Ptr (CInt)
instance Storable C'git_submodule where
sizeOf _ = 48
alignment _ = 4
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 4
v2 <- peekByteOff p 8
v3 <- peekByteOff p 12
v4 <- peekByteOff p 32
v5 <- peekByteOff p 36
v6 <- peekByteOff p 40
v7 <- peekByteOff p 44
return $ C'git_submodule v0 v1 v2 v3 v4 v5 v6 v7
poke p (C'git_submodule v0 v1 v2 v3 v4 v5 v6 v7) = do
pokeByteOff p 0 v0
pokeByteOff p 4 v1
pokeByteOff p 8 v2
pokeByteOff p 12 v3
pokeByteOff p 32 v4
pokeByteOff p 36 v5
pokeByteOff p 40 v6
pokeByteOff p 44 v7
return ()
type C'git_submodule_foreach_callback = FunPtr (CString -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_submodule_foreach_callback
:: (CString -> Ptr () -> IO CInt) -> IO C'git_submodule_foreach_callback
foreign import ccall "dynamic" mK'git_submodule_foreach_callback
:: C'git_submodule_foreach_callback -> (CString -> Ptr () -> IO CInt)
foreign import ccall "git_submodule_foreach" c'git_submodule_foreach
:: Ptr C'git_repository -> C'git_submodule_foreach_callback -> Ptr () -> IO (CInt)
foreign import ccall "&git_submodule_foreach" p'git_submodule_foreach
:: FunPtr (Ptr C'git_repository -> C'git_submodule_foreach_callback -> Ptr () -> IO (CInt))
foreign import ccall "git_submodule_lookup" c'git_submodule_lookup
:: Ptr (Ptr C'git_submodule) -> Ptr C'git_repository -> CString -> IO (CInt)
foreign import ccall "&git_submodule_lookup" p'git_submodule_lookup
:: FunPtr (Ptr (Ptr C'git_submodule) -> Ptr C'git_repository -> CString -> IO (CInt))