|
#define | EMBCSV_FIELD_BUF_SIZE 16 |
| Field buffer size. Any fields at or over this limit will be truncated.
|
|
|
typedef struct EMBCSV_reader | EMBCSV_reader |
|
CSV parser designed for use in embedded environments.
CSV input is parsed character-by-character, allowing reading from unbuffered input sources.
If malloc is not available or desired, compile with EMBCSV_NO_MALLOC
set. The parser will then used a fixed-length buffer internally. This buffers size can be adjusted by setting EMBCSV_FIELD_BUF_SIZE at compilation. Any field exceeding this length will be truncated. The default size is 16. Note that fields will be at most EMBCSV_FIELD_BUF_SIZE - 1 characters due to the null-terminator.
EMBCSV_NO_MALLOC also changes the init function to accept an EMBCSV_reader to initialize rather than allocating a new one
◆ EMBCSV_result
Parser result type.
Enumerator |
---|
EMBCSV_INCOMPLETE | Parsing is incomplete. Parse more characters.
|
EMBCSV_FIELD | A field has been parsed.
|
EMBCSV_END_OF_ROW | A field has been parsed, and parsing has reached the end of a row.
|
EMBCSV_PARSE_ERROR | Syntax error found in input.
|
◆ EMBCSV_reader_init()
◆ EMBCSV_reader_init_full()
EMBCSV_reader * EMBCSV_reader_init_full |
( |
char | delimiter, |
|
|
char | quote, |
|
|
bool | lenient ) |
◆ EMBCSV_reader_parse_char()
Parse a character.
- Parameters
-
| c | Character to parse |
[out] | field_out | Pointer to string, in which will be stored:
|
- Returns
- Result of parsing as an EMBCSV_result