| 105 | } |
| 106 | |
| 107 | int csv_init(struct csv_parser *p, unsigned char options) { |
| 108 | /* Initialize a csv_parser object returns 0 on success, -1 on error */ |
| 109 | if (p == NULL) return -1; |
| 110 | |
| 111 | p->entry_buf = NULL; |
| 112 | p->pstate = ROW_NOT_BEGUN; |
| 113 | p->quoted = 0; |
| 114 | p->spaces = 0; |
| 115 | p->entry_pos = 0; |
| 116 | p->entry_size = 0; |
| 117 | p->status = 0; |
| 118 | p->options = options; |
| 119 | p->quote_char = CSV_QUOTE; |
| 120 | p->delim_char = CSV_COMMA; |
| 121 | p->is_space = NULL; |
| 122 | p->is_term = NULL; |
| 123 | p->blk_size = MEM_BLK_SIZE; |
| 124 | p->malloc_func = NULL; |
| 125 | p->realloc_func = realloc; |
| 126 | p->free_func = free; |
| 127 | |
| 128 | return 0; |
| 129 | } |
| 130 | |
| 131 | void csv_free(struct csv_parser *p) { |
| 132 | /* Free the entry_buffer of csv_parser object */ |
no outgoing calls
no test coverage detected