The section whose header line starts at pos. */
| 1958 | |
| 1959 | /* The section whose header line starts at pos. */ |
| 1960 | static int toml_section_at(const char *data, size_t pos, size_t len, toml_section_t *section) { |
| 1961 | memset(section, 0, sizeof(*section)); |
| 1962 | section->start = pos; |
| 1963 | size_t cursor = pos; |
| 1964 | toml_line_t line; |
| 1965 | if (!toml_next_line(data, len, &cursor, &line) || |
| 1966 | toml_parse_header(data, &line, "", §ion->header) != TOML_EDIT_OK || |
| 1967 | !section->header.present || |
| 1968 | toml_section_end(data, line.full_end, len, §ion->end) != TOML_EDIT_OK) { |
| 1969 | toml_header_dispose(§ion->header); |
| 1970 | return TOML_EDIT_ERR; |
| 1971 | } |
| 1972 | section->body = line.full_end; |
| 1973 | return TOML_EDIT_OK; |
| 1974 | } |
| 1975 | |
| 1976 | static int toml_lines_significant(const char *data, size_t start, size_t end) { |
| 1977 | size_t cursor = start; |
no test coverage detected