factor/basis/core-foundation/attributed-strings/attributed-strings.factor

21 lines
630 B
Factor
Raw Normal View History

! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
2014-12-13 19:25:59 -05:00
USING: alien.c-types alien.syntax core-foundation
core-foundation.dictionaries core-foundation.strings
core-foundation.utilities destructors kernel ;
IN: core-foundation.attributed-strings
TYPEDEF: void* CFAttributedStringRef
FUNCTION: CFAttributedStringRef CFAttributedStringCreate (
CFAllocatorRef alloc,
CFStringRef str,
CFDictionaryRef attributes
)
: <CFAttributedString> ( string assoc -- alien )
[
[ >cf &CFRelease ] bi@
[ kCFAllocatorDefault ] 2dip CFAttributedStringCreate
] with-destructors ;