changeset 8969:c6eeca55f502

New modules unistr/u*-mbsnlen.
author Bruno Haible <bruno@clisp.org>
date Mon, 11 Jun 2007 00:32:04 +0000
parents 236e8277b9b1
children 86a8bae7c7df
files ChangeLog lib/unistr.h
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Jun 11 00:29:30 2007 +0000
+++ b/ChangeLog	Mon Jun 11 00:32:04 2007 +0000
@@ -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.
--- a/lib/unistr.h	Mon Jun 11 00:29:30 2007 +0000
+++ b/lib/unistr.h	Mon Jun 11 00:32:04 2007 +0000
@@ -411,6 +411,15 @@
 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.  */