New modules unistr/u*-mbsnlen.
authorBruno Haible <bruno@clisp.org>
Mon, 11 Jun 2007 00:32:04 +0000 (00:32 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 11 Jun 2007 00:32:04 +0000 (00:32 +0000)
ChangeLog
lib/unistr.h

index 376c898..6d76253 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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.
        * lib/mbsnlen.c: New file.
        * m4/mbsnlen.m4: New file.
index 24218fb..72852f7 100644 (file)
@@ -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.  */