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

Function toml_next_line

src/cli/config_toml_edit.c:720–736  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

718#endif
719
720static 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
738static int toml_line_equals(const char *data, const toml_line_t *line, const char *value) {
739 size_t start = line->start;

Calls

no outgoing calls

Tested by

no test coverage detected