From: PHO Date: Fri, 15 Oct 2010 15:34:15 +0000 (+0900) Subject: CFData.h X-Git-Url: https://git.cielonegro.org/gitweb.cgi?a=commitdiff_plain;h=a424d172b3c1c5150cb47a861cc2ff116680ce2a;p=bindings-CoreFoundation.git CFData.h --- diff --git a/Bindings/CoreFoundation/CFData.hsc b/Bindings/CoreFoundation/CFData.hsc new file mode 100644 index 0000000..473aec2 --- /dev/null +++ b/Bindings/CoreFoundation/CFData.hsc @@ -0,0 +1,26 @@ +#include +#include + +module Bindings.CoreFoundation.CFData where +#strict_import +import Bindings.CoreFoundation.CFBase + +#opaque_t __CFData +#synonym_t CFDataRef , Ptr <__CFData> +#synonym_t CFMutableDataRef, Ptr <__CFData> + +#ccall CFDataGetTypeID , IO +#ccall CFDataCreate , -> Ptr -> -> IO +#ccall CFDataCreateWithBytesNoCopy, -> Ptr -> -> -> IO +#ccall CFDataCreateCopy , -> -> IO +#ccall CFDataCreateMutable , -> -> IO +#ccall CFDataCreateMutableCopy , -> -> -> IO +#ccall CFDataGetLength , -> IO +#ccall CFDataGetBytePtr , -> IO (Ptr ) +#ccall CFDataGetMutableBytePtr , -> IO (Ptr ) +#cinline CFDataGetBytes , -> Ptr -> Ptr -> IO () +#ccall CFDataSetLength , -> -> IO () +#ccall CFDataIncreaseLength , -> -> IO () +#ccall CFDataAppendBytes , -> Ptr -> -> IO () +#cinline CFDataReplaceBytes , -> Ptr -> Ptr -> -> IO () +#cinline CFDataDeleteBytes , -> Ptr -> IO () diff --git a/bindings-CoreFoundation.cabal b/bindings-CoreFoundation.cabal index 21c84ce..6e0dda0 100644 --- a/bindings-CoreFoundation.cabal +++ b/bindings-CoreFoundation.cabal @@ -31,10 +31,12 @@ Library Exposed-Modules: Bindings.CoreFoundation.CFArray Bindings.CoreFoundation.CFBase + Bindings.CoreFoundation.CFData C-Sources: cbits/helper_CFArray.c cbits/helper_CFBase.c + cbits/helper_CFData.c Extensions: ForeignFunctionInterface diff --git a/cbits/helper_CFData.c b/cbits/helper_CFData.c new file mode 100644 index 0000000..1c1502d --- /dev/null +++ b/cbits/helper_CFData.c @@ -0,0 +1,20 @@ +#include +#include + +void +inline_CFDataGetBytes(CFDataRef theData, CFRange* range, UInt8 *buffer) { + return CFDataGetBytes(theData, *range, buffer); +} + +void +inline_CFDataReplaceBytes(CFMutableDataRef theData, + CFRange* range, + const UInt8 *newBytes, + CFIndex newLength) { + return CFDataReplaceBytes(theData, *range, newBytes, newLength); +} + +void +inline_CFDataDeleteBytes(CFMutableDataRef theData, CFRange* range) { + return CFDataDeleteBytes(theData, *range); +}