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

Function generation_counter_parse

src/store/store.c:2646–2663  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2644}
2645
2646static bool generation_counter_parse(const char *text, uint64_t *out) {
2647 if (!text || !text[0] || (text[0] == '0' && text[1] != '\0')) {
2648 return false;
2649 }
2650 uint64_t value = 0;
2651 for (const unsigned char *p = (const unsigned char *)text; *p; p++) {
2652 if (*p < '0' || *p > '9') {
2653 return false;
2654 }
2655 uint64_t digit = (uint64_t)(*p - '0');
2656 if (value > (UINT64_MAX - digit) / 10) {
2657 return false;
2658 }
2659 value = value * 10 + digit;
2660 }
2661 *out = value;
2662 return true;
2663}
2664
2665/* Read and validate the two generation keys. Extra store_meta keys belong to
2666 * other store features and are deliberately ignored. */

Callers 1

generation_metadata_readFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected