Changeset be2a38ad in mainline
- Timestamp:
- 2012-08-16T10:37:59Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 56fd7cf, 7a7b8efa
- Parents:
- 69cf3a4
- Location:
- uspace/lib/c
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/str.c
r69cf3a4 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 -
uspace/lib/c/include/str.h
r69cf3a4 rbe2a38ad 73 73 extern size_t wstr_nlength(const wchar_t *str, size_t size); 74 74 75 extern size_t chr_width(wchar_t ch); 76 extern size_t str_width(const char *str); 77 75 78 extern bool ascii_check(wchar_t ch); 76 79 extern bool chr_check(wchar_t ch);
Note:
See TracChangeset
for help on using the changeset viewer.