summaryrefslogtreecommitdiff
path: root/src/core/utf8.h
diff options
context:
space:
mode:
authorXavier G <xavier.github@kindwolf.org>2016-05-13 02:47:26 +0200
committerXavier G <xavier.github@kindwolf.org>2016-05-13 02:47:26 +0200
commit35b3ccc6a407f83eba4f0c3787cc5c174bd3385c (patch)
tree94e9a946b78f3942678e468959a8bebb7b6e714f /src/core/utf8.h
parent21c07c006066115af4604e26cd89cf60f94a7d53 (diff)
downloadirssi-35b3ccc6a407f83eba4f0c3787cc5c174bd3385c.zip
Introduce string_length() and string_width().
Diffstat (limited to 'src/core/utf8.h')
-rw-r--r--src/core/utf8.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/utf8.h b/src/core/utf8.h
index f1a8f0e1..6f02c5a0 100644
--- a/src/core/utf8.h
+++ b/src/core/utf8.h
@@ -33,6 +33,15 @@ int string_advance(char const **str, int policy);
*/
int string_policy(const char *str);
+/* Return the length of the str string according to the given policy; if policy
+ * is -1, this function will call string_policy().
+ */
+int string_length(const char *str, int policy);
+/* Return the screen width of the str string according to the given policy; if
+ * policy is -1, this function will call string_policy().
+ */
+int string_width(const char *str, int policy);
+
#define unichar_isprint(c) (((c) & ~0x80) >= 32)
#define is_utf8_leading(c) (((c) & 0xc0) != 0x80)