libansilove

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

commit 6b3130b4269c2808993bff7e02c252ac508a7fb5
parent 1c3e5c6c79a2fc840ef28b78f93a433ce3d2659e
Author: Frederic Cambus <fred@statdns.com>
Date:   Thu, 18 Oct 2018 10:22:43 +0200

Prefix the error macros with ANSILOVE_

Diffstat:
Minclude/ansilove.h | 8++++----
Msrc/loaders/ansi.c | 2+-
Msrc/loaders/artworx.c | 2+-
Msrc/loaders/binary.c | 2+-
Msrc/loaders/icedraw.c | 6+++---
Msrc/loaders/pcboard.c | 2+-
Msrc/loaders/tundra.c | 4++--
Msrc/loaders/xbin.c | 6+++---
8 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/include/ansilove.h b/include/ansilove.h @@ -16,10 +16,10 @@ #include <stddef.h> #include <stdint.h> -#define INVALID_PARAM 1 -#define FORMAT_ERROR 2 -#define MEMORY_ERROR 3 -#define GD_ERROR 4 +#define ANSILOVE_INVALID_PARAM 1 +#define ANSILOVE_FORMAT_ERROR 2 +#define ANSILOVE_MEMORY_ERROR 3 +#define ANSILOVE_GD_ERROR 4 struct ansilove_png { unsigned char *buffer; diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -437,7 +437,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -23,7 +23,7 @@ int ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) // error output if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -30,7 +30,7 @@ int ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) ((ctx->length / 2) / options->columns * fontData.height)); if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -50,7 +50,7 @@ int ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) if (idf_buffer != NULL) { idf_buffer = temp; } else { - ctx->error = MEMORY_ERROR; + ctx->error = ANSILOVE_MEMORY_ERROR; return -1; } @@ -65,7 +65,7 @@ int ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) if (idf_buffer != NULL) { idf_buffer = temp; } else { - ctx->error = MEMORY_ERROR; + ctx->error = ANSILOVE_MEMORY_ERROR; return -1; } @@ -82,7 +82,7 @@ int ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) // error output if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } gdImageColorAllocate(canvas, 0, 0, 0); diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -138,7 +138,7 @@ int ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) canvas = gdImageCreate(80 * options->bits, (rowMax)*fontData.height); if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c @@ -38,7 +38,7 @@ int ansilove_tundra(struct ansilove_ctx *ctx, struct ansilove_options *options) // need to add check for "TUNDRA24" string in the header if (tundra_version != TUNDRA_VERSION) { - ctx->error = FORMAT_ERROR; + ctx->error = ANSILOVE_FORMAT_ERROR; return -1; } @@ -94,7 +94,7 @@ int ansilove_tundra(struct ansilove_ctx *ctx, struct ansilove_options *options) canvas = gdImageCreateTrueColor(columns * options->bits, (row) * fontData.height); if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -17,7 +17,7 @@ int ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) unsigned char *font_data_xbin = NULL; if (strncmp((char *)ctx->buffer, "XBIN\x1a", 5) != 0) { - ctx->error = FORMAT_ERROR; + ctx->error = ANSILOVE_FORMAT_ERROR; return -1; } @@ -31,7 +31,7 @@ int ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) canvas = gdImageCreate(8 * xbin_width, xbin_fontsize * xbin_height); if (!canvas) { - ctx->error = GD_ERROR; + ctx->error = ANSILOVE_GD_ERROR; return -1; } @@ -70,7 +70,7 @@ int ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) // allocate memory to contain the XBin font font_data_xbin = (unsigned char *)malloc(xbin_fontsize * numchars); if (font_data_xbin == NULL) { - ctx->error = MEMORY_ERROR; + ctx->error = ANSILOVE_MEMORY_ERROR; return -1; } memcpy(font_data_xbin, ctx->buffer+offset, (xbin_fontsize * numchars));