libansilove

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

commit 959b2f722556047d6fc53761380e229006fdb92e
parent 11605267e6b4445dbc79d0454c05f47acc1968b4
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun, 25 Oct 2020 14:49:37 +0100

Constify input and output arguments of ansilove_loadfile() and ansilove_savefile().

This removes the need to cast string literals when calling those functions from C++.

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

diff --git a/include/ansilove.h b/include/ansilove.h @@ -99,8 +99,8 @@ struct ansilove_options { ANSILOVE_EXTERN int ansilove_init(struct ansilove_ctx *, struct ansilove_options *); ANSILOVE_EXTERN char *ansilove_error(struct ansilove_ctx *); -ANSILOVE_EXTERN int ansilove_loadfile(struct ansilove_ctx *, char *); -ANSILOVE_EXTERN int ansilove_savefile(struct ansilove_ctx *, char *); +ANSILOVE_EXTERN int ansilove_loadfile(struct ansilove_ctx *, const char *); +ANSILOVE_EXTERN int ansilove_savefile(struct ansilove_ctx *, const char *); ANSILOVE_EXTERN int ansilove_clean(struct ansilove_ctx *); ANSILOVE_EXTERN int ansilove_ansi(struct ansilove_ctx *, struct ansilove_options *); diff --git a/src/loadfile.c b/src/loadfile.c @@ -18,7 +18,7 @@ #include "ansilove.h" int -ansilove_loadfile(struct ansilove_ctx *ctx, char *input) +ansilove_loadfile(struct ansilove_ctx *ctx, const char *input) { int fd; struct stat st; diff --git a/src/savefile.c b/src/savefile.c @@ -14,7 +14,7 @@ #include "ansilove.h" int -ansilove_savefile(struct ansilove_ctx *ctx, char *output) +ansilove_savefile(struct ansilove_ctx *ctx, const char *output) { size_t rw;