diff --git a/basis/core-foundation/attributed-strings/attributed-strings-tests.factor b/basis/core-foundation/attributed-strings/attributed-strings-tests.factor new file mode 100644 index 0000000000..b1b6c5e2c5 --- /dev/null +++ b/basis/core-foundation/attributed-strings/attributed-strings-tests.factor @@ -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" { } CFRelease ] unit-test \ No newline at end of file diff --git a/basis/core-foundation/attributed-strings/attributed-strings.factor b/basis/core-foundation/attributed-strings/attributed-strings.factor new file mode 100644 index 0000000000..16acfdd74e --- /dev/null +++ b/basis/core-foundation/attributed-strings/attributed-strings.factor @@ -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 +) ; + +: ( string alist -- alien ) + [ ] [ ] bi* + [ [ kCFAllocatorDefault ] 2dip CFAttributedStringCreate ] + [ [ CFRelease ] bi@ ] + 2bi ; \ No newline at end of file diff --git a/basis/core-foundation/attributed-strings/authors.txt b/basis/core-foundation/attributed-strings/authors.txt new file mode 100644 index 0000000000..d4f5d6b3ae --- /dev/null +++ b/basis/core-foundation/attributed-strings/authors.txt @@ -0,0 +1 @@ +Slava Pestov \ No newline at end of file