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

Function is_export_macro_shape

internal/cbm/preprocessor.cpp:59–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57 "_DLLEXPORT", "_DEPRECATED", NULL};
58
59static bool is_export_macro_shape(const char *id, size_t len) {
60 if (id[0] < 'A' || id[0] > 'Z') {
61 return false;
62 }
63 for (size_t i = 0; i < len; i++) {
64 char c = id[i];
65 bool upper = c >= 'A' && c <= 'Z';
66 bool digit = c >= '0' && c <= '9';
67 if (!upper && !digit && c != '_') {
68 return false;
69 }
70 }
71 for (int s = 0; kExportMacroSuffixes[s]; s++) {
72 size_t slen = strlen(kExportMacroSuffixes[s]);
73 // Require at least two prefix characters before the suffix so a bare
74 // "X_API"-style token (single-letter, easily a genuine symbol) stays out.
75 if (len >= slen + 2 && strncmp(id + len - slen, kExportMacroSuffixes[s], slen) == 0) {
76 return true;
77 }
78 }
79 return false;
80}
81
82static bool is_identifier_start(char c) {
83 return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '_';

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected