{-# LINE 1 "Bindings/Libgit2/Errors.hsc" #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# LINE 2 "Bindings/Libgit2/Errors.hsc" #-}

{-# LINE 3 "Bindings/Libgit2/Errors.hsc" #-}

{-# LINE 4 "Bindings/Libgit2/Errors.hsc" #-}
module Bindings.Libgit2.Errors 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

{-# LINE 7 "Bindings/Libgit2/Errors.hsc" #-}

import Bindings.Libgit2.Common
{- enum {
    GIT_OK = 0,
    GIT_ERROR = -1,
    GIT_ENOTFOUND = -3,
    GIT_EEXISTS = -4,
    GIT_EAMBIGUOUS = -5,
    GIT_EBUFS = -6,
    GIT_EUSER = -7,
    GIT_EBAREREPO = -8,
    GIT_EORPHANEDHEAD = -9,
    GIT_EUNMERGED = -10,
    GIT_ENONFASTFORWARD = -11,
    GIT_EINVALIDSPEC = -12,
    GIT_EMERGECONFLICT = -13,
    GIT_PASSTHROUGH = -30,
    GIT_ITEROVER = -31
}; -}
c'GIT_OK = 0
c'GIT_OK :: (Num a) => a

{-# LINE 27 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_ERROR = -1
c'GIT_ERROR :: (Num a) => a

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

{-# LINE 29 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EEXISTS = -4
c'GIT_EEXISTS :: (Num a) => a

{-# LINE 30 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EAMBIGUOUS = -5
c'GIT_EAMBIGUOUS :: (Num a) => a

{-# LINE 31 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EBUFS = -6
c'GIT_EBUFS :: (Num a) => a

{-# LINE 32 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EUSER = -7
c'GIT_EUSER :: (Num a) => a

{-# LINE 33 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EBAREREPO = -8
c'GIT_EBAREREPO :: (Num a) => a

{-# LINE 34 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EORPHANEDHEAD = -9
c'GIT_EORPHANEDHEAD :: (Num a) => a

{-# LINE 35 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EUNMERGED = -10
c'GIT_EUNMERGED :: (Num a) => a

{-# LINE 36 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_ENONFASTFORWARD = -11
c'GIT_ENONFASTFORWARD :: (Num a) => a

{-# LINE 37 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EINVALIDSPEC = -12
c'GIT_EINVALIDSPEC :: (Num a) => a

{-# LINE 38 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_EMERGECONFLICT = -13
c'GIT_EMERGECONFLICT :: (Num a) => a

{-# LINE 39 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_PASSTHROUGH = -30
c'GIT_PASSTHROUGH :: (Num a) => a

{-# LINE 40 "Bindings/Libgit2/Errors.hsc" #-}
c'GIT_ITEROVER = -31
c'GIT_ITEROVER :: (Num a) => a

{-# LINE 41 "Bindings/Libgit2/Errors.hsc" #-}
{- typedef struct {
            char * message; int klass;
        } git_error; -}

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

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

{-# LINE 47 "Bindings/Libgit2/Errors.hsc" #-}
data C'git_error = C'git_error{
  c'git_error'message :: CString,
  c'git_error'klass :: CInt
} deriving (Eq,Show)
p'git_error'message p = plusPtr p 0
p'git_error'message :: Ptr (C'git_error) -> Ptr (CString)
p'git_error'klass p = plusPtr p 8
p'git_error'klass :: Ptr (C'git_error) -> Ptr (CInt)
instance Storable C'git_error where
  sizeOf _ = 16
  alignment _ = 8
  peek p = do
    v0 <- peekByteOff p 0
    v1 <- peekByteOff p 8
    return $ C'git_error v0 v1
  poke p (C'git_error v0 v1) = do
    pokeByteOff p 0 v0
    pokeByteOff p 8 v1
    return ()

{-# LINE 48 "Bindings/Libgit2/Errors.hsc" #-}
{- typedef enum {
            GITERR_NOMEMORY,
            GITERR_OS,
            GITERR_INVALID,
            GITERR_REFERENCE,
            GITERR_ZLIB,
            GITERR_REPOSITORY,
            GITERR_CONFIG,
            GITERR_REGEX,
            GITERR_ODB,
            GITERR_INDEX,
            GITERR_OBJECT,
            GITERR_NET,
            GITERR_TAG,
            GITERR_TREE,
            GITERR_INDEXER,
            GITERR_SSL,
            GITERR_SUBMODULE,
            GITERR_THREAD,
            GITERR_STASH,
            GITERR_CHECKOUT,
            GITERR_FETCHHEAD,
            GITERR_MERGE
        } git_error_t; -}
type C'git_error_t = CUInt

{-# LINE 73 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_NOMEMORY = 0
c'GITERR_NOMEMORY :: (Num a) => a

{-# LINE 74 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_OS = 1
c'GITERR_OS :: (Num a) => a

{-# LINE 75 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_INVALID = 2
c'GITERR_INVALID :: (Num a) => a

{-# LINE 76 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_REFERENCE = 3
c'GITERR_REFERENCE :: (Num a) => a

{-# LINE 77 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_ZLIB = 4
c'GITERR_ZLIB :: (Num a) => a

{-# LINE 78 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_REPOSITORY = 5
c'GITERR_REPOSITORY :: (Num a) => a

{-# LINE 79 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_CONFIG = 6
c'GITERR_CONFIG :: (Num a) => a

{-# LINE 80 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_REGEX = 7
c'GITERR_REGEX :: (Num a) => a

{-# LINE 81 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_ODB = 8
c'GITERR_ODB :: (Num a) => a

{-# LINE 82 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_INDEX = 9
c'GITERR_INDEX :: (Num a) => a

{-# LINE 83 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_OBJECT = 10
c'GITERR_OBJECT :: (Num a) => a

{-# LINE 84 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_NET = 11
c'GITERR_NET :: (Num a) => a

{-# LINE 85 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_TAG = 12
c'GITERR_TAG :: (Num a) => a

{-# LINE 86 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_TREE = 13
c'GITERR_TREE :: (Num a) => a

{-# LINE 87 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_INDEXER = 14
c'GITERR_INDEXER :: (Num a) => a

{-# LINE 88 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_SSL = 15
c'GITERR_SSL :: (Num a) => a

{-# LINE 89 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_SUBMODULE = 16
c'GITERR_SUBMODULE :: (Num a) => a

{-# LINE 90 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_THREAD = 17
c'GITERR_THREAD :: (Num a) => a

{-# LINE 91 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_STASH = 18
c'GITERR_STASH :: (Num a) => a

{-# LINE 92 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_CHECKOUT = 19
c'GITERR_CHECKOUT :: (Num a) => a

{-# LINE 93 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_FETCHHEAD = 20
c'GITERR_FETCHHEAD :: (Num a) => a

{-# LINE 94 "Bindings/Libgit2/Errors.hsc" #-}
c'GITERR_MERGE = 21
c'GITERR_MERGE :: (Num a) => a

{-# LINE 95 "Bindings/Libgit2/Errors.hsc" #-}
foreign import ccall "giterr_last" c'giterr_last
  :: IO (Ptr C'git_error)
foreign import ccall "&giterr_last" p'giterr_last
  :: FunPtr (IO (Ptr C'git_error))

{-# LINE 96 "Bindings/Libgit2/Errors.hsc" #-}
foreign import ccall "giterr_clear" c'giterr_clear
  :: IO ()
foreign import ccall "&giterr_clear" p'giterr_clear
  :: FunPtr (IO ())

{-# LINE 97 "Bindings/Libgit2/Errors.hsc" #-}
foreign import ccall "giterr_set_str" c'giterr_set_str
  :: CInt -> CString -> IO ()
foreign import ccall "&giterr_set_str" p'giterr_set_str
  :: FunPtr (CInt -> CString -> IO ())

{-# LINE 98 "Bindings/Libgit2/Errors.hsc" #-}
foreign import ccall "giterr_set_oom" c'giterr_set_oom
  :: IO ()
foreign import ccall "&giterr_set_oom" p'giterr_set_oom
  :: FunPtr (IO ())

{-# LINE 99 "Bindings/Libgit2/Errors.hsc" #-}