| 718 | #endif |
| 719 | |
| 720 | static int toml_next_line(const char *data, size_t len, size_t *cursor, toml_line_t *line) { |
| 721 | if (!data || !cursor || !line || *cursor >= len) { |
| 722 | return 0; |
| 723 | } |
| 724 | size_t pos = *cursor; |
| 725 | line->start = pos; |
| 726 | while (pos < len && data[pos] != '\n') { |
| 727 | ++pos; |
| 728 | } |
| 729 | line->content_end = pos; |
| 730 | if (line->content_end > line->start && data[line->content_end - 1] == '\r') { |
| 731 | --line->content_end; |
| 732 | } |
| 733 | line->full_end = pos < len ? pos + 1 : pos; |
| 734 | *cursor = line->full_end; |
| 735 | return 1; |
| 736 | } |
| 737 | |
| 738 | static int toml_line_equals(const char *data, const toml_line_t *line, const char *value) { |
| 739 | size_t start = line->start; |
no outgoing calls
no test coverage detected