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

Function inv_label_valid

tests/repro/repro_invariant_lib.h:40–52  ·  view source on GitHub ↗

Count definitions whose label is/ isn't in the valid label set. */

Source from the content-addressed store, hash-verified

38
39/* Count definitions whose label is/ isn't in the valid label set. */
40static inline int inv_label_valid(const char *label) {
41 static const char *valid[] = {
42 "Function", "Method", "Class", "Interface", "Struct", "Enum", "EnumMember",
43 "Module", "Variable", "Constant", "Field", "Trait", "Type", "TypeAlias",
44 "Namespace", "Property", "Route", "Macro", "Union", "Protocol","Mixin",
45 "Package", "Object", "Section", "Impl", "Annotation", "Resource", NULL};
46 if (!label)
47 return 0;
48 for (const char **v = valid; *v; v++)
49 if (strcmp(label, *v) == 0)
50 return 1;
51 return 0;
52}
53
54/* INV(labels-valid): every extracted def carries a label from the known set.
55 * Returns the count of defs with an INVALID/empty label (0 = pass). */

Callers 1

inv_count_bad_labelsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected