53#ifndef EMBCSV_FIELD_BUF_SIZE
56#define EMBCSV_FIELD_BUF_SIZE 16
63 #ifndef EMBCSV_NO_MALLOC
100#ifndef EMBCSV_NO_MALLOC
void EMBCSV_reader_free(EMBCSV_reader *r)
Free an EMBCSV_reader.
EMBCSV_reader * EMBCSV_reader_init_full(char delimiter, char quote, bool lenient)
Create a new EMBCSV_reader.
EMBCSV_reader * EMBCSV_reader_init(void)
Create a new EMBCSV_reader with default settings.
EMBCSV_result
Parser result type.
Definition embcsv.h:93
#define EMBCSV_FIELD_BUF_SIZE
Field buffer size. Any fields at or over this limit will be truncated.
Definition embcsv.h:56
EMBCSV_result EMBCSV_reader_parse_char(EMBCSV_reader *r, int c, const char **field_out)
Parse a character.
@ EMBCSV_PARSE_ERROR
Syntax error found in input.
Definition embcsv.h:97
@ EMBCSV_END_OF_ROW
A field has been parsed, and parsing has reached the end of a row.
Definition embcsv.h:96
@ EMBCSV_FIELD
A field has been parsed.
Definition embcsv.h:95
@ EMBCSV_INCOMPLETE
Parsing is incomplete. Parse more characters.
Definition embcsv.h:94
size_t field_size
Field size.
Definition embcsv.h:69
size_t field_alloc
Field allocated size.
Definition embcsv.h:65
char delimiter
Delimiter character (default ',')
Definition embcsv.h:71
char * field
Field storage.
Definition embcsv.h:64
@ EMBCSV_STATE_DOUBLE_QUOTE
Checking for escaped quote character or end of quoted field.
Definition embcsv.h:81
@ EMBCSV_STATE_CONSUME_NEWLINES
Discarding any newline characters.
Definition embcsv.h:82
@ EMBCSV_STATE_READY
Ready to read a character into current field.
Definition embcsv.h:80
enum EMBCSV_reader::@1 state
Parsing states.
bool quoted
true if parsing a quoted field
Definition embcsv.h:75
bool lenient
true if parsing is at the end of a row
Definition embcsv.h:73
char quote
Quote character (default '"')
Definition embcsv.h:72