diff options
author | Lars Henriksen <LarsHenriksen@get2net.dk> | 2018-05-28 21:07:49 +0200 |
---|---|---|
committer | Lukas Fleischer <lfleischer@calcurse.org> | 2018-06-03 11:24:37 +0200 |
commit | 431e4a00e7792d3421c7122c32ca5df81505caf3 (patch) | |
tree | abb8f23f7efc9bb9b22cb8d598f31a223e9cc7ca /src | |
parent | 30f411257ad3bc233184c08b846a2980a9c5d1f0 (diff) | |
download | calcurse-431e4a00e7792d3421c7122c32ca5df81505caf3.tar.gz calcurse-431e4a00e7792d3421c7122c32ca5df81505caf3.zip |
Rename utf8_ord() to utf8_decode()
Purely for readability and in preparation for the counterpart utf8_encode().
Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/calcurse.h | 2 | ||||
-rw-r--r-- | src/keys.c | 2 | ||||
-rw-r--r-- | src/utf8.c | 4 |
3 files changed, 4 insertions, 4 deletions
diff --git a/src/calcurse.h b/src/calcurse.h index e5af531..c362055 100644 --- a/src/calcurse.h +++ b/src/calcurse.h @@ -1115,7 +1115,7 @@ int ui_todo_get_view(void); void ui_todo_set_view(int); /* utf8.c */ -int utf8_ord(const char *); +int utf8_decode(const char *); int utf8_width(char *); int utf8_strwidth(char *); int utf8_chop(char *, int); @@ -266,7 +266,7 @@ int keys_wgetch(WINDOW *win) buf[0] = ch; for (i = 1; i < UTF8_LENGTH(buf[0]); i++) buf[i] = wgetch(win); - return utf8_ord(buf) + KEY_MAX; + return utf8_decode(buf) + KEY_MAX; } void keys_wait_for_any_key(WINDOW *win) @@ -270,7 +270,7 @@ static const struct utf8_range utf8_widthtab[] = { }; /* Decode a UTF-8 encoded character. Return the Unicode code point. */ -int utf8_ord(const char *s) +int utf8_decode(const char *s) { if (UTF8_ISCONT(*s)) return -1; @@ -298,7 +298,7 @@ int utf8_width(char *s) if (UTF8_ISCONT(*s)) return 0; - val = utf8_ord(s); + val = utf8_decode(s); low = 0; high = ARRAY_SIZE(utf8_widthtab); do { |