changeset 8507:2d9de99c11d9

Drop the include files utf8-ucs4.h, utf8-ucs4-unsafe.h, utf16-ucs4.h, utf16-ucs4-unsafe.h, ucs4-utf8.h, ucs4-utf16.h. Use unistr.h instead.
author Bruno Haible <bruno@clisp.org>
date Sat, 24 Mar 2007 14:11:25 +0000
parents 04518e040836
children 02b607b4662b
files ChangeLog NEWS lib/striconveh.c lib/ucs4-utf16.h lib/ucs4-utf8.h lib/unistr.h lib/unistr/u16-check.c lib/unistr/u16-chr.c lib/unistr/u16-mblen.c lib/unistr/u16-prev.c lib/unistr/u16-strchr.c lib/unistr/u16-strmblen.c lib/unistr/u16-strmbtouc.c lib/unistr/u16-strrchr.c lib/unistr/u8-check.c lib/unistr/u8-chr.c lib/unistr/u8-mblen.c lib/unistr/u8-prev.c lib/unistr/u8-strchr.c lib/unistr/u8-strmblen.c lib/unistr/u8-strmbtouc.c lib/unistr/u8-strrchr.c lib/unistr/ucs4-utf16.c lib/unistr/ucs4-utf8.c lib/unistr/utf16-ucs4-unsafe.c lib/unistr/utf16-ucs4.c lib/unistr/utf8-ucs4-unsafe.c lib/unistr/utf8-ucs4.c lib/utf16-ucs4-unsafe.h lib/utf16-ucs4.h lib/utf8-ucs4-unsafe.h lib/utf8-ucs4.h m4/ucs4-utf.m4 m4/utf-ucs4.m4 modules/ucs4-utf16 modules/ucs4-utf8 modules/utf16-ucs4 modules/utf16-ucs4-unsafe modules/utf8-ucs4 modules/utf8-ucs4-unsafe
diffstat 40 files changed, 205 insertions(+), 366 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,60 @@
+2007-03-24  Bruno Haible  <bruno@clisp.org>
+
+	* lib/utf8-ucs4.h: Remove file.
+	* lib/utf8-ucs4-unsafe.h: Remove file.
+	* lib/utf16-ucs4.h: Remove file.
+	* lib/utf16-ucs4-unsafe.h: Remove file.
+	* lib/ucs4-utf8.h: Remove file.
+	* lib/ucs4-utf16.h: Remove file.
+	* lib/unistr.h: Include their previous contents.
+	* m4/utf-ucs4.m4: Remove file.
+	* m4/ucs4-utf.m4: Remove file.
+	* modules/utf8-ucs4 (Files): Remove lib/utf8-ucs4.h.
+	(Depends-on): Add unistr/base.
+	(configure.ac): Remove gl_UTF_UCS4.
+	(Makefile.am): Update.
+	(Include): Change to unistr.h.
+	* modules/utf8-ucs4-unsafe (Files): Remove lib/utf8-ucs4-unsafe.h.
+	(Depends-on): Add unistr/base.
+	(configure.ac): Remove gl_UTF_UCS4.
+	(Makefile.am): Update.
+	(Include): Change to unistr.h.
+	* modules/utf16-ucs4 (Files): Remove lib/utf16-ucs4.h.
+	(Depends-on): Add unistr/base.
+	(configure.ac): Remove gl_UTF_UCS4.
+	(Makefile.am): Update.
+	(Include): Change to unistr.h.
+	* modules/utf16-ucs4-unsafe (Files): Remove lib/utf16-ucs4-unsafe.h.
+	(Depends-on): Add unistr/base.
+	(configure.ac): Remove gl_UTF_UCS4.
+	(Makefile.am): Update.
+	(Include): Change to unistr.h.
+	* modules/ucs4-utf8 (Files): Remove lib/ucs4-utf8.h.
+	(Depends-on): Add unistr/base.
+	(configure.ac): Remove gl_UCS4_UTF.
+	(Makefile.am): Update.
+	(Include): Change to unistr.h.
+	* modules/ucs4-utf16 (Files): Remove lib/ucs4-utf16.h.
+	(Depends-on): Add unistr/base.
+	(configure.ac): Remove gl_UCS4_UTF.
+	(Makefile.am): Update.
+	(Include): Change to unistr.h.
+	* lib/unistr/utf8-ucs4.c: Include unistr.h instead of utf8-ucs4.h.
+	* lib/unistr/utf8-ucs4-unsafe.c: Include unistr.h instead of
+	utf8-ucs4-unsafe.h.
+	* lib/unistr/utf16-ucs4.c: Include unistr.h instead of utf16-ucs4.h.
+	* lib/unistr/utf16-ucs4-unsafe.c: Include unistr.h instead of
+	utf16-ucs4-unsafe.h.
+	* lib/unistr/ucs4-utf8.c: Include unistr.h instead of ucs4-utf8.h.
+	* lib/unistr/ucs4-utf16.c: Include unistr.h instead of ucs4-utf16.h.
+	* lib/unistr/u8-chr.c: Don't include ucs4-utf8.h.
+	* lib/unistr/u8-strchr.c: Likewise.
+	* lib/unistr/u8-strrchr.c: Likewise.
+	* lib/unistr/u16-chr.c: Don't include ucs4-utf16.h.
+	* lib/unistr/u16-strchr.c: Likewise.
+	* lib/unistr/u16-strrchr.c: Likewise.
+	* lib/striconveh.c: Update.
+
 2007-03-24  Bruno Haible  <bruno@clisp.org>
 
 	* lib/argp-help.c (fill_in_uparams, canon_doc_option): Cast the
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,19 @@
 
 Date        Modules         Changes
 
+2007-03-24  utf8-ucs4       The include file is changed from "utf8-ucs4.h"
+                            to "unistr.h".
+            utf8-ucs4-unsafe  The include file is changed from
+                            "utf8-ucs4-unsafe.h" to "unistr.h".
+            utf16-ucs4      The include file is changed from "utf16-ucs4.h"
+                            to "unistr.h".
+            utf16-ucs4-unsafe  The include file is changed from "utf16-ucs4.h"
+                            to "unistr.h".
+            ucs4-utf8       The include file is changed from "ucs4-utf8.h"
+                            to "unistr.h".
+            ucs4-utf16      The include file is changed from "ucs4-utf16.h"
+                            to "unistr.h".
+
 2007-03-19  iconvme         The module is removed. Use module striconv instead:
                             iconv_string -> str_iconv
                             iconv_alloc -> str_cd_iconv (with reversed
--- a/lib/striconveh.c
+++ b/lib/striconveh.c
@@ -28,8 +28,6 @@
 
 #if HAVE_ICONV
 # include <iconv.h>
-# include "utf8-ucs4.h"
-# include "ucs4-utf8.h"
 # include "unistr.h"
 #endif
 
deleted file mode 100644
--- a/lib/ucs4-utf16.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Conversion UCS-4 to UTF-16.
-   Copyright (C) 2002, 2005-2007 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.  */
-
-#ifndef _UCS4_UTF16_H
-#define _UCS4_UTF16_H
-
-#include <stddef.h>
-#include "unitypes.h"
-
-extern int u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
-
-/* Return the length (number of units) of the UTF-16 representation of uc,
-   after storing it at S.  Return -1 upon failure, -2 if the number of
-   available units, N, is too small.  */
-static inline int
-u16_uctomb (uint16_t *s, ucs4_t uc, int n)
-{
-  if (uc < 0xd800 && n > 0)
-    {
-      s[0] = uc;
-      return 1;
-    }
-  else
-    return u16_uctomb_aux (s, uc, n);
-}
-
-#endif /* _UCS4_UTF16_H */
deleted file mode 100644
--- a/lib/ucs4-utf8.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Conversion UCS-4 to UTF-8.
-   Copyright (C) 2002, 2005-2007 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.  */
-
-#ifndef _UCS4_UTF8_H
-#define _UCS4_UTF8_H
-
-#include <stddef.h>
-#include "unitypes.h"
-
-extern int u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
-
-/* Return the length (number of units) of the UTF-8 representation of uc,
-   after storing it at S.  Return -1 upon failure, -2 if the number of
-   available units, N, is too small.  */
-static inline int
-u8_uctomb (uint8_t *s, ucs4_t uc, int n)
-{
-  if (uc < 0x80 && n > 0)
-    {
-      s[0] = uc;
-      return 1;
-    }
-  else
-    return u8_uctomb_aux (s, uc, n);
-}
-
-#endif /* _UCS4_UTF8_H */
--- a/lib/unistr.h
+++ b/lib/unistr.h
@@ -1,5 +1,5 @@
 /* Elementary Unicode string functions.
-   Copyright (C) 2002, 2005-2007 Free Software Foundation, Inc.
+   Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc.
 
    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
@@ -126,9 +126,10 @@
 
 /* Return the length (number of units) of the first character in S, putting
    its 'ucs4_t' representation in *PUC.  Upon failure, *PUC is set to 0xfffd,
-   and an appropriate number of units is returned.  */
-/* Similar to mbtowc(), except that puc and s must not be NULL, and the NUL
-   character is not treated specially.  */
+   and an appropriate number of units is returned.
+   The number of available units, N, must be > 0.  */
+/* Similar to mbtowc(), except that puc and s must not be NULL, n must be > 0,
+   and the NUL character is not treated specially.  */
 /* The variants with _safe suffix are safe, even if the library is compiled
    without --enable-safety.  */
 
@@ -137,7 +138,21 @@
 extern int
        u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n);
 # else
