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

Function lang_head_text

src/discover/language.c:1179–1185  ·  view source on GitHub ↗

The first min(n, cap) bytes as a C string in dst[cap + 1]. The probes are * string scans, so an embedded NUL ends what they see, as it always did. */

Source from the content-addressed store, hash-verified

1177/* The first min(n, cap) bytes as a C string in dst[cap + 1]. The probes are
1178 * string scans, so an embedded NUL ends what they see, as it always did. */
1179static void lang_head_text(char *dst, size_t cap, const unsigned char *head, size_t n) {
1180 size_t len = n < cap ? n : cap;
1181 if (len > 0) {
1182 memcpy(dst, head, len);
1183 }
1184 dst[len] = '\0';
1185}
1186
1187/* The first `cap` bytes of a file, raw. false when the file cannot be opened.
1188 * A read error keeps the bytes read before it, as the probes always did. */

Callers 7

cbm_disambiguate_mFunction · 0.85
cbm_disambiguate_frmFunction · 0.85
cbm_disambiguate_clsFunction · 0.85
cbm_disambiguate_incFunction · 0.85
cbm_disambiguate_cfcFunction · 0.85
lang_objectscript_exportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected