Working on core-foundation.attributed-strings

db4
Slava Pestov 2009-01-16 19:02:50 -06:00
parent e1e01e5c8d
commit c0362a57db
3 changed files with 27 additions and 0 deletions

View File

@ -0,0 +1,7 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: tools.test core-foundation.attributed-strings
core-foundation ;
IN: core-foundation.attributed-strings.tests
[ ] [ "Hello world" { } <CFAttributedString> CFRelease ] unit-test

View File

@ -0,0 +1,19 @@
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: alien.syntax kernel core-foundation
core-foundation.strings core-foundation.dictionaries ;
IN: core-foundation.attributed-strings
TYPEDEF: void* CFAttributedStringRef
FUNCTION: CFAttributedStringRef CFAttributedStringCreate (
CFAllocatorRef alloc,
CFStringRef str,
CFDictionaryRef attributes
) ;
: <CFAttributedString> ( string alist -- alien )
[ <CFString> ] [ <CFDictionary> ] bi*
[ [ kCFAllocatorDefault ] 2dip CFAttributedStringCreate ]
[ [ CFRelease ] bi@ ]
2bi ;

View File

@ -0,0 +1 @@
Slava Pestov