]> gitweb @ CieloNegro.org - bindings-CoreFoundation.git/commitdiff
CFData.h
authorPHO <pho@cielonegro.org>
Fri, 15 Oct 2010 15:34:15 +0000 (00:34 +0900)
committerPHO <pho@cielonegro.org>
Fri, 15 Oct 2010 15:34:15 +0000 (00:34 +0900)
Bindings/CoreFoundation/CFData.hsc [new file with mode: 0644]
bindings-CoreFoundation.cabal
cbits/helper_CFData.c [new file with mode: 0644]

diff --git a/Bindings/CoreFoundation/CFData.hsc b/Bindings/CoreFoundation/CFData.hsc
new file mode 100644 (file)
index 0000000..473aec2
--- /dev/null
@@ -0,0 +1,26 @@
+#include <bindings.dsl.h>
+#include <CoreFoundation/CFData.h>
+
+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 <CFTypeID>
+#ccall   CFDataCreate               , <CFAllocatorRef> -> Ptr <UInt8> -> <CFIndex> -> IO <CFDataRef>
+#ccall   CFDataCreateWithBytesNoCopy, <CFAllocatorRef> -> Ptr <UInt8> -> <CFIndex> -> <CFAllocatorRef> -> IO <CFDataRef>
+#ccall   CFDataCreateCopy           , <CFAllocatorRef> -> <CFDataRef> -> IO <CFDataRef>
+#ccall   CFDataCreateMutable        , <CFAllocatorRef> -> <CFIndex> -> IO <CFMutableDataRef>
+#ccall   CFDataCreateMutableCopy    , <CFAllocatorRef> -> <CFIndex> -> <CFDataRef> -> IO <CFMutableDataRef>
+#ccall   CFDataGetLength            , <CFDataRef> -> IO <CFIndex>
+#ccall   CFDataGetBytePtr           , <CFDataRef> -> IO (Ptr <UInt8>)
+#ccall   CFDataGetMutableBytePtr    , <CFMutableDataRef> -> IO (Ptr <UInt8>)
+#cinline CFDataGetBytes             , <CFDataRef> -> Ptr <CFRange> -> Ptr <UInt8> -> IO ()
+#ccall   CFDataSetLength            , <CFMutableDataRef> -> <CFIndex> -> IO ()
+#ccall   CFDataIncreaseLength       , <CFMutableDataRef> -> <CFIndex> -> IO ()
+#ccall   CFDataAppendBytes          , <CFMutableDataRef> -> Ptr <UInt8> -> <CFIndex> -> IO ()
+#cinline CFDataReplaceBytes         , <CFMutableDataRef> -> Ptr <CFRange> -> Ptr <UInt8> -> <CFIndex> -> IO ()
+#cinline CFDataDeleteBytes          , <CFMutableDataRef> -> Ptr <CFRange> -> IO ()
index 21c84cedc62a57177814efab6137ed3efdfac0eb..6e0dda0223249e73da56ddb9b94a764c581693ff 100644 (file)
@@ -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 (file)
index 0000000..1c1502d
--- /dev/null
@@ -0,0 +1,20 @@
+#include <bindings.cmacros.h>
+#include <CoreFoundation/CFData.h>
+
+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);
+}