| 41 | } df_line_t; |
| 42 | |
| 43 | static bool df_next_line(df_reader_t *rd, df_line_t *line) { |
| 44 | if (rd->p >= rd->end) { |
| 45 | return false; |
| 46 | } |
| 47 | const char *nl = memchr(rd->p, '\n', (size_t)(rd->end - rd->p)); |
| 48 | line->text = rd->p; |
| 49 | line->len = nl ? (size_t)(nl - rd->p) : (size_t)(rd->end - rd->p); |
| 50 | rd->p = nl ? nl + 1 : rd->end; |
| 51 | return true; |
| 52 | } |
| 53 | |
| 54 | static bool df_starts(const df_line_t *line, const char *prefix) { |
| 55 | size_t n = strlen(prefix); |
no outgoing calls
no test coverage detected