]> gitweb.factorcode.org Git - factor.git/blob - basis/core-foundation/attributed-strings/attributed-strings.factor
add USING:s and rearrange definitions so macosx can compile without parsing c-type...
[factor.git] / basis / core-foundation / attributed-strings / attributed-strings.factor
1 ! Copyright (C) 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.syntax kernel destructors
4 core-foundation core-foundation.dictionaries
5 core-foundation.strings
6 core-foundation.utilities ;
7 IN: core-foundation.attributed-strings
8
9 TYPEDEF: void* CFAttributedStringRef
10
11 FUNCTION: CFAttributedStringRef CFAttributedStringCreate (
12    CFAllocatorRef alloc,
13    CFStringRef str,
14    CFDictionaryRef attributes
15 ) ;
16
17 : <CFAttributedString> ( string assoc -- alien )
18     [
19         [ >cf &CFRelease ] bi@
20         [ kCFAllocatorDefault ] 2dip CFAttributedStringCreate
21     ] with-destructors ;