Changes in uspace/lib/c/generic/str.c [1772e6d:be2a38ad] in mainline
- File:
-
- 1 edited
-
uspace/lib/c/generic/str.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
r1772e6d rbe2a38ad 397 397 398 398 return len; 399 } 400 401 /** Get character display width on a character cell display. 402 * 403 * @param ch Character 404 * @return Width of character in cells. 405 */ 406 size_t chr_width(wchar_t ch) 407 { 408 return 1; 409 } 410 411 /** Get string display width on a character cell display. 412 * 413 * @param str String 414 * @return Width of string in cells. 415 */ 416 size_t str_width(const char *str) 417 { 418 size_t width = 0; 419 size_t offset = 0; 420 wchar_t ch; 421 422 while ((ch = str_decode(str, &offset, STR_NO_LIMIT)) != 0) 423 width += chr_width(ch); 424 425 return width; 399 426 } 400 427
Note:
See TracChangeset
for help on using the changeset viewer.
