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

Function c_is_url

internal/cbm/doclink_c.c:158–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158static bool c_is_url(const char *t, size_t n) {
159 size_t i = 0;
160 while (i < n && (isalnum((unsigned char)t[i]) || t[i] == '+' || t[i] == '.' || t[i] == '-')) {
161 i++;
162 }
163 if (i > 0 && i + CBM_SZ_3 <= n && memcmp(t + i, "://", CBM_SZ_3) == 0) {
164 return true;
165 }
166 return (n > CBM_SZ_4 && strncmp(t, "www.", CBM_SZ_4) == 0) ||
167 (n > CBM_SZ_7 && strncmp(t, "mailto:", CBM_SZ_7) == 0);
168}
169
170static void c_push(const c_emit_t *em, const char *ref, size_t n, int syntax, uint32_t line) {
171 if (n == 0) {

Callers 2

c_pushFunction · 0.85
c_see_wordFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected