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

Function import_last_segment

src/pipeline/pass_pkgmap.c:1485–1493  ·  view source on GitHub ↗

Return the last path segment of an import string, recognizing the separators * used across languages: '.', '/', '\\', and "::". Returns a pointer into * `path` (no allocation). */

Source from the content-addressed store, hash-verified

1483 * used across languages: '.', '/', '\\', and "::". Returns a pointer into
1484 * `path` (no allocation). */
1485static const char *import_last_segment(const char *path) {
1486 const char *seg = path;
1487 for (const char *p = path; *p; p++) {
1488 if (*p == '.' || *p == '/' || *p == '\\' || *p == ':') {
1489 seg = p + 1;
1490 }
1491 }
1492 return seg;
1493}
1494
1495/* Derive a representative imported symbol name from a raw module/use path,
1496 * stripping language decorations so it can be matched against an in-graph node:

Callers 2

import_candidate_symbolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected