From da95d22587b4d1b117625b8a69e07db27ca06dce Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Mon, 10 Dec 2007 18:07:20 +0100 Subject: Added UTF-8 functions to plugins API --- src/core/wee-utf8.c | 42 +----------------------------------------- src/core/wee-utf8.h | 1 - 2 files changed, 1 insertion(+), 42 deletions(-) (limited to 'src/core') diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c index 085e6e6dc..9e52dd6b3 100644 --- a/src/core/wee-utf8.c +++ b/src/core/wee-utf8.c @@ -226,7 +226,7 @@ utf8_next_char (char *string) } /* - * utf8_char_size: return UTF-8 char size + * utf8_char_size: return UTF-8 char size (in bytes) */ int @@ -455,43 +455,3 @@ utf8_pos (char *string, int real_pos) } return count; } - -/* - * utf8_get_wide_char: get wide char from string (first char) - */ - -wint_t -utf8_get_wide_char (char *string) -{ - int char_size; - wint_t result; - - if (!string || !string[0]) - return WEOF; - - char_size = utf8_char_size (string); - switch (char_size) - { - case 1: - result = (wint_t)string[0]; - break; - case 2: - result = ((wint_t)((unsigned char)string[0])) << 8 - | ((wint_t)((unsigned char)string[1])); - break; - case 3: - result = ((wint_t)((unsigned char)string[0])) << 16 - | ((wint_t)((unsigned char)string[1])) << 8 - | ((wint_t)((unsigned char)string[2])); - break; - case 4: - result = ((wint_t)((unsigned char)string[0])) << 24 - | ((wint_t)((unsigned char)string[1])) << 16 - | ((wint_t)((unsigned char)string[2])) << 8 - | ((wint_t)((unsigned char)string[3])); - break; - default: - result = WEOF; - } - return result; -} diff --git a/src/core/wee-utf8.h b/src/core/wee-utf8.h index b66996864..f16733535 100644 --- a/src/core/wee-utf8.h +++ b/src/core/wee-utf8.h @@ -47,6 +47,5 @@ extern int utf8_char_size_screen (char *); extern char *utf8_add_offset (char *, int); extern int utf8_real_pos (char *, int); extern int utf8_pos (char *, int); -extern wint_t utf8_get_wide_char (char *); #endif /* wee-utf8.h */ -- cgit v1.2.3