From: Bruno Haible <bruno@clisp.org>
Date: Mon, 11 Jun 2007 00:32:04 +0000 (+0000)
Subject: New modules unistr/u*-mbsnlen.
X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa662f811f9a6dda54f64639b107b1637c3ba2e5;p=pspp

New modules unistr/u*-mbsnlen.
---

diff --git a/ChangeLog b/ChangeLog
index 376c898fa2..6d762539e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-10  Bruno Haible  <bruno@clisp.org>
+
+	* lib/unistr.h (u8_mbsnlen, u16_mbsnlen, u32_mbsnlen): New
+	declarations.
+
 2007-06-10  Bruno Haible  <bruno@clisp.org>
 
 	* lib/string_.h (mbsnlen): New declaration.
diff --git a/lib/unistr.h b/lib/unistr.h
index 24218fbda2..72852f7811 100644
--- a/lib/unistr.h
+++ b/lib/unistr.h
@@ -411,6 +411,15 @@ extern uint16_t *
 extern uint32_t *
        u32_chr (const uint32_t *s, size_t n, ucs4_t uc);
 
+/* Count the number of Unicode characters in the N units from S.  */
+/* Similar to mbsnlen().  */
+extern size_t
+       u8_mbsnlen (const uint8_t *s, size_t n);
+extern size_t
+       u16_mbsnlen (const uint16_t *s, size_t n);
+extern size_t
+       u32_mbsnlen (const uint32_t *s, size_t n);
+
 /* Elementary string functions with memory allocation.  */
 
 /* Make a freshly allocated copy of S, of length N.  */