diff options
| author | Thomas Schmucker <ts@its1.de> | 2020-06-23 15:52:51 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2020-06-23 15:52:51 +0200 |
| commit | 0572a236e0f6813722186506c71e32fbc756859c (patch) | |
| tree | 888d5e8e42314f3e70bc084a0944a423fb9ffe05 | |
| parent | 8e747d67c7b53ba51da73ea172a5ea297edbfc52 (diff) | |
| download | libcsv-0572a236e0f6813722186506c71e32fbc756859c.tar.gz libcsv-0572a236e0f6813722186506c71e32fbc756859c.tar.bz2 libcsv-0572a236e0f6813722186506c71e32fbc756859c.zip | |
Erlaube Compile-Optionen für Feldtrenner und Feldbegrenzer
| -rw-r--r-- | csv.c | 11 |
1 files changed, 9 insertions, 2 deletions
| @@ -4,6 +4,13 @@ | |||
| 4 | #include <string.h> | 4 | #include <string.h> |
| 5 | #include "csv.h" | 5 | #include "csv.h" |
| 6 | 6 | ||
| 7 | #ifndef CSV_DEFAULT_DELIMITER | ||
| 8 | #define CSV_DEFAULT_DELIMITER '"' | ||
| 9 | #endif | ||
| 10 | |||
| 11 | #ifndef CSV_DEFAULT_SEPARATOR | ||
| 12 | #define CSV_DEFAULT_SEPARATOR ',' | ||
| 13 | #endif | ||
| 7 | 14 | ||
| 8 | /* === CSV-MEMORY Interface === */ | 15 | /* === CSV-MEMORY Interface === */ |
| 9 | 16 | ||
| @@ -35,8 +42,8 @@ csv_mem_free(void *ptr, size_t sz, void *cb_arg) | |||
| 35 | /* === CSV-OPTIONS Interface === */ | 42 | /* === CSV-OPTIONS Interface === */ |
| 36 | 43 | ||
| 37 | const csv_options_t csv_default_options = { | 44 | const csv_options_t csv_default_options = { |
| 38 | .field_delimiter = '"', | 45 | .field_delimiter = CSV_DEFAULT_DELIMITER, |
| 39 | .field_separator = ',', | 46 | .field_separator = CSV_DEFAULT_SEPARATOR, |
| 40 | .cb_error = NULL, | 47 | .cb_error = NULL, |
| 41 | .cb_allocate = csv_mem_allocate, | 48 | .cb_allocate = csv_mem_allocate, |
| 42 | .cb_reallocate = csv_mem_reallocate, | 49 | .cb_reallocate = csv_mem_reallocate, |
