; Purpose: {Creates C include for boot script.} do %boot.r if exists? %func.r [ append boot load %func.r ] block_to_c: func [blk cvar /local str] [ blk: to-binary blk ;probe blk str: make string! 1024 append out rejoin ["static unsigned char " cvar "[] =^/{"] forall blk [ if (15 and index? blk) = 1 [ append out "^/ " ] append out rejoin [{ } blk/1 {,}] ] remove back tail out append out "^/};^/^/" ] out: {// Automatically created by boot_bin.r^/^/#define BOOT_BYTECODE 1^/^/} block_to_c natives "_natives" block_to_c boot "_boot" write %boot.c out ;eof