1 ! Copyright (C) 2005, 2010 Slava Pestov, Alex Chapman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors arrays alien alien.c-types alien.arrays
4 alien.strings kernel math namespaces parser sequences words
5 quotations math.parser splitting grouping effects assocs
6 combinators lexer strings.parser alien.parser fry vocabs.parser
7 words.constant alien.libraries ;
10 SYNTAX: DLL" lexer get skip-blank parse-string dlopen suffix! ;
12 SYNTAX: ALIEN: 16 scan-base <alien> suffix! ;
14 SYNTAX: BAD-ALIEN <bad-alien> suffix! ;
16 SYNTAX: LIBRARY: scan current-library set ;
19 (FUNCTION:) make-function define-declared ;
21 SYNTAX: FUNCTION-ALIAS:
23 (FUNCTION:) (make-function) define-declared ;
26 (CALLBACK:) define-inline ;
29 scan-c-type CREATE-C-TYPE dup save-location typedef ;
34 [ (CREATE-C-TYPE) dup save-location int swap typedef ] if
35 0 parse-enum-members ;
38 void CREATE-C-TYPE typedef ;
41 scan current-library get '[ _ _ address-of ] append! ;
43 SYNTAX: C-GLOBAL: scan-c-type CREATE-WORD define-global ;
46 scan-c-type <pointer> suffix! ;