diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-06-21 11:30:55 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-06-21 11:30:55 +0200 |
| commit | 60fa809ad072f953c097fb8f855bbf4e616c756f (patch) | |
| tree | 0f6a1cd763891932f29397471ef1c99d0ac9b01f | |
| parent | 1c5bb82c5e991d71e9ae5a6645c032f220131f5d (diff) | |
| download | libcsv-60fa809ad072f953c097fb8f855bbf4e616c756f.tar.gz libcsv-60fa809ad072f953c097fb8f855bbf4e616c756f.tar.bz2 libcsv-60fa809ad072f953c097fb8f855bbf4e616c756f.zip | |
s/csv_error/csv_err/
| -rw-r--r-- | csv-test.c | 4 | ||||
| -rw-r--r-- | csv.c | 10 | ||||
| -rw-r--r-- | csv.h | 6 |
3 files changed, 10 insertions, 10 deletions
| @@ -61,9 +61,9 @@ test_exception_with_signal(FILE *f) | |||
| 61 | } | 61 | } |
| 62 | 62 | ||
| 63 | static void | 63 | static void |
| 64 | my_error_handler(csv_error_t csv_error, void *env) | 64 | my_error_handler(csv_err_t csv_err, void *env) |
| 65 | { | 65 | { |
| 66 | fprintf(stderr, "my_error_handler: %s\n", csv_err_str(csv_error)); | 66 | fprintf(stderr, "my_error_handler: %s\n", csv_err_str(csv_err)); |
| 67 | longjmp(*((jmp_buf *) env), 1); | 67 | longjmp(*((jmp_buf *) env), 1); |
| 68 | } | 68 | } |
| 69 | 69 | ||
| @@ -47,13 +47,13 @@ const csv_options_t csv_default_options = { | |||
| 47 | /* === CSV-ERROR Interface === */ | 47 | /* === CSV-ERROR Interface === */ |
| 48 | 48 | ||
| 49 | INLINE void | 49 | INLINE void |
| 50 | csv_fatal_error(csv_error_t csv_error, const csv_options_t * const csv_options) | 50 | csv_fatal_error(csv_err_t csv_err, const csv_options_t * const csv_options) |
| 51 | { | 51 | { |
| 52 | if ( csv_options->cb_error != NULL ) { | 52 | if ( csv_options->cb_error != NULL ) { |
| 53 | (*csv_options->cb_error)(csv_error, csv_options->cb_error_arg); | 53 | (*csv_options->cb_error)(csv_err, csv_options->cb_error_arg); |
| 54 | } | 54 | } |
| 55 | 55 | ||
| 56 | fprintf(stderr, "fatal error: %s\n", csv_err_str(csv_error)); | 56 | fprintf(stderr, "fatal error: %s\n", csv_err_str(csv_err)); |
| 57 | abort(); | 57 | abort(); |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -418,9 +418,9 @@ csv_read(csv_t *csv, FILE *in) | |||
| 418 | } | 418 | } |
| 419 | 419 | ||
| 420 | const char * | 420 | const char * |
| 421 | csv_err_str(csv_error_t csv_error) | 421 | csv_err_str(csv_err_t csv_err) |
| 422 | { | 422 | { |
| 423 | switch ( csv_error ) { | 423 | switch ( csv_err ) { |
| 424 | case CSV_ERR_OK: return "no error"; | 424 | case CSV_ERR_OK: return "no error"; |
| 425 | case CSV_ERR_OUT_OF_MEMORY: return "out of memory"; | 425 | case CSV_ERR_OUT_OF_MEMORY: return "out of memory"; |
| 426 | case CSV_ERR_OUT_OF_RANGE: return "index out of range"; | 426 | case CSV_ERR_OUT_OF_RANGE: return "index out of range"; |
| @@ -14,13 +14,13 @@ typedef enum { | |||
| 14 | CSV_ERR_OUT_OF_RANGE = -2, | 14 | CSV_ERR_OUT_OF_RANGE = -2, |
| 15 | CSV_ERR_IO_READ = -3, | 15 | CSV_ERR_IO_READ = -3, |
| 16 | CSV_ERR_IO_WRITE = -4 | 16 | CSV_ERR_IO_WRITE = -4 |
| 17 | } csv_error_t; | 17 | } csv_err_t; |
| 18 | 18 | ||
| 19 | typedef struct { | 19 | typedef struct { |
| 20 | char quote_symbol; | 20 | char quote_symbol; |
| 21 | char sep_symbol; | 21 | char sep_symbol; |
| 22 | 22 | ||
| 23 | void (*cb_error)(csv_error_t, void *); | 23 | void (*cb_error)(csv_err_t, void *); |
| 24 | void *cb_error_arg; | 24 | void *cb_error_arg; |
| 25 | 25 | ||
| 26 | void *(*cb_allocate)(size_t, size_t, void *); | 26 | void *(*cb_allocate)(size_t, size_t, void *); |
| @@ -53,7 +53,7 @@ void csv_cleanup(csv_t *csv); | |||
| 53 | int csv_nfields(csv_t *csv); | 53 | int csv_nfields(csv_t *csv); |
| 54 | const char * csv_field(csv_t *csv, int idx); | 54 | const char * csv_field(csv_t *csv, int idx); |
| 55 | int csv_read(csv_t *csv, FILE *in); | 55 | int csv_read(csv_t *csv, FILE *in); |
| 56 | const char * csv_err_str(csv_error_t csv_error); | 56 | const char * csv_err_str(csv_err_t csv_err); |
| 57 | void csv_write(FILE *out, int n, const char *fields[], const csv_options_t * const csv_options); | 57 | void csv_write(FILE *out, int n, const char *fields[], const csv_options_t * const csv_options); |
| 58 | 58 | ||
| 59 | #ifdef __cplusplus | 59 | #ifdef __cplusplus |
