diff options
author | Lua Team <team@lua.org> | 1999-07-08 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 1999-07-08 12:00:00 +0000 |
commit | afb67002d94ef22c14741910ba83da262a6e9338 (patch) | |
tree | b51ab3502813f590a4b115997f6fe41da43b6586 /etc/bin2c.c | |
parent | 377347776f1f3d820f92151f70bec667f96d5e6b (diff) | |
download | lua-github-3.2.tar.gz |
Lua 3.23.2
Diffstat (limited to 'etc/bin2c.c')
-rw-r--r-- | etc/bin2c.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/etc/bin2c.c b/etc/bin2c.c index 349b7eee..fca82a55 100644 --- a/etc/bin2c.c +++ b/etc/bin2c.c @@ -2,15 +2,16 @@ * bin2c.c * convert binary files to byte arrays * Luiz Henrique de Figueiredo (lhf@tecgraf.puc-rio.br) -* 25 Jun 98 10:55:12 +* 24 Nov 98 12:15:27 */ #include <ctype.h> #include <stdio.h> +#include <stdlib.h> void dump(FILE* f, int n) { - printf("static unsigned char B%d[]={\n"); + printf("static unsigned char B%d[]={\n",n); for (n=1;;n++) { int c=getc(f); @@ -49,6 +50,7 @@ void emit(char* fn, int n) int main(int argc, char* argv[]) { + printf("/* code automatically generated by bin2c -- DO NOT EDIT */\n"); printf("{\n"); if (argc<2) { @@ -58,6 +60,9 @@ int main(int argc, char* argv[]) else { int i; + printf("/* #include'ing this file in a C program is equivalent to calling\n"); + for (i=1; i<argc; i++) printf(" lua_dofile(\"%s\");\n",argv[i]); + printf("*/\n"); for (i=1; i<argc; i++) fdump(argv[i],i); for (i=1; i<argc; i++) emit(argv[i],i); } |