Add missing file.
This commit is contained in:
parent
7473601172
commit
80bfbd17b7
11
build.lua
11
build.lua
|
@ -19,11 +19,12 @@ vars.plats = {
|
|||
"em22",
|
||||
}
|
||||
vars.plats_with_tests = {
|
||||
"linux68k",
|
||||
"linux386",
|
||||
"linuxppc",
|
||||
"linuxmips",
|
||||
"pc86",
|
||||
"cpm",
|
||||
-- "linux386",
|
||||
-- "linux68k",
|
||||
-- "linuxmips",
|
||||
-- "linuxppc",
|
||||
-- "pc86",
|
||||
}
|
||||
|
||||
local plat_packages = {}
|
||||
|
|
33
util/cmisc/objectify.c
Normal file
33
util/cmisc/objectify.c
Normal file
|
@ -0,0 +1,33 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
int main(int argc, const char* argv[])
|
||||
{
|
||||
size_t count = 0;
|
||||
|
||||
if (argc != 2)
|
||||
{
|
||||
fprintf(stderr, "syntax: objectify <symbol>\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
printf("#include <stdint.h>\n");
|
||||
printf("#include <unistd.h>\n");
|
||||
printf("const uint8_t %s_data[] = {", argv[1]);
|
||||
for (;;)
|
||||
{
|
||||
int c = getchar();
|
||||
if (c == -1)
|
||||
break;
|
||||
if ((count & 15) == 0)
|
||||
putchar('\n');
|
||||
printf("0x%02x, ", c);
|
||||
count++;
|
||||
}
|
||||
printf("\n};\n");
|
||||
printf("const size_t %s_len = %d;\n", argv[1], count);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue