factor/basis/core-foundation/core-foundation.factor

31 lines
774 B
Factor
Raw Normal View History

2008-02-12 03:21:47 -05:00
! Copyright (C) 2006, 2008 Slava Pestov
2007-09-20 18:09:08 -04:00
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax destructors accessors kernel ;
2007-09-20 18:09:08 -04:00
IN: core-foundation
TYPEDEF: void* CFTypeRef
TYPEDEF: void* CFAllocatorRef
: kCFAllocatorDefault f ; inline
2008-02-12 03:21:47 -05:00
TYPEDEF: bool Boolean
TYPEDEF: long CFIndex
TYPEDEF: int SInt32
TYPEDEF: uint UInt32
TYPEDEF: ulong CFTypeID
TYPEDEF: UInt32 CFOptionFlags
2007-09-20 18:09:08 -04:00
FUNCTION: CFTypeRef CFRetain ( CFTypeRef cf ) ;
2007-09-20 18:09:08 -04:00
FUNCTION: void CFRelease ( CFTypeRef cf ) ;
TUPLE: CFRelease-destructor alien disposed ;
M: CFRelease-destructor dispose* alien>> CFRelease ;
: &CFRelease ( alien -- alien )
dup f CFRelease-destructor boa &dispose drop ; inline
: |CFRelease ( alien -- alien )
dup f CFRelease-destructor boa |dispose drop ; inline