picrin/tools/mkeval.scm

26 lines
488 B
Scheme
Raw Normal View History

2017-03-23 09:47:55 -04:00
(for-each
2017-04-03 13:56:50 -04:00
display
`("#include \"picrin.h\"\n"
"#include \"picrin/extra.h\"\n"
"\n"
2017-04-22 22:56:41 -04:00
"#if PIC_USE_EVAL\n"
"static "))
2017-04-22 20:44:22 -04:00
(let loop ()
(let ((c (read-u8)))
(unless (eof-object? c)
(write-u8 c)
(loop))))
(for-each
display
`("#endif\n"
2017-04-03 13:56:50 -04:00
"\n"
"void\n"
2017-04-14 10:58:02 -04:00
"pic_init_eval(pic_state *PIC_UNUSED(pic))\n"
2017-04-03 13:56:50 -04:00
"{\n"
2017-04-04 06:00:37 -04:00
"#if PIC_USE_EVAL\n"
2017-04-22 22:56:41 -04:00
" pic_call(pic, pic_deserialize(pic, pic_blob_value(pic, eval_rom, sizeof eval_rom)), 0);\n"
2017-04-03 13:56:50 -04:00
"#endif\n"
"}\n"))