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

Function cbm_string_read

internal/cbm/cbm.c:484–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482} CBMStringInput;
483
484static const char *cbm_string_read(void *payload, uint32_t byte, TSPoint point,
485 uint32_t *bytes_read) {
486 (void)point;
487 CBMStringInput *self = (CBMStringInput *)payload;
488 if (byte >= self->length) {
489 if (self->virtual_newline && byte == self->length) {
490 *bytes_read = 1;
491 return "\n";
492 }
493 *bytes_read = 0;
494 return "";
495 }
496 *bytes_read = self->length - byte;
497 return self->string + byte;
498}
499
500/* Where the parser stands after reading all `len` real bytes. */
501static TSPoint cbm_source_end_point(const char *source, uint32_t len) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected