MCPcopy Create free account
hub / github.com/NetHack/NetHack / match_str2attr

Function match_str2attr

src/coloratt.c:373–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

371}
372
373int
374match_str2attr(const char *str, boolean complain)
375{
376 int i, a = -1;
377
378 for (i = 0; i < SIZE(attrnames); i++)
379 if (attrnames[i].name
380 && fuzzymatch(str, attrnames[i].name, " -_", TRUE)) {
381 a = attrnames[i].attr;
382 break;
383 }
384
385 if (a == -1 && complain)
386 config_error_add("Unknown text attribute '%.50s'", str);
387
388 return a;
389}
390
391/* ask about highlighting attribute; for menu headers and menu
392 coloring patterns, only one attribute at a time is allowed;

Callers 5

optfn_petattrFunction · 0.85
color_attr_parse_strFunction · 0.85
add_menu_coloringFunction · 0.85
parse_status_hl2Function · 0.85
parse_conditionFunction · 0.85

Calls 2

fuzzymatchFunction · 0.85
config_error_addFunction · 0.85

Tested by

no test coverage detected