From 60fa809ad072f953c097fb8f855bbf4e616c756f Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Sun, 21 Jun 2020 11:30:55 +0200 Subject: s/csv_error/csv_err/ --- csv-test.c | 4 ++-- csv.c | 10 +++++----- csv.h | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/csv-test.c b/csv-test.c index d14d6c2..eadcf53 100644 --- a/csv-test.c +++ b/csv-test.c @@ -61,9 +61,9 @@ test_exception_with_signal(FILE *f) } static void -my_error_handler(csv_error_t csv_error, void *env) +my_error_handler(csv_err_t csv_err, void *env) { - fprintf(stderr, "my_error_handler: %s\n", csv_err_str(csv_error)); + fprintf(stderr, "my_error_handler: %s\n", csv_err_str(csv_err)); longjmp(*((jmp_buf *) env), 1); } diff --git a/csv.c b/csv.c index 9c3f895..e36e3ba 100644 --- a/csv.c +++ b/csv.c @@ -47,13 +47,13 @@ const csv_options_t csv_default_options = { /* === CSV-ERROR Interface === */ INLINE void -csv_fatal_error(csv_error_t csv_error, const csv_options_t * const csv_options) +csv_fatal_error(csv_err_t csv_err, const csv_options_t * const csv_options) { if ( csv_options->cb_error != NULL ) { - (*csv_options->cb_error)(csv_error, csv_options->cb_error_arg); + (*csv_options->cb_error)(csv_err, csv_options->cb_error_arg); } - fprintf(stderr, "fatal error: %s\n", csv_err_str(csv_error)); + fprintf(stderr, "fatal error: %s\n", csv_err_str(csv_err)); abort(); } @@ -418,9 +418,9 @@ csv_read(csv_t *csv, FILE *in) } const char * -csv_err_str(csv_error_t csv_error) +csv_err_str(csv_err_t csv_err) { - switch ( csv_error ) { + switch ( csv_err ) { case CSV_ERR_OK: return "no error"; case CSV_ERR_OUT_OF_MEMORY: return "out of memory"; case CSV_ERR_OUT_OF_RANGE: return "index out of range"; diff --git a/csv.h b/csv.h index a8be413..9fcfa55 100644 --- a/csv.h +++ b/csv.h @@ -14,13 +14,13 @@ typedef enum { CSV_ERR_OUT_OF_RANGE = -2, CSV_ERR_IO_READ = -3, CSV_ERR_IO_WRITE = -4 -} csv_error_t; +} csv_err_t; typedef struct { char quote_symbol; char sep_symbol; - void (*cb_error)(csv_error_t, void *); + void (*cb_error)(csv_err_t, void *); void *cb_error_arg; void *(*cb_allocate)(size_t, size_t, void *); @@ -53,7 +53,7 @@ void csv_cleanup(csv_t *csv); int csv_nfields(csv_t *csv); const char * csv_field(csv_t *csv, int idx); int csv_read(csv_t *csv, FILE *in); -const char * csv_err_str(csv_error_t csv_error); +const char * csv_err_str(csv_err_t csv_err); void csv_write(FILE *out, int n, const char *fields[], const csv_options_t * const csv_options); #ifdef __cplusplus -- cgit v1.3