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

Function extract_attr

internal/cbm/iris_export_xml.c:54–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52 return *p == '/';
53}
54static void extract_attr(const char *ts, const char *te, const char *attr, char *out, size_t sz) {
55 out[0] = '\0';
56 size_t an = strlen(attr);
57 for (const char *p = ts; p < te - an; p++) {
58 if (memcmp(p, attr, an) == 0 && p[an] == '=') {
59 p += an + 1;
60 char q = *p;
61 if (q != '"' && q != '\'')
62 return;
63 p++;
64 const char *v = p;
65 while (p < te && *p != q)
66 p++;
67 size_t vl = (size_t)(p - v);
68 if (vl >= sz)
69 vl = sz - 1;
70 memcpy(out, v, vl);
71 out[vl] = '\0';
72 return;
73 }
74 }
75}
76static const char *elem_content(const char *p, const char *end, const char *tag, char *buf,
77 size_t bufsz) {
78 buf[0] = '\0';

Callers 6

emit_headerFunction · 0.85
emit_methodFunction · 0.85
emit_propertyFunction · 0.85
emit_parameterFunction · 0.85
emit_indexFunction · 0.85
emit_xdataFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected