libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit f02c94100e4f33faf5f373d4286345598685613c
parent f63be4ec7e2f639e42e6b8a73e58c4545a3096b4
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 26 Oct 2018 18:33:52 +0200

Run include-what-you-use to remove unnecessary headers

Diffstat:
Msrc/clean.c | 8+++-----
Msrc/drawchar.c | 1+
Msrc/drawchar.h | 2+-
Msrc/error.c | 7++-----
Msrc/fonts.c | 2+-
Msrc/fonts.h | 2--
Msrc/init.c | 3++-
Msrc/loaders/ansi.c | 18+++++++++++++++++-
Msrc/loaders/artworx.c | 7++++++-
Msrc/loaders/binary.c | 9++++++++-
Msrc/loaders/icedraw.c | 8+++++++-
Msrc/loaders/pcboard.c | 9++++++++-
Msrc/loaders/tundra.c | 8+++++++-
Msrc/loaders/xbin.c | 10+++++++++-
Msrc/loadfile.c | 5+++--
Msrc/output.c | 3++-
Msrc/output.h | 5+++--
Msrc/savefile.c | 7++-----
18 files changed, 82 insertions(+), 32 deletions(-)

diff --git a/src/clean.c b/src/clean.c @@ -9,11 +9,9 @@ // See the LICENSE file for details. // -#include <fcntl.h> -#include <unistd.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include "ansilove.h" +#include <stddef.h> +#include "../include/ansilove.h" +#include "gd.h" int ansilove_clean(struct ansilove_ctx *ctx) { diff --git a/src/drawchar.c b/src/drawchar.c @@ -10,6 +10,7 @@ // #include "drawchar.h" +#include <gd.h> // shared method for drawing characters void drawchar(gdImagePtr im, const unsigned char *font_data, uint32_t bits, diff --git a/src/drawchar.h b/src/drawchar.h @@ -10,7 +10,7 @@ // #include <gd.h> -#include <stdint.h> +#include <sys/types.h> #ifndef drawchar_h #define drawchar_h diff --git a/src/error.c b/src/error.c @@ -9,11 +9,8 @@ // See the LICENSE file for details. // -#include <fcntl.h> -#include <unistd.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include "ansilove.h" +#include <stddef.h> +#include "../include/ansilove.h" char* ansilove_error(struct ansilove_ctx *ctx) { diff --git a/src/fonts.c b/src/fonts.c @@ -10,7 +10,7 @@ // #include "fonts.h" -#include "ansilove.h" +#include "../include/ansilove.h" void alSelectFont(struct fontStruct *fontData, int font) { switch(font) { diff --git a/src/fonts.h b/src/fonts.h @@ -11,8 +11,6 @@ #include <stdbool.h> #include <stdint.h> -#include <stdlib.h> -#include <string.h> #ifndef albinfonts_h #define albinfonts_h diff --git a/src/init.c b/src/init.c @@ -9,7 +9,8 @@ // See the LICENSE file for details. // -#include "ansilove.h" +#include <string.h> +#include "../include/ansilove.h" int ansilove_init(struct ansilove_ctx *ctx, struct ansilove_options *options) { diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -11,7 +11,23 @@ #define _XOPEN_SOURCE 700 #define _NETBSD_SOURCE -#include "../ansilove.h" + +#include <limits.h> +#include <math.h> +#include <stdbool.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include "../../include/ansilove.h" +#include "../config.h" +#include "../drawchar.h" +#include "../fonts.h" +#include "../output.h" +#include <gd.h> + +#ifndef HAVE_STRTONUM +#include "strtonum.h" +#endif #define ANSI_SEQUENCE_MAX_LENGTH 14 diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -9,7 +9,12 @@ // See the LICENSE file for details. // -#include "../ansilove.h" +#include <stddef.h> +#include <stdint.h> +#include "../../include/ansilove.h" +#include "../drawchar.h" +#include "../output.h" +#include <gd.h> #define ADF_HEADER_LENGTH 4289 /* 192 + 4096 + 1 */ diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -9,7 +9,14 @@ // See the LICENSE file for details. // -#include "../ansilove.h" +#include <stddef.h> +#include <stdint.h> +#include "../../include/ansilove.h" +#include "../config.h" +#include "../drawchar.h" +#include "../fonts.h" +#include "../output.h" +#include <gd.h> int ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) { diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -9,7 +9,13 @@ // See the LICENSE file for details. // -#include "../ansilove.h" +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include "../../include/ansilove.h" +#include "../drawchar.h" +#include "../output.h" +#include <gd.h> #define IDF_HEADER_LENGTH 4144 /* 4096 + 48 */ diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -9,7 +9,14 @@ // See the LICENSE file for details. // -#include "../ansilove.h" +#include <stdint.h> +#include <stdlib.h> +#include "../../include/ansilove.h" +#include "../config.h" +#include "../drawchar.h" +#include "../fonts.h" +#include "../output.h" +#include <gd.h> // Character structure struct pcbChar { diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c @@ -9,7 +9,13 @@ // See the LICENSE file for details. // -#include "../ansilove.h" +#include <stddef.h> +#include <stdint.h> +#include "../../include/ansilove.h" +#include "../drawchar.h" +#include "../fonts.h" +#include "../output.h" +#include <gd.h> #define TUNDRA_VERSION 24 diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -9,7 +9,15 @@ // See the LICENSE file for details. // -#include "../ansilove.h" +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include "../../include/ansilove.h" +#include "../config.h" +#include "../drawchar.h" +#include "../fonts.h" +#include "../output.h" +#include <gd.h> int ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) { diff --git a/src/loadfile.c b/src/loadfile.c @@ -10,10 +10,11 @@ // #include <fcntl.h> -#include <unistd.h> +#include <stddef.h> #include <sys/mman.h> #include <sys/stat.h> -#include "ansilove.h" +#include <unistd.h> +#include "../include/ansilove.h" int ansilove_loadfile(struct ansilove_ctx *ctx, char *input) { diff --git a/src/output.c b/src/output.c @@ -9,8 +9,9 @@ // See the LICENSE file for details. // -#include "ansilove.h" +#include <gd.h> #include "output.h" +#include "../include/ansilove.h" int output(struct ansilove_ctx *ctx, struct ansilove_options *options, gdImagePtr im_Source) { // XXX Error handling diff --git a/src/output.h b/src/output.h @@ -10,8 +10,9 @@ // #include <gd.h> -#include <stdbool.h> -#include <stdlib.h> + +struct ansilove_ctx; +struct ansilove_options; #ifndef output_h #define output_h diff --git a/src/savefile.c b/src/savefile.c @@ -9,11 +9,8 @@ // See the LICENSE file for details. // -#include <fcntl.h> -#include <unistd.h> -#include <sys/mman.h> -#include <sys/stat.h> -#include "ansilove.h" +#include <stdio.h> +#include "../include/ansilove.h" int ansilove_savefile(struct ansilove_ctx *ctx, char *output) {