-#  include "utf8-ucs4-unsafe.h"
+extern int
+       u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n);
+static inline int
+u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+  uint8_t c = *s;
+
+  if (c < 0x80)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u8_mbtouc_unsafe_aux (puc, s, n);
+}
 # endif
 #endif
 
@@ -146,7 +161,21 @@
 extern int
        u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n);
 # else
-#  include "utf16-ucs4-unsafe.h"
+extern int
+       u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n);
+static inline int
+u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n)
+{
+  uint16_t c = *s;
+
+  if (c < 0xd800 || c >= 0xe000)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u16_mbtouc_unsafe_aux (puc, s, n);
+}
 # endif
 #endif
 
@@ -179,7 +208,21 @@
 extern int
        u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n);
 # else
-#  include "utf8-ucs4.h"
+extern int
+       u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n);
+static inline int
+u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n)
+{
+  uint8_t c = *s;
+
+  if (c < 0x80)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u8_mbtouc_aux (puc, s, n);
+}
 # endif
 #endif
 
@@ -188,7 +231,21 @@
 extern int
        u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n);
 # else
-#  include "utf16-ucs4.h"
+extern int
+       u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n);
+static inline int
+u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
+{
+  uint16_t c = *s;
+
+  if (c < 0xd800 || c >= 0xe000)
+    {
+      *puc = c;
+      return 1;
+    }
+  else
+    return u16_mbtouc_aux (puc, s, n);
+}
 # endif
 #endif
 
@@ -223,7 +280,19 @@
 extern int
        u8_uctomb (uint8_t *s, ucs4_t uc, int n);
 # else
-#  include "ucs4-utf8.h"
+extern int
+       u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n);
+static inline int
+u8_uctomb (uint8_t *s, ucs4_t uc, int n)
+{
+  if (uc < 0x80 && n > 0)
+    {
+      s[0] = uc;
+      return 1;
+    }
+  else
+    return u8_uctomb_aux (s, uc, n);
+}
 # endif
 #endif
 
@@ -232,7 +301,19 @@
 extern int
        u16_uctomb (uint16_t *s, ucs4_t uc, int n);
 # else
-#  include "ucs4-utf16.h"
+extern int
+       u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n);
+static inline int
+u16_uctomb (uint16_t *s, ucs4_t uc, int n)
+{
+  if (uc < 0xd800 && n > 0)
+    {
+      s[0] = uc;
+      return 1;
+    }
+  else
+    return u16_uctomb_aux (s, uc, n);
+}
 # endif
 #endif
 
--- a/lib/unistr/u16-check.c
+++ b/lib/unistr/u16-check.c
@@ -1,5 +1,5 @@
 /* Check UTF-16 string.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007 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
@@ -29,7 +29,7 @@
 
   while (s < s_end)
     {
-      /* Keep in sync with utf16-ucs4.h and utf16-ucs4.c.  */
+      /* Keep in sync with unistr.h and utf16-ucs4.c.  */
       uint16_t c = *s;
 
       if (c < 0xd800 || c >= 0xe000)
--- a/lib/unistr/u16-chr.c
+++ b/lib/unistr/u16-chr.c
@@ -1,5 +1,5 @@
 /* Search character in piece of UTF-16 string.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2007 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
@@ -22,8 +22,6 @@
 /* Specification.  */
 #include "unistr.h"
 
