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.enums 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-inline ;
21 SYNTAX: FUNCTION-ALIAS:
22 scan-token create-function
23 (FUNCTION:) (make-function) define-inline ;
26 (CALLBACK:) define-inline ;
29 scan-c-type CREATE-C-TYPE dup save-location typedef ;
32 parse-enum (define-enum) ;
35 void CREATE-C-TYPE typedef ;
38 scan current-library get '[ _ _ address-of ] append! ;
40 SYNTAX: C-GLOBAL: scan-c-type CREATE-WORD define-global ;
43 scan-c-type <pointer> suffix! ;