root/trunk/orca/boot_bin.r

Revision 1, 0.6 kB (checked in by krobillard, 3 years ago)

Import orca & thune.

Line 
1; Purpose: {Creates C include for boot script.}
2
3
4do %boot.r
5
6if exists? %func.r [ append boot load %func.r ]
7
8block_to_c: func [blk cvar /local str] [
9    blk: to-binary blk
10    ;probe blk
11    str: make string! 1024
12
13    append out rejoin ["static unsigned char " cvar "[] =^/{"]
14    forall blk [
15        if (15 and index? blk) = 1 [
16            append out "^/ "
17        ]
18        append out rejoin [{ } blk/1 {,}]
19    ]
20    remove back tail out
21    append out "^/};^/^/"
22]
23
24
25out: {// Automatically created by boot_bin.r^/^/#define BOOT_BYTECODE   1^/^/}
26
27block_to_c natives "_natives"
28block_to_c boot    "_boot"
29
30write %boot.c out
31
32
33;eof
Note: See TracBrowser for help on using the browser.