summaryrefslogtreecommitdiff
path: root/src/calcurse.h
diff options
context:
space:
mode:
authorLukas Fleischer <calcurse@cryptocrack.de>2011-05-31 20:04:03 +0200
committerLukas Fleischer <calcurse@cryptocrack.de>2011-06-29 15:43:44 +0200
commit271457b7a4753c0ee79fe0ee5105b7e496a8d240 (patch)
tree3fd446969c3ce563e59ec7eabc3a33a3337c269c /src/calcurse.h
parent7f5fc0c62f824282b910a573baf6c2712ca33cbe (diff)
downloadcalcurse-271457b7a4753c0ee79fe0ee5105b7e496a8d240.zip
Add basic UTF-8 helper functions
Add utf8_width() and utf8_strwidth() which can be used to calculate the display width of a single character or a string, respectively. A lookup table is used to spot double width characters, as well as composing characters. There currently isn't any code to deal with ambigious characters. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
Diffstat (limited to 'src/calcurse.h')
-rw-r--r--src/calcurse.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/calcurse.h b/src/calcurse.h
index d7fa770..52e3498 100644
--- a/src/calcurse.h
+++ b/src/calcurse.h
@@ -832,6 +832,10 @@ void todo_view_note (char *);
void todo_init_list (void);
void todo_free_list (void);
+/* utf8.c */
+int utf8_width (char *);
+int utf8_strwidth (char *);
+
/* utils.c */
void exit_calcurse (int) __attribute__((__noreturn__));
void free_user_data (void);