diff options
-rw-r--r-- | client.c | 2 | ||||
-rw-r--r-- | explore.html | 2 | ||||
-rw-r--r-- | image.c | 2 | ||||
-rw-r--r-- | merge.c | 20 | ||||
-rw-r--r-- | meta.c | 2 | ||||
-rw-r--r-- | png.h | 2 | ||||
-rw-r--r-- | server.c | 2 | ||||
-rw-r--r-- | torus.1 | 7 | ||||
-rw-r--r-- | torus.h | 2 |
9 files changed, 26 insertions, 15 deletions
diff --git a/client.c b/client.c index 787c56a..be43641 100644 --- a/client.c +++ b/client.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 C. McEnroe <june@causal.agency> +/* Copyright (C) 2018 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/explore.html b/explore.html index 0c930f5..84b4192 100644 --- a/explore.html +++ b/explore.html @@ -44,7 +44,7 @@ Code is available from <a href="https://git.causal.agency/torus">Causal Agency</a>. <script> - /* Copyright (C) 2019 C. McEnroe <june@causal.agency> + /* Copyright (C) 2019 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/image.c b/image.c index 89ba745..584eb4c 100644 --- a/image.c +++ b/image.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018, 2019 C. McEnroe <june@causal.agency> +/* Copyright (C) 2018, 2019 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/merge.c b/merge.c index 5db1a58..42ef2c1 100644 --- a/merge.c +++ b/merge.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 C. McEnroe <june@causal.agency> +/* Copyright (C) 2017 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by @@ -23,6 +23,7 @@ #include <stdio.h> #include <sysexits.h> #include <wchar.h> +#include <zlib.h> #include "torus.h" @@ -83,10 +84,10 @@ static void drawTile(int offsetY, const struct Tile *tile) { int main(int argc, char *argv[]) { if (argc != 4) return EX_USAGE; - FILE *fileA = fopen(argv[1], "r"); + gzFile fileA = gzopen(argv[1], "r"); if (!fileA) err(EX_NOINPUT, "%s", argv[1]); - FILE *fileB = fopen(argv[2], "r"); + gzFile fileB = gzopen(argv[2], "r"); if (!fileB) err(EX_NOINPUT, "%s", argv[2]); FILE *fileC = fopen(argv[3], "w"); @@ -94,13 +95,18 @@ int main(int argc, char *argv[]) { curse(); + int error; struct Tile tileA, tileB; for (;;) { - size_t countA = fread(&tileA, sizeof(tileA), 1, fileA); - if (ferror(fileA)) err(EX_IOERR, "%s", argv[1]); + size_t countA = gzfread(&tileA, sizeof(tileA), 1, fileA); + if (!countA && gzerror(fileA, &error)) { + errx(EX_IOERR, "%s: %s", argv[1], gzerror(fileA, &error)); + } - size_t countB = fread(&tileB, sizeof(tileB), 1, fileB); - if (ferror(fileB)) err(EX_IOERR, "%s", argv[2]); + size_t countB = gzfread(&tileB, sizeof(tileB), 1, fileB); + if (!countB && gzerror(fileB, &error)) { + errx(EX_IOERR, "%s: %s", argv[2], gzerror(fileB, &error)); + } if (!countA && !countB) break; if (!countA || !countB) errx(EX_DATAERR, "different size inputs"); diff --git a/meta.c b/meta.c index be2fd56..6e76647 100644 --- a/meta.c +++ b/meta.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 C. McEnroe <june@causal.agency> +/* Copyright (C) 2017 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/png.h b/png.h index 56ddb01..d5fd3f5 100644 --- a/png.h +++ b/png.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2018, 2019 C. McEnroe <june@causal.agency> +/* Copyright (C) 2018, 2019 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/server.c b/server.c index 450810e..3c26f09 100644 --- a/server.c +++ b/server.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2017, 2021 C. McEnroe <june@causal.agency> +/* Copyright (C) 2017, 2021 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by diff --git a/torus.1 b/torus.1 index 9bf4b52..ddf79a4 100644 --- a/torus.1 +++ b/torus.1 @@ -1,4 +1,4 @@ -.Dd September 20, 2021 +.Dd December 22, 2021 .Dt torus 1 .Os "Causal Agency" . @@ -82,6 +82,11 @@ and .Ar data2 into .Ar data3 . +.Ar data1 +and +.Ar data2 +may be compressed with +.Xr gzip 1 . Differing tiles are presented in a .Xr curses 3 interface diff --git a/torus.h b/torus.h index 4c62990..d5accf5 100644 --- a/torus.h +++ b/torus.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 C. McEnroe <june@causal.agency> +/* Copyright (C) 2017 June McEnroe <june@causal.agency> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by |