summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2007-07-07 16:26:16 +0000
committerBruno Haible <bruno@clisp.org>2007-07-07 16:26:16 +0000
commitbfc49603152e76ca7da9e4e8b2fc7e55e5b7b246 (patch)
treef9909cdbb05bf80f8d082e1a80964b7b42657c17 /lib
parent88c17eb1c96a98b1da079e19abfa14b71ac26773 (diff)
downloadgnulib-bfc49603152e76ca7da9e4e8b2fc7e55e5b7b246.tar.gz
New module 'uniwidth/u16-strwidth'.
Diffstat (limited to 'lib')
-rw-r--r--lib/uniwidth/u16-strwidth.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/uniwidth/u16-strwidth.c b/lib/uniwidth/u16-strwidth.c
new file mode 100644
index 0000000000..4a29ff498f
--- /dev/null
+++ b/lib/uniwidth/u16-strwidth.c
@@ -0,0 +1,31 @@
+/* Determine display width of UTF-16 string.
+ Copyright (C) 2001-2002, 2006 Free Software Foundation, Inc.
+ Written by Bruno Haible <bruno@clisp.org>, 2002.
+
+ This program is free software; you can redistribute it and/or modify it
+ under the terms of the GNU Library General Public License as published
+ by the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
+ USA. */
+
+#include <config.h>
+
+/* Specification. */
+#include "uniwidth.h"
+
+#include "unistr.h"
+
+int
+u16_strwidth (const uint16_t *s, const char *encoding)
+{
+ return u16_width (s, u16_strlen (s), encoding);
+}