]> gitweb.factorcode.org Git - factor.git/blob - basis/core-foundation/core-foundation.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / basis / core-foundation / core-foundation.factor
1 ! Copyright (C) 2006, 2008 Slava Pestov
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.syntax destructors accessors kernel ;
4 IN: core-foundation
5
6 TYPEDEF: void* CFTypeRef
7
8 TYPEDEF: void* CFAllocatorRef
9 : kCFAllocatorDefault f ; inline
10
11 TYPEDEF: bool Boolean
12 TYPEDEF: long CFIndex
13 TYPEDEF: int SInt32
14 TYPEDEF: uint UInt32
15 TYPEDEF: ulong CFTypeID
16 TYPEDEF: UInt32 CFOptionFlags
17 TYPEDEF: double CFTimeInterval
18 TYPEDEF: double CFAbsoluteTime
19
20 FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ;
21
22 FUNCTION: void CFRelease ( CFTypeRef cf ) ;
23
24 TUPLE: CFRelease-destructor alien disposed ;
25
26 M: CFRelease-destructor dispose* alien>> CFRelease ;
27
28 : &CFRelease ( alien -- alien )
29     dup f CFRelease-destructor boa &dispose drop ; inline
30
31 : |CFRelease ( alien -- alien )
32     dup f CFRelease-destructor boa |dispose drop ; inline