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

Function go_split_name

internal/cbm/doclink_go.c:451–468  ·  view source on GitHub ↗

splitDocName: `before.Name` with a capitalized Name. False when the text * after the last dot is no Name (then nothing is split off). */

Source from the content-addressed store, hash-verified

449/* splitDocName: `before.Name` with a capitalized Name. False when the text
450 * after the last dot is no Name (then nothing is split off). */
451static bool go_split_name(const char *s, size_t n, size_t *before_len, const char **name,
452 size_t *name_len) {
453 size_t dot = n;
454 for (size_t i = n; i > 0; i--) {
455 if (s[i - SKIP_ONE] == '.') {
456 dot = i - SKIP_ONE;
457 break;
458 }
459 }
460 size_t ns = dot < n ? dot + SKIP_ONE : 0;
461 if (!go_is_name(s + ns, n - ns)) {
462 return false;
463 }
464 *name = s + ns;
465 *name_len = n - ns;
466 *before_len = dot < n ? dot : 0;
467 return true;
468}
469
470bool cbm_doclink_go_parse_ref(const char *raw, size_t len, CBMDocLinkGoRef *out) {
471 memset(out, 0, sizeof(*out));

Callers 1

cbm_doclink_go_parse_refFunction · 0.85

Calls 1

go_is_nameFunction · 0.85

Tested by

no test coverage detected