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