diff options
author | Jesse Luehrs <doy@tozt.net> | 2016-05-04 03:39:44 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2016-05-04 04:32:00 -0400 |
commit | 2e076d52507be5dd998117ae119683c34b92b457 (patch) | |
tree | 3fc31f8a0d2783d5d82feb74561c43ce9eadf1ab | |
parent | 52f3852bd38c9c9bbf1e4eb1ffbcb8eecee1fd58 (diff) | |
download | libvt100-2e076d52507be5dd998117ae119683c34b92b457.tar.gz libvt100-2e076d52507be5dd998117ae119683c34b92b457.zip |
stop using gunichar here
it makes compilation more complicated, since it makes vt100.h require
knowing about the glib headers
-rw-r--r-- | src/unicode-extra.c | 11 | ||||
-rw-r--r-- | src/unicode-extra.h | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/unicode-extra.c b/src/unicode-extra.c index 3a59378..b226e30 100644 --- a/src/unicode-extra.c +++ b/src/unicode-extra.c @@ -1,4 +1,5 @@ #include <glib.h> +#include <stdint.h> #include "vt100.h" @@ -23,8 +24,8 @@ * http://www.unicode.org/Public/emoji/2.0//emoji-data.txt. */ struct vt100_char_range { - gunichar start; - gunichar end; + uint32_t start; + uint32_t end; }; static struct vt100_char_range vt100_wide_emoji[] = { @@ -64,14 +65,14 @@ static struct vt100_char_range vt100_wide_emoji[] = { { 0x1F9C0, 0x1F9C0 }, }; -static int vt100_is_wide_emoji(gunichar codepoint); +static int vt100_is_wide_emoji(uint32_t codepoint); -int vt100_is_wide_char(gunichar codepoint) +int vt100_is_wide_char(uint32_t codepoint) { return g_unichar_iswide(codepoint) || vt100_is_wide_emoji(codepoint); } -static int vt100_is_wide_emoji(gunichar codepoint) +static int vt100_is_wide_emoji(uint32_t codepoint) { static size_t ranges = sizeof(vt100_wide_emoji) / sizeof(struct vt100_char_range); ssize_t low = 0, high = ranges - 1; diff --git a/src/unicode-extra.h b/src/unicode-extra.h index eaa3dce..3f749e8 100644 --- a/src/unicode-extra.h +++ b/src/unicode-extra.h @@ -1,8 +1,8 @@ #ifndef _VT100_UNICODE_EXTRA_H #define _VT100_UNICODE_EXTRA_H -#include <glib.h> +#include <stdint.h> -int vt100_is_wide_char(gunichar codepoint); +int vt100_is_wide_char(uint32_t codepoint); #endif |