1 ! Copyright (C) 2008 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: alien.c-types alien.syntax core-foundation
4 core-foundation.urls kernel sequences ;
5 IN: core-foundation.bundles
7 TYPEDEF: void* CFBundleRef
9 FUNCTION: CFBundleRef CFBundleCreate ( CFAllocatorRef allocator, CFURLRef bundleURL )
11 FUNCTION: Boolean CFBundleLoadExecutable ( CFBundleRef bundle )
13 : <CFBundle> ( string -- bundle )
18 : load-framework ( name -- )
20 [ CFBundleLoadExecutable drop ]
21 [ "Cannot load bundle named " prepend throw ] ?if ;