USING: accessors alien.compile alien.libraries alien.parser arrays fry generalizations io.files io.files.info io.files.temp kernel lexer math.order multiline namespaces sequences system vocabs.loader vocabs.parser words ; IN: alien.c-syntax > ] bi@ <=> +lt+ = ] [ drop t ] if ; : compile-library ( -- ) "library-is-c++" get [ "C++" ] [ "C" ] if "c-compiler-args" get "c-library-vector" get "\n" join "c-library" get compile-to-library ; : (;C-LIBRARY) ( -- ) compile-library? [ compile-library ] when "c-library" get library-path "cdecl" add-library ; PRIVATE> SYNTAX: C-LIBRARY: (C-LIBRARY:) ; SYNTAX: COMPILE-AS-C++ t "library-is-c++" set ; SYNTAX: C-LINK: (C-LINK:) ; SYNTAX: C-FRAMEWORK: (C-FRAMEWORK:) ; SYNTAX: C-LINK/FRAMEWORK: os macosx? [ (C-FRAMEWORK:) ] [ (C-LINK:) ] if ; SYNTAX: C-INCLUDE: "#include " scan append "c-library-vector" get push ; SYNTAX: C-FUNCTION: return-library-function-params [ factor-function ] 4 nkeep (C-FUNCTION:) " {\n" append parse-here append "\n}\n" append "c-library-vector" get push ; SYNTAX: ;C-LIBRARY (;C-LIBRARY) ;