1 ! Copyright (C) 2008 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.syntax kernel math sequences ;
4 IN: core-foundation.data
6 TYPEDEF: void* CFDataRef
7 TYPEDEF: void* CFSetRef
9 TYPEDEF: int CFPropertyListMutabilityOptions
10 CONSTANT: kCFPropertyListImmutable 0
11 CONSTANT: kCFPropertyListMutableContainers 1
12 CONSTANT: kCFPropertyListMutableContainersAndLeaves 2
14 FUNCTION: CFDataRef CFDataCreate ( CFAllocatorRef allocator, uchar* bytes, CFIndex length ) ;
16 FUNCTION: CFTypeID CFGetTypeID ( CFTypeRef cf ) ;
18 : <CFData> ( byte-array -- alien )
19 [ f ] dip dup length CFDataCreate ;