summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2007-12-10 18:07:20 +0100
committerSebastien Helleu <flashcode@flashtux.org>2007-12-10 18:07:20 +0100
commitda95d22587b4d1b117625b8a69e07db27ca06dce (patch)
treed72902c98439f3050eca5277159947094564575d /src/core
parent256557f900d82149b2ada5619bd52b5e4e3fc78b (diff)
downloadweechat-da95d22587b4d1b117625b8a69e07db27ca06dce.zip
Added UTF-8 functions to plugins API
Diffstat (limited to 'src/core')
-rw-r--r--src/core/wee-utf8.c42
-rw-r--r--src/core/wee-utf8.h1
2 files changed, 1 insertions, 42 deletions
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 */