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

Function path_device

src/foundation/path_syntax_internal.c:16–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14}
15
16static bool path_device(const unsigned char *p, size_t n) {
17 size_t base = 0;
18 while (base < n && p[base] != '.')
19 base++;
20 if (base < 3)
21 return false;
22 unsigned char a = path_upper(p[0]), b = path_upper(p[1]), d = path_upper(p[2]);
23 if (base == 3)
24 return (a == 'C' && b == 'O' && d == 'N') || (a == 'P' && b == 'R' && d == 'N') ||
25 (a == 'A' && b == 'U' && d == 'X') || (a == 'N' && b == 'U' && d == 'L');
26 if (!((a == 'C' && b == 'O' && d == 'M') || (a == 'L' && b == 'P' && d == 'T')))
27 return false;
28 if (base == 4)
29 return p[3] >= '1' && p[3] <= '9';
30 return base == 5 && p[3] == 0xc2 && (p[4] == 0xb9 || p[4] == 0xb2 || p[4] == 0xb3);
31}
32
33cbm_path_syntax_result_t cbm_path_windows_component(const unsigned char *component, size_t length) {
34 if (!component || !length || length > CBM_PATH_SYNTAX_MAX_BYTES)

Callers 1

Calls 1

path_upperFunction · 0.85

Tested by

no test coverage detected