diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-04-09 13:08:27 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-04-25 12:26:33 +0200 |
commit | 333bdae9b44165297bfb7206b0bd0e6e02274ebc (patch) | |
tree | 48d7db99e6a8f69763c4fdc287eb706468ad9270 /scripts/hexdump.c | |
parent | 5be6d3c8cbf8aa8cd5120a0f7b5ae4c55428a3fa (diff) | |
download | mupdf-333bdae9b44165297bfb7206b0bd0e6e02274ebc.tar.xz |
Use objcopy to compile font resources.
Diffstat (limited to 'scripts/hexdump.c')
-rw-r--r-- | scripts/hexdump.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/scripts/hexdump.c b/scripts/hexdump.c index 3e35105d..20763e5e 100644 --- a/scripts/hexdump.c +++ b/scripts/hexdump.c @@ -4,7 +4,7 @@ #include <stdlib.h> #include <string.h> -static int zero, string; +static int string; static int hexdump(FILE *fo, FILE *fi) @@ -48,15 +48,9 @@ main(int argc, char **argv) return 1; } - zero = 0; string = 0; optind = 1; - if (!strcmp(argv[optind], "-0")) { - ++optind; - zero = 1; - } - if (!strcmp(argv[optind], "-s")) { ++optind; string = 1; @@ -106,19 +100,11 @@ main(int argc, char **argv) size = ftell(fi); fseek(fi, 0, SEEK_SET); - fprintf(fo, "const int fz_%s_size = %d;\n", filename, size + zero); - fprintf(fo, "const unsigned char fz_%s[] =", filename); + fprintf(fo, "const unsigned char _binary_%s_start[%d] =", filename, size); fprintf(fo, string ? "\n" : " {\n"); hexdump(fo, fi); - if (!zero) - { - fprintf(fo, string ? ";\n" : "};\n"); - } - else - { - /* zero-terminate so we can hexdump text files into C strings */ - fprintf(fo, string ? ";\n" : "0};\n"); - } + fprintf(fo, string ? ";\n" : "};\n"); + fprintf(fo, "const unsigned char _binary_%s_end;\n", filename); fclose(fi); } |