diff options
author | Xavier G <xavier.github@kindwolf.org> | 2016-05-13 03:04:08 +0200 |
---|---|---|
committer | Xavier G <xavier.github@kindwolf.org> | 2016-05-13 03:04:08 +0200 |
commit | 719efc44a3c3c3db8f12b6ff40d2021837d9a902 (patch) | |
tree | 609b9a33b95790fb98137d4f30f37794f76dbb83 /src/core/utf8.h | |
parent | 35b3ccc6a407f83eba4f0c3787cc5c174bd3385c (diff) | |
download | irssi-719efc44a3c3c3db8f12b6ff40d2021837d9a902.zip |
Introduce string_chars_for_width().
Diffstat (limited to 'src/core/utf8.h')
-rw-r--r-- | src/core/utf8.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/utf8.h b/src/core/utf8.h index 6f02c5a0..411b2048 100644 --- a/src/core/utf8.h +++ b/src/core/utf8.h @@ -42,6 +42,12 @@ int string_length(const char *str, int policy); */ int string_width(const char *str, int policy); +/* Return the amount of characters from str it takes to reach n columns, or -1 if + * str is NULL. Optionally return the equivalent amount of bytes. + * If policy is -1, this function will call string_policy(). + */ +int string_chars_for_width(const char *str, int policy, unsigned int n, unsigned int *bytes); + #define unichar_isprint(c) (((c) & ~0x80) >= 32) #define is_utf8_leading(c) (((c) & 0xc0) != 0x80) |