module Bindings.Libgit2.Notes 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.Oid
import Bindings.Libgit2.Types
foreign import ccall "git_note_read" c'git_note_read
:: Ptr (Ptr C'git_note) -> Ptr C'git_repository -> CString -> Ptr C'git_oid -> IO (CInt)
foreign import ccall "&git_note_read" p'git_note_read
:: FunPtr (Ptr (Ptr C'git_note) -> Ptr C'git_repository -> CString -> Ptr C'git_oid -> IO (CInt))
foreign import ccall "git_note_message" c'git_note_message
:: Ptr C'git_note -> IO (CString)
foreign import ccall "&git_note_message" p'git_note_message
:: FunPtr (Ptr C'git_note -> IO (CString))
foreign import ccall "git_note_oid" c'git_note_oid
:: Ptr C'git_note -> IO (Ptr C'git_oid)
foreign import ccall "&git_note_oid" p'git_note_oid
:: FunPtr (Ptr C'git_note -> IO (Ptr C'git_oid))
foreign import ccall "git_note_create" c'git_note_create
:: Ptr C'git_oid -> Ptr C'git_repository -> Ptr C'git_signature -> Ptr C'git_signature -> CString -> Ptr C'git_oid -> CString -> IO (CInt)
foreign import ccall "&git_note_create" p'git_note_create
:: FunPtr (Ptr C'git_oid -> Ptr C'git_repository -> Ptr C'git_signature -> Ptr C'git_signature -> CString -> Ptr C'git_oid -> CString -> IO (CInt))
foreign import ccall "git_note_remove" c'git_note_remove
:: Ptr C'git_repository -> CString -> Ptr C'git_signature -> Ptr C'git_signature -> Ptr C'git_oid -> IO (CInt)
foreign import ccall "&git_note_remove" p'git_note_remove
:: FunPtr (Ptr C'git_repository -> CString -> Ptr C'git_signature -> Ptr C'git_signature -> Ptr C'git_oid -> IO (CInt))
foreign import ccall "git_note_free" c'git_note_free
:: Ptr C'git_note -> IO ()
foreign import ccall "&git_note_free" p'git_note_free
:: FunPtr (Ptr C'git_note -> IO ())
foreign import ccall "git_note_default_ref" c'git_note_default_ref
:: Ptr (CString) -> Ptr C'git_repository -> IO (CInt)
foreign import ccall "&git_note_default_ref" p'git_note_default_ref
:: FunPtr (Ptr (CString) -> Ptr C'git_repository -> IO (CInt))
data C'git_note_data = C'git_note_data{
c'git_note_data'blob_oid :: C'git_oid,
c'git_note_data'annotated_object_oid :: C'git_oid
} deriving (Eq,Show)
p'git_note_data'blob_oid p = plusPtr p 0
p'git_note_data'blob_oid :: Ptr (C'git_note_data) -> Ptr (C'git_oid)
p'git_note_data'annotated_object_oid p = plusPtr p 20
p'git_note_data'annotated_object_oid :: Ptr (C'git_note_data) -> Ptr (C'git_oid)
instance Storable C'git_note_data where
sizeOf _ = 40
alignment _ = 1
peek p = do
v0 <- peekByteOff p 0
v1 <- peekByteOff p 20
return $ C'git_note_data v0 v1
poke p (C'git_note_data v0 v1) = do
pokeByteOff p 0 v0
pokeByteOff p 20 v1
return ()
type C'git_note_foreach_callback = FunPtr (Ptr C'git_note_data -> Ptr () -> IO CInt)
foreign import ccall "wrapper" mk'git_note_foreach_callback
:: (Ptr C'git_note_data -> Ptr () -> IO CInt) -> IO C'git_note_foreach_callback
foreign import ccall "dynamic" mK'git_note_foreach_callback
:: C'git_note_foreach_callback -> (Ptr C'git_note_data -> Ptr () -> IO CInt)
foreign import ccall "git_note_foreach" c'git_note_foreach
:: Ptr C'git_repository -> CString -> C'git_note_foreach_callback -> Ptr () -> IO (CInt)
foreign import ccall "&git_note_foreach" p'git_note_foreach
:: FunPtr (Ptr C'git_repository -> CString -> C'git_note_foreach_callback -> Ptr () -> IO (CInt))