From 6bc072cd54a8d9efd81f6be16ef2a8d0dfa17ac2 Mon Sep 17 00:00:00 2001 From: Thomas Schmucker Date: Tue, 23 Jun 2020 17:28:46 +0200 Subject: code cleanup --- csv.c | 2 +- csv.h | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/csv.c b/csv.c index a155cb4..020a221 100644 --- a/csv.c +++ b/csv.c @@ -465,7 +465,7 @@ csv_write_field(FILE *out, const char *field, const csv_options_t * const csv_op } void -csv_write(FILE *out, int n, const char *fields[], const csv_options_t * csv_options) +csv_write_ex(FILE *out, int n, const char *fields[], const csv_options_t * csv_options) { assert(out != NULL); assert(fields != NULL); diff --git a/csv.h b/csv.h index 6542103..690df89 100644 --- a/csv.h +++ b/csv.h @@ -47,14 +47,26 @@ typedef struct { csv_field_t csv_field; } csv_t; +/* initialization */ void csv_init(csv_t *csv); void csv_init_opt(csv_t *csv, const csv_options_t * const csv_options); + +/* cleanup after error */ void csv_cleanup(csv_t *csv); + +/* read */ +int csv_read(csv_t *csv, FILE *in); + +/* field access */ int csv_nfields(csv_t *csv); const char * csv_field(csv_t *csv, int idx); -int csv_read(csv_t *csv, FILE *in); + +/* write */ +void csv_write(FILE *out, const csv_t * const csv); +void csv_write_ex(FILE *out, int n, const char *fields[], const csv_options_t * const csv_options); + +/* error handling */ 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