diff options
author | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-31 12:23:26 +0200 |
---|---|---|
committer | Jaakko Keränen <jaakko.keranen@iki.fi> | 2021-10-31 12:23:26 +0200 |
commit | 98f5ab5aa00f4d6b83079e6ee4e228b401356198 (patch) | |
tree | 3760877ce19431b821b66ae8b43a9fecea201460 /res/bincat.c | |
parent | a7596f683456da5274ecb33d4043a9eb47858c99 (diff) |
Changed format of resources.lgr
Resources are now stored in a ZIP archive, and it comes with an explicit version number. All the old embed/bincat stuff was removed as unnecessary.
resources.lgr is also a valid fontpack, for loading the built-in fonts.
IssueID #363
Diffstat (limited to 'res/bincat.c')
-rw-r--r-- | res/bincat.c | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/res/bincat.c b/res/bincat.c deleted file mode 100644 index 8fc9d831..00000000 --- a/res/bincat.c +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | /* Copyright 2020 Jaakko Keränen <jaakko.keranen@iki.fi> | ||
2 | |||
3 | Redistribution and use in source and binary forms, with or without | ||
4 | modification, are permitted provided that the following conditions are met: | ||
5 | |||
6 | 1. Redistributions of source code must retain the above copyright notice, this | ||
7 | list of conditions and the following disclaimer. | ||
8 | 2. Redistributions in binary form must reproduce the above copyright notice, | ||
9 | this list of conditions and the following disclaimer in the documentation | ||
10 | and/or other materials provided with the distribution. | ||
11 | |||
12 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND | ||
13 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
14 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
15 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR | ||
16 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
17 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
18 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
19 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
20 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
21 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ | ||
22 | |||
23 | /* bincat.c: Tiny tool for concatenating binary files */ | ||
24 | |||
25 | #include <stdio.h> | ||
26 | #include <stdlib.h> | ||
27 | |||
28 | int main(int argc, char *argv[]) { | ||
29 | const size_t bufSize = 1024 * 256; | ||
30 | char *buf = malloc(bufSize); | ||
31 | FILE *out = fopen(argv[1], "wb"); | ||
32 | int i; | ||
33 | for (i = 2; i < argc; ++i) { | ||
34 | FILE *f = fopen(argv[i], "rb"); | ||
35 | size_t fileSize = 0; | ||
36 | for (;;) { | ||
37 | size_t num = fread(buf, 1, bufSize, f); | ||
38 | if (num <= 0) break; | ||
39 | fileSize += num; | ||
40 | fwrite(buf, 1, num, out); | ||
41 | } | ||
42 | fclose(f); | ||
43 | printf("%zu;", fileSize); | ||
44 | } | ||
45 | fclose(out); | ||
46 | free(buf); | ||
47 | return 0; | ||
48 | } | ||