MCPcopy Index your code
hub / github.com/assaultcube/AC / enumalias

Function enumalias

source/src/command.cpp:1503–1512  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1501int sortident(ident **a, ident **b) { return strcasecmp((*a)->name, (*b)->name); }
1502
1503void enumalias(char *prefix)
1504{
1505 vector<char> res;
1506 vector<ident *> sids;
1507 size_t np = strlen(prefix);
1508 enumerate(*idents, ident, id, if(id.type == ID_ALIAS && id.persist && !id.isconst && !id.istemp && !strncmp(id.name, prefix, np)) sids.add(&id); );
1509 sids.sort(sortident);
1510 loopv(sids) cvecprintf(res, "%s %s\n", escapestring(sids[i]->name, false), escapestring(sids[i]->name + np, false));
1511 resultcharvector(res, -1);
1512}
1513COMMAND(enumalias, "s");
1514
1515VARP(omitunchangeddefaults, 0, 0, 1);

Callers

nothing calls this directly

Calls 6

cvecprintfFunction · 0.85
escapestringFunction · 0.85
resultcharvectorFunction · 0.85
sortMethod · 0.80
loopvFunction · 0.70
addMethod · 0.45

Tested by

no test coverage detected