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

Function text_count_occurrences

src/cli/config_text_edit.c:868–883  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

866}
867
868static size_t text_count_occurrences(const char *data, size_t len, const char *needle,
869 size_t needle_len) {
870 size_t count = 0U;
871 if (needle_len == 0U || needle_len > len) {
872 return 0U;
873 }
874 for (size_t pos = 0U; pos <= len - needle_len;) {
875 if (memcmp(data + pos, needle, needle_len) == 0) {
876 count++;
877 pos += needle_len;
878 } else {
879 pos++;
880 }
881 }
882 return count;
883}
884
885static int text_scan_managed_region(const char *data, size_t len, size_t bom_len,
886 const char *begin_marker, size_t begin_len,

Callers 3

text_scan_managed_regionFunction · 0.85
text_validate_markersFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected