{-# LINE 1 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 2 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 3 "Bindings/Libgit2/Submodule.hsc" #-}
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

{-# LINE 5 "Bindings/Libgit2/Submodule.hsc" #-}

import Bindings.Libgit2.Common
import Bindings.Libgit2.Types
import Bindings.Libgit2.Oid
{- typedef enum {
            GIT_SUBMODULE_UPDATE_CHECKOUT = 0,
            GIT_SUBMODULE_UPDATE_REBASE = 1,
            GIT_SUBMODULE_UPDATE_MERGE = 2
        } git_submodule_update_t; -}
type C'git_submodule_update_t = CUInt

{-# LINE 15 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_UPDATE_CHECKOUT = 0
c'GIT_SUBMODULE_UPDATE_CHECKOUT :: (Num a) => a

{-# LINE 16 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_UPDATE_REBASE = 1
c'GIT_SUBMODULE_UPDATE_REBASE :: (Num a) => a

{-# LINE 17 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_UPDATE_MERGE = 2
c'GIT_SUBMODULE_UPDATE_MERGE :: (Num a) => a

{-# LINE 18 "Bindings/Libgit2/Submodule.hsc" #-}
{- typedef enum {
            GIT_SUBMODULE_IGNORE_ALL = 0,
            GIT_SUBMODULE_IGNORE_DIRTY = 1,
            GIT_SUBMODULE_IGNORE_UNTRACKED = 2,
            GIT_SUBMODULE_IGNORE_NONE = 3
        } git_submodule_ignore_t; -}
type C'git_submodule_ignore_t = CUInt

{-# LINE 25 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_IGNORE_ALL = 0
c'GIT_SUBMODULE_IGNORE_ALL :: (Num a) => a

{-# LINE 26 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_IGNORE_DIRTY = 1
c'GIT_SUBMODULE_IGNORE_DIRTY :: (Num a) => a

{-# LINE 27 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_IGNORE_UNTRACKED = 2
c'GIT_SUBMODULE_IGNORE_UNTRACKED :: (Num a) => a

{-# LINE 28 "Bindings/Libgit2/Submodule.hsc" #-}
c'GIT_SUBMODULE_IGNORE_NONE = 3
c'GIT_SUBMODULE_IGNORE_NONE :: (Num a) => a

{-# LINE 29 "Bindings/Libgit2/Submodule.hsc" #-}
{- typedef struct {
            char * name;
            char * path;
            char * url;
            git_oid oid;
            git_submodule_update_t update;
            git_submodule_ignore_t ignore;
            int fetch_recurse;
            int refcount;
        } git_submodule; -}

{-# LINE 40 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 41 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 42 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 43 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 44 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 45 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 46 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 47 "Bindings/Libgit2/Submodule.hsc" #-}

{-# LINE 48 "Bindings/Libgit2/Submodule.hsc" #-}
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 ()

{-# LINE 49 "Bindings/Libgit2/Submodule.hsc" #-}
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)

{-# LINE 50 "Bindings/Libgit2/Submodule.hsc" #-}
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))

{-# LINE 51 "Bindings/Libgit2/Submodule.hsc" #-}
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))

{-# LINE 52 "Bindings/Libgit2/Submodule.hsc" #-}