libansilove

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

commit 5ed4e0af04b14514686c680d3d85ff8cc71d9be1
parent 254d09375599455742b4e78e1be90c17fe6cd03c
Author: Frederic Cambus <fred@statdns.com>
Date:   Tue, 29 Sep 2020 16:23:06 +0200

Introduce the ANSILOVE_RANGE_ERROR macro, for values out of allowed range.

Diffstat:
Minclude/ansilove.h | 7++++---
Msrc/error.c | 3+++
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/include/ansilove.h b/include/ansilove.h @@ -30,9 +30,10 @@ #define ANSILOVE_INVALID_PARAM 1 #define ANSILOVE_FORMAT_ERROR 2 #define ANSILOVE_MEMORY_ERROR 3 -#define ANSILOVE_FILE_READ_ERROR 4 -#define ANSILOVE_FILE_WRITE_ERROR 5 -#define ANSILOVE_GD_ERROR 6 +#define ANSILOVE_RANGE_ERROR 4 +#define ANSILOVE_FILE_READ_ERROR 5 +#define ANSILOVE_FILE_WRITE_ERROR 6 +#define ANSILOVE_GD_ERROR 7 /* PC Fonts */ #define ANSILOVE_FONT_CP437 1 /* IBM PC 80x25 */ diff --git a/src/error.c b/src/error.c @@ -29,6 +29,9 @@ ansilove_error(struct ansilove_ctx *ctx) case ANSILOVE_MEMORY_ERROR: return "Memory allocation error."; break; + case ANSILOVE_RANGE_ERROR: + return "Value out of allowed range."; + break; case ANSILOVE_FILE_READ_ERROR: return "Error reading file."; break;