MCPcopy Create free account
hub / github.com/dail8859/NotepadNext / FindFunctionByConstantName

Method FindFunctionByConstantName

src/IFaceTable.cpp:48–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48const IFaceFunction *IFaceTable::FindFunctionByConstantName(const char *name) const {
49 if (strncmp(name, prefix, strlen(prefix)) == 0) {
50 // This looks like a constant for an iface function. This requires
51 // a sequential search. Take special care since the function names
52 // are mixed case, whereas the constants are all-caps.
53
54 for (const auto &func : functions) {
55 const char *nm = name + strlen(prefix);
56 const char *fn = func.name;
57 while (*nm && *fn && (*nm == toupper(*fn))) {
58 ++nm;
59 ++fn;
60 }
61 if (!*nm && !*fn) {
62 return &func;
63 }
64 }
65 }
66 return nullptr;
67}
68
69const IFaceFunction *IFaceTable::FindFunctionByValue(int value) const {
70 for (const auto &func : functions) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected