MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / toml_section_at

Function toml_section_at

src/cli/config_toml_edit.c:1960–1974  ·  view source on GitHub ↗

The section whose header line starts at pos. */

Source from the content-addressed store, hash-verified

1958
1959/* The section whose header line starts at pos. */
1960static 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, "", &section->header) != TOML_EDIT_OK ||
1967 !section->header.present ||
1968 toml_section_end(data, line.full_end, len, &section->end) != TOML_EDIT_OK) {
1969 toml_header_dispose(&section->header);
1970 return TOML_EDIT_ERR;
1971 }
1972 section->body = line.full_end;
1973 return TOML_EDIT_OK;
1974}
1975
1976static int toml_lines_significant(const char *data, size_t start, size_t end) {
1977 size_t cursor = start;

Callers 3

toml_declared_tableFunction · 0.85
toml_managed_classifyFunction · 0.85
toml_managed_span_passFunction · 0.85

Calls 4

toml_next_lineFunction · 0.85
toml_parse_headerFunction · 0.85
toml_section_endFunction · 0.85
toml_header_disposeFunction · 0.85

Tested by

no test coverage detected