MCPcopy Create free account
hub / github.com/crawl/crawl / strwidth

Function strwidth

crawl-ref/source/unicode.cc:474–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

472}
473
474int strwidth(const char *s)
475{
476 char32_t c;
477 int w = 0;
478
479 while (int l = utf8towc(&c, s))
480 {
481 s += l;
482 int cw = wcwidth(c);
483 if (cw != -1) // shouldn't ever happen
484 w += cw;
485 }
486
487 return w;
488}
489
490int strwidth(const string &s)
491{

Callers 15

validate_player_nameFunction · 0.85
make_artefact_nameFunction · 0.85
_ashenzari_artefact_nameFunction · 0.85
read_line_coreMethod · 0.85
process_keyMethod · 0.85
_spell_base_descriptionFunction · 0.85
load_itemsMethod · 0.85
message_lineMethod · 0.85
pure_lenMethod · 0.85
shillelaghFunction · 0.85
_construct_weapon_menuFunction · 0.85
update_message_statusFunction · 0.85

Calls 2

utf8towcFunction · 0.85
wcwidthFunction · 0.85

Tested by

no test coverage detected