-#include "ucs4-utf16.h"
-
 uint16_t *
 u16_chr (const uint16_t *s, size_t n, ucs4_t uc)
 {
--- a/lib/unistr/u16-mblen.c
+++ b/lib/unistr/u16-mblen.c
@@ -27,7 +27,7 @@
 {
   if (n > 0)
     {
-      /* Keep in sync with utf16-ucs4.h and utf16-ucs4.c.  */
+      /* Keep in sync with unistr.h and utf16-ucs4.c.  */
       uint16_t c = *s;
 
       if (c < 0xd800 || c >= 0xe000)
--- a/lib/unistr/u16-prev.c
+++ b/lib/unistr/u16-prev.c
@@ -25,7 +25,7 @@
 const uint16_t *
 u16_prev (ucs4_t *puc, const uint16_t *s, const uint16_t *start)
 {
-  /* Keep in sync with utf16-ucs4.h and utf16-ucs4.c.  */
+  /* Keep in sync with unistr.h and utf16-ucs4.c.  */
   if (s != start)
     {
       uint16_t c_1 = s[-1];
--- a/lib/unistr/u16-strchr.c
+++ b/lib/unistr/u16-strchr.c
@@ -1,5 +1,5 @@
 /* Search character in UTF-16 string.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2007 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
@@ -22,8 +22,6 @@
 /* Specification.  */
 #include "unistr.h"
 
-#include "ucs4-utf16.h"
-
 uint16_t *
 u16_strchr (const uint16_t *s, ucs4_t uc)
 {
--- a/lib/unistr/u16-strmblen.c
+++ b/lib/unistr/u16-strmblen.c
@@ -25,7 +25,7 @@
 int
 u16_strmblen (const uint16_t *s)
 {
-  /* Keep in sync with utf16-ucs4.h and utf16-ucs4.c.  */
+  /* Keep in sync with unistr.h and utf16-ucs4.c.  */
   uint16_t c = *s;
 
   if (c < 0xd800 || c >= 0xe000)
--- a/lib/unistr/u16-strmbtouc.c
+++ b/lib/unistr/u16-strmbtouc.c
@@ -25,7 +25,7 @@
 int
 u16_strmbtouc (ucs4_t *puc, const uint16_t *s)
 {
-  /* Keep in sync with utf16-ucs4.h and utf16-ucs4.c.  */
+  /* Keep in sync with unistr.h and utf16-ucs4.c.  */
   uint16_t c = *s;
 
   if (c < 0xd800 || c >= 0xe000)
--- a/lib/unistr/u16-strrchr.c
+++ b/lib/unistr/u16-strrchr.c
@@ -1,5 +1,5 @@
 /* Search character in UTF-16 string.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2007 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
@@ -22,8 +22,6 @@
 /* Specification.  */
 #include "unistr.h"
 
-#include "ucs4-utf16.h"
-
 uint16_t *
 u16_strrchr (const uint16_t *s, ucs4_t uc)
 {
--- a/lib/unistr/u8-check.c
+++ b/lib/unistr/u8-check.c
@@ -1,5 +1,5 @@
 /* Check UTF-8 string.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007 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
@@ -29,7 +29,7 @@
 
   while (s < s_end)
     {
-      /* Keep in sync with utf8-ucs4.h and utf8-ucs4.c.  */
+      /* Keep in sync with unistr.h and utf8-ucs4.c.  */
       uint8_t c = *s;
 
       if (c < 0x80)
--- a/lib/unistr/u8-chr.c
+++ b/lib/unistr/u8-chr.c
@@ -1,5 +1,5 @@
 /* Search character in piece of UTF-8 string.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2007 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
@@ -22,8 +22,6 @@
 /* Specification.  */
 #include "unistr.h"
 
-#include "ucs4-utf8.h"
-
 uint8_t *
 u8_chr (const uint8_t *s, size_t n, ucs4_t uc)
 {
--- a/lib/unistr/u8-mblen.c
+++ b/lib/unistr/u8-mblen.c
@@ -27,7 +27,7 @@
 {
   if (n > 0)
     {
-      /* Keep in sync with utf8-ucs4.h and utf8-ucs4.c.  */
+      /* Keep in sync with unistr.h and utf8-ucs4.c.  */
       uint8_t c = *s;
 
       if (c < 0x80)
--- a/lib/unistr/u8-prev.c
+++ b/lib/unistr/u8-prev.c
@@ -25,7 +25,7 @@
 const uint8_t *
 u8_prev (ucs4_t *puc, const uint8_t *s, const uint8_t *start)
 {
-  /* Keep in sync with utf8-ucs4.h and utf8-ucs4.c.  */
+  /* Keep in sync with unistr.h and utf8-ucs4.c.  */
   if (s != start)
     {
       uint8_t c_1 = s[-1];
--- a/lib/unistr/u8-strchr.c
+++ b/lib/unistr/u8-strchr.c
@@ -1,5 +1,5 @@
 /* Search character in UTF-8 string.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2007 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
@@ -22,8 +22,6 @@
 /* Specification.  */
 #include "unistr.h"
 
-#include "ucs4-utf8.h"
-
 uint8_t *
 u8_strchr (const uint8_t *s, ucs4_t uc)
 {
--- a/lib/unistr/u8-strmblen.c
+++ b/lib/unistr/u8-strmblen.c
@@ -25,7 +25,7 @@
 int
 u8_strmblen (const uint8_t *s)
 {
-  /* Keep in sync with utf8-ucs4.h and utf8-ucs4.c.  */
+  /* Keep in sync with unistr.h and utf8-ucs4.c.  */
   uint8_t c = *s;
 
   if (c < 0x80)
--- a/lib/unistr/u8-strmbtouc.c
+++ b/lib/unistr/u8-strmbtouc.c
@@ -25,7 +25,7 @@
 int
 u8_strmbtouc (ucs4_t *puc, const uint8_t *s)
 {
-  /* Keep in sync with utf8-ucs4.h and utf8-ucs4.c.  */
+  /* Keep in sync with unistr.h and utf8-ucs4.c.  */
   uint8_t c = *s;
 
   if (c < 0x80)
--- a/lib/unistr/u8-strrchr.c
+++ b/lib/unistr/u8-strrchr.c
@@ -1,5 +1,5 @@
 /* Search character in UTF-8 string.
-   Copyright (C) 1999, 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2002, 2006-2007 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
@@ -22,8 +22,6 @@
 /* Specification.  */
 #include "unistr.h"
 
-#include "ucs4-utf8.h"
-
 uint8_t *
 u8_strrchr (const uint8_t *s, ucs4_t uc)
 {
--- a/lib/unistr/ucs4-utf16.c
+++ b/lib/unistr/ucs4-utf16.c
@@ -1,5 +1,5 @@
 /* Conversion UCS-4 to UTF-16.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007 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
@@ -20,7 +20,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "ucs4-utf16.h"
+#include "unistr.h"
 
 int
 u16_uctomb_aux (uint16_t *s, ucs4_t uc, int n)
--- a/lib/unistr/ucs4-utf8.c
+++ b/lib/unistr/ucs4-utf8.c
@@ -1,5 +1,5 @@
 /* Conversion UCS-4 to UTF-8.
-   Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2006-2007 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
@@ -20,7 +20,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "ucs4-utf8.h"
+#include "unistr.h"
 
 int
 u8_uctomb_aux (uint8_t *s, ucs4_t uc, int n)
--- a/lib/unistr/utf16-ucs4-unsafe.c
+++ b/lib/unistr/utf16-ucs4-unsafe.c
@@ -20,7 +20,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "utf16-ucs4-unsafe.h"
+#include "unistr.h"
 
 int
 u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n)
--- a/lib/unistr/utf16-ucs4.c
+++ b/lib/unistr/utf16-ucs4.c
@@ -20,7 +20,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "utf16-ucs4.h"
+#include "unistr.h"
 
 int
 u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n)
--- a/lib/unistr/utf8-ucs4-unsafe.c
+++ b/lib/unistr/utf8-ucs4-unsafe.c
@@ -20,7 +20,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "utf8-ucs4-unsafe.h"
+#include "unistr.h"
 
 int
 u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n)
--- a/lib/unistr/utf8-ucs4.c
+++ b/lib/unistr/utf8-ucs4.c
@@ -20,7 +20,7 @@
 #include <config.h>
 
 /* Specification.  */
-#include "utf8-ucs4.h"
+#include "unistr.h"
 
 int
 u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n)
deleted file mode 100644
--- a/lib/utf16-ucs4-unsafe.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Conversion UTF-16 to UCS-4.
-   Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2001.
-
-   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.  */
-
-#ifndef _UTF16_UCS4_UNSAFE_H
-#define _UTF16_UCS4_UNSAFE_H
-
-#include <stddef.h>
-#include "unitypes.h"
-
-extern int u16_mbtouc_unsafe_aux (ucs4_t *puc, const uint16_t *s, size_t n);
-
-/* Return the length (number of units) of the first character in S, putting
-   its 'ucs4_t' representation in *PUC.
-   The number of available units, N, must be > 0.  */
-static inline int
-u16_mbtouc_unsafe (ucs4_t *puc, const uint16_t *s, size_t n)
-{
-  uint16_t c = *s;
-
-  if (c < 0xd800 || c >= 0xe000)
-    {
-      *puc = c;
-      return 1;
-    }
-  else
-    return u16_mbtouc_unsafe_aux (puc, s, n);
-}
-
-#endif /* _UTF16_UCS4_UNSAFE_H */
deleted file mode 100644
--- a/lib/utf16-ucs4.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Conversion UTF-16 to UCS-4.
-   Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2001.
-
-   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.  */
-
-#ifndef _UTF16_UCS4_H
-#define _UTF16_UCS4_H
-
-#include <stddef.h>
-#include "unitypes.h"
-
-extern int u16_mbtouc_aux (ucs4_t *puc, const uint16_t *s, size_t n);
-
-/* Return the length (number of units) of the first character in S, putting
-   its 'ucs4_t' representation in *PUC.
-   The number of available units, N, must be > 0.  */
-static inline int
-u16_mbtouc (ucs4_t *puc, const uint16_t *s, size_t n)
-{
-  uint16_t c = *s;
-
-  if (c < 0xd800 || c >= 0xe000)
-    {
-      *puc = c;
-      return 1;
-    }
-  else
-    return u16_mbtouc_aux (puc, s, n);
-}
-
-#endif /* _UTF16_UCS4_H */
deleted file mode 100644
--- a/lib/utf8-ucs4-unsafe.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Conversion UTF-8 to UCS-4.
-   Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2001.
-
-   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.  */
-
-#ifndef _UTF8_UCS4_UNSAFE_H
-#define _UTF8_UCS4_UNSAFE_H
-
-#include <stddef.h>
-#include "unitypes.h"
-
-extern int u8_mbtouc_unsafe_aux (ucs4_t *puc, const uint8_t *s, size_t n);
-
-/* Return the length (number of units) of the first character in S, putting
-   its 'ucs4_t' representation in *PUC.
-   The number of available units, N, must be > 0.  */
-static inline int
-u8_mbtouc_unsafe (ucs4_t *puc, const uint8_t *s, size_t n)
-{
-  uint8_t c = *s;
-
-  if (c < 0x80)
-    {
-      *puc = c;
-      return 1;
-    }
-  else
-    return u8_mbtouc_unsafe_aux (puc, s, n);
-}
-
-#endif /* _UTF8_UCS4_UNSAFE_H */
deleted file mode 100644
--- a/lib/utf8-ucs4.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Conversion UTF-8 to UCS-4.
-   Copyright (C) 2001-2002, 2005-2007 Free Software Foundation, Inc.
-   Written by Bruno Haible <bruno@clisp.org>, 2001.
-
-   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.  */
-
-#ifndef _UTF8_UCS4_H
-#define _UTF8_UCS4_H
-
-#include <stddef.h>
-#include "unitypes.h"
-
-extern int u8_mbtouc_aux (ucs4_t *puc, const uint8_t *s, size_t n);
-
-/* Return the length (number of units) of the first character in S, putting
-   its 'ucs4_t' representation in *PUC.
-   The number of available units, N, must be > 0.  */
-static inline int
-u8_mbtouc (ucs4_t *puc, const uint8_t *s, size_t n)
-{
-  uint8_t c = *s;
-
-  if (c < 0x80)
-    {
-      *puc = c;
-      return 1;
-    }
-  else
-    return u8_mbtouc_aux (puc, s, n);
-}
-
-#endif /* _UTF8_UCS4_H */
deleted file mode 100644
--- a/m4/ucs4-utf.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-# ucs4-utf.m4 serial 1
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_UCS4_UTF],
-[
-  dnl Prerequisites of lib/ucs4-utf8.h, lib/ucs4-utf16.h.
-  AC_REQUIRE([AC_C_INLINE])
-])
deleted file mode 100644
--- a/m4/utf-ucs4.m4
+++ /dev/null
@@ -1,11 +0,0 @@
-# utf-ucs4.m4 serial 1
-dnl Copyright (C) 2003 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_UTF_UCS4],
-[
-  dnl Prerequisites of lib/utf8-ucs4.h, lib/utf16-ucs4.h.
-  AC_REQUIRE([AC_C_INLINE])
-])
--- a/modules/ucs4-utf16
+++ b/modules/ucs4-utf16
@@ -2,20 +2,19 @@
 Conversion UCS-4 to UTF-16.
 
 Files:
-lib/ucs4-utf16.h
 lib/unistr/ucs4-utf16.c
-m4/ucs4-utf.m4
 
 Depends-on:
 unitypes
+unistr/base
 
 configure.ac:
-gl_UCS4_UTF
 
 Makefile.am:
-lib_SOURCES += ucs4-utf16.h unistr/ucs4-utf16.c
+lib_SOURCES += unistr/ucs4-utf16.c
 
 Include:
+"unistr.h"
 
 License:
 LGPL
--- a/modules/ucs4-utf8
+++ b/modules/ucs4-utf8
@@ -2,20 +2,19 @@
 Conversion UCS-4 to UTF-8.
 
 Files:
-lib/ucs4-utf8.h
 lib/unistr/ucs4-utf8.c
-m4/ucs4-utf.m4
 
 Depends-on:
 unitypes
+unistr/base
 
 configure.ac:
-gl_UCS4_UTF
 
 Makefile.am:
-lib_SOURCES += ucs4-utf8.h unistr/ucs4-utf8.c
+lib_SOURCES += unistr/ucs4-utf8.c
 
 Include:
+"unistr.h"
 
 License:
 LGPL
--- a/modules/utf16-ucs4
+++ b/modules/utf16-ucs4
@@ -2,21 +2,19 @@
 Conversion UTF-16 to UCS-4.
 
 Files:
-lib/utf16-ucs4.h
 lib/unistr/utf16-ucs4.c
-m4/utf-ucs4.m4
 
 Depends-on:
 unitypes
+unistr/base
 
 configure.ac:
-gl_UTF_UCS4
 
 Makefile.am:
-lib_SOURCES += utf16-ucs4.h unistr/utf16-ucs4.c
+lib_SOURCES += unistr/utf16-ucs4.c
 
 Include:
-"utf16-ucs4.h"
+"unistr.h"
 
 License:
 LGPL
--- a/modules/utf16-ucs4-unsafe
+++ b/modules/utf16-ucs4-unsafe
@@ -2,21 +2,19 @@
 Conversion UTF-16 to UCS-4.
 
 Files:
-lib/utf16-ucs4-unsafe.h
 lib/unistr/utf16-ucs4-unsafe.c
-m4/utf-ucs4.m4
 
 Depends-on:
 unitypes
+unistr/base
 
 configure.ac:
-gl_UTF_UCS4
 
 Makefile.am:
-lib_SOURCES += utf16-ucs4-unsafe.h unistr/utf16-ucs4-unsafe.c
+lib_SOURCES += unistr/utf16-ucs4-unsafe.c
 
 Include:
-"utf16-ucs4-unsafe.h"
+"unistr.h"
 
 License:
 LGPL
--- a/modules/utf8-ucs4
+++ b/modules/utf8-ucs4
@@ -2,21 +2,19 @@
 Conversion UTF-8 to UCS-4.
 
 Files:
-lib/utf8-ucs4.h
 lib/unistr/utf8-ucs4.c
-m4/utf-ucs4.m4
 
 Depends-on:
 unitypes
+unistr/base
 
 configure.ac:
-gl_UTF_UCS4
 
 Makefile.am:
-lib_SOURCES += utf8-ucs4.h unistr/utf8-ucs4.c
+lib_SOURCES += unistr/utf8-ucs4.c
 
 Include:
-"utf8-ucs4.h"
+"unistr.h"
 
 License:
 LGPL
--- a/modules/utf8-ucs4-unsafe
+++ b/modules/utf8-ucs4-unsafe
@@ -2,21 +2,19 @@
 Conversion UTF-8 to UCS-4.
 
 Files:
-lib/utf8-ucs4-unsafe.h
 lib/unistr/utf8-ucs4-unsafe.c
-m4/utf-ucs4.m4
 
 Depends-on:
 unitypes
+unistr/base
 
 configure.ac:
-gl_UTF_UCS4
 
 Makefile.am:
-lib_SOURCES += utf8-ucs4-unsafe.h unistr/utf8-ucs4-unsafe.c
+lib_SOURCES += unistr/utf8-ucs4-unsafe.c
 
 Include:
-"utf8-ucs4-unsafe.h"
+"unistr.h"
 
 License:
 LGPL