summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog57
-rw-r--r--NEWS13
-rw-r--r--lib/striconveh.c2
-rw-r--r--lib/ucs4-utf16.h43
-rw-r--r--lib/ucs4-utf8.h43
-rw-r--r--lib/unistr.h101
-rw-r--r--lib/unistr/u16-check.c4
-rw-r--r--lib/unistr/u16-chr.c4
-rw-r--r--lib/unistr/u16-mblen.c2
-rw-r--r--lib/unistr/u16-prev.c2
-rw-r--r--lib/unistr/u16-strchr.c4
-rw-r--r--lib/unistr/u16-strmblen.c2
-rw-r--r--lib/unistr/u16-strmbtouc.c2
-rw-r--r--lib/unistr/u16-strrchr.c4
-rw-r--r--lib/unistr/u8-check.c4
-rw-r--r--lib/unistr/u8-chr.c4
-rw-r--r--lib/unistr/u8-mblen.c2
-rw-r--r--lib/unistr/u8-prev.c2
-rw-r--r--lib/unistr/u8-strchr.c4
-rw-r--r--lib/unistr/u8-strmblen.c2
-rw-r--r--lib/unistr/u8-strmbtouc.c2
-rw-r--r--lib/unistr/u8-strrchr.c4
-rw-r--r--lib/unistr/ucs4-utf16.c4
-rw-r--r--lib/unistr/ucs4-utf8.c4
-rw-r--r--lib/unistr/utf16-ucs4-unsafe.c2
-rw-r--r--lib/unistr/utf16-ucs4.c2
-rw-r--r--lib/unistr/utf8-ucs4-unsafe.c2
-rw-r--r--lib/unistr/utf8-ucs4.c2
-rw-r--r--lib/utf16-ucs4-unsafe.h45
-rw-r--r--lib/utf16-ucs4.h45
-rw-r--r--lib/utf8-ucs4-unsafe.h45
-rw-r--r--lib/utf8-ucs4.h45
-rw-r--r--m4/ucs4-utf.m411
-rw-r--r--m4/utf-ucs4.m411
-rw-r--r--modules/ucs4-utf167
-rw-r--r--modules/ucs4-utf87
-rw-r--r--modules/utf16-ucs48
-rw-r--r--modules/utf16-ucs4-unsafe8
-rw-r--r--modules/utf8-ucs48
-rw-r--r--modules/utf8-ucs4-unsafe8
40 files changed, 205 insertions, 366 deletions
diff --git a/ChangeLog b/ChangeLog
index 804e381788..9e738cd490 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,62 @@
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
arguments of isspace, isalpha, isalnum, isdigit to 'unsigned char'.
diff --git a/NEWS b/NEWS
index 5a0f654cb8..ef6734d2ed 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,19 @@ User visible incompatible changes
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
diff --git a/lib/striconveh.c b/lib/striconveh.c
index 56c0c04782..8bee60ae8b 100644
--- 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
diff --git a/lib/ucs4-utf16.h b/lib/ucs4-utf16.h
deleted file mode 100644
index 8450a99f53..0000000000
--- 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 */
diff --git a/lib/ucs4-utf8.h b/lib/ucs4-utf8.h
deleted file mode 100644
index e8c3e7f24d..0000000000
--- 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 */
diff --git a/lib/unistr.h b/lib/unistr.h
index 5643ea72b4..5bab492e19 100644
--- 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 @@ extern int
/* 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
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
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 @@ u32_mbtouc_unsafe (ucs4_t *puc, const uint32_t *s, size_t n)
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
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 @@ u32_mbtouc (ucs4_t *puc, const uint32_t *s, size_t n)
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
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
diff --git a/lib/unistr/u16-check.c b/lib/unistr/u16-check.c
index a2e483e1b6..6a6c112af2 100644
--- 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 @@ u16_check (const uint16_t *s, size_t n)
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)
diff --git a/lib/unistr/u16-chr.c b/lib/unistr/u16-chr.c
index 6ca1458b63..66ce486297 100644
--- 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)
{
diff --git a/lib/unistr/u16-mblen.c b/lib/unistr/u16-mblen.c
index a581bfc241..b952f075c0 100644
--- a/lib/unistr/u16-mblen.c
+++ b/lib/unistr/u16-mblen.c
@@ -27,7 +27,7 @@ u16_mblen (const uint16_t *s, size_t n)
{
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)
diff --git a/lib/unistr/u16-prev.c b/lib/unistr/u16-prev.c
index 9601ed7a14..422b70f9e1 100644
--- 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];
diff --git a/lib/unistr/u16-strchr.c b/lib/unistr/u16-strchr.c
index 4b152ecabe..5a9936571a 100644
--- 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)
{
diff --git a/lib/unistr/u16-strmblen.c b/lib/unistr/u16-strmblen.c
index 55fb31d08c..dc6d6c7771 100644
--- 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)
diff --git a/lib/unistr/u16-strmbtouc.c b/lib/unistr/u16-strmbtouc.c
index cf8174dfcf..7fda3b5905 100644
--- 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)
diff --git a/lib/unistr/u16-strrchr.c b/lib/unistr/u16-strrchr.c
index bf3f4ce881..da46d92d12 100644
--- 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)
{
diff --git a/lib/unistr/u8-check.c b/lib/unistr/u8-check.c
index c178c994bb..e5688439e0 100644
--- 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 @@ u8_check (const uint8_t *s, size_t n)
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)
diff --git a/lib/unistr/u8-chr.c b/lib/unistr/u8-chr.c
index c94ce66669..81234cc411 100644
--- 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)
{
diff --git a/lib/unistr/u8-mblen.c b/lib/unistr/u8-mblen.c
index 12ecd833c5..4d42b493b8 100644
--- a/lib/unistr/u8-mblen.c
+++ b/lib/unistr/u8-mblen.c
@@ -27,7 +27,7 @@ u8_mblen (const uint8_t *s, size_t n)
{
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)
diff --git a/lib/unistr/u8-prev.c b/lib/unistr/u8-prev.c
index b3b56ddcb4..2d8ae45930 100644
--- 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];
diff --git a/lib/unistr/u8-strchr.c b/lib/unistr/u8-strchr.c
index cce594cb44..57db8d4bd4 100644
--- 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)
{
diff --git a/lib/unistr/u8-strmblen.c b/lib/unistr/u8-strmblen.c
index 5084c24850..00fd66a476 100644
--- 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)
diff --git a/lib/unistr/u8-strmbtouc.c b/lib/unistr/u8-strmbtouc.c
index 6cf3f469bd..ebdb7044cd 100644
--- 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)
diff --git a/lib/unistr/u8-strrchr.c b/lib/unistr/u8-strrchr.c
index 95f7d9f0f3..dedad5a111 100644
--- 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)
{
diff --git a/lib/unistr/ucs4-utf16.c b/lib/unistr/ucs4-utf16.c
index c79c3f5acf..7ea56a18ba 100644
--- 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)
diff --git a/lib/unistr/ucs4-utf8.c b/lib/unistr/ucs4-utf8.c
index 82034382c0..f9fcee05a0 100644
--- 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)
diff --git a/lib/unistr/utf16-ucs4-unsafe.c b/lib/unistr/utf16-ucs4-unsafe.c
index 2014323661..bc41205bb2 100644
--- 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)
diff --git a/lib/unistr/utf16-ucs4.c b/lib/unistr/utf16-ucs4.c
index 4fa363394e..8cef329993 100644
--- 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)
diff --git a/lib/unistr/utf8-ucs4-unsafe.c b/lib/unistr/utf8-ucs4-unsafe.c
index c40da0ef4d..00ba199b3f 100644
--- 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)
diff --git a/lib/unistr/utf8-ucs4.c b/lib/unistr/utf8-ucs4.c
index 707953b93a..15343db2c0 100644
--- 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)
diff --git a/lib/utf16-ucs4-unsafe.h b/lib/utf16-ucs4-unsafe.h
deleted file mode 100644
index ca46703696..0000000000
--- 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 */
diff --git a/lib/utf16-ucs4.h b/lib/utf16-ucs4.h
deleted file mode 100644
index 37e289d0dd..0000000000
--- 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 */
diff --git a/lib/utf8-ucs4-unsafe.h b/lib/utf8-ucs4-unsafe.h
deleted file mode 100644
index d956f0bc14..0000000000
--- 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 */
diff --git a/lib/utf8-ucs4.h b/lib/utf8-ucs4.h
deleted file mode 100644
index feaf836616..0000000000
--- 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 */
diff --git a/m4/ucs4-utf.m4 b/m4/ucs4-utf.m4
deleted file mode 100644
index 73a6618644..0000000000
--- 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])
-])
diff --git a/m4/utf-ucs4.m4 b/m4/utf-ucs4.m4
deleted file mode 100644
index f648577576..0000000000
--- 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])
-])
diff --git a/modules/ucs4-utf16 b/modules/ucs4-utf16
index 54ca0ea67f..05daefb00a 100644
--- a/modules/ucs4-utf16
+++ b/modules/ucs4-utf16
@@ -2,20 +2,19 @@ Description:
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
diff --git a/modules/ucs4-utf8 b/modules/ucs4-utf8
index 7048494a61..5dd97d88a2 100644
--- a/modules/ucs4-utf8
+++ b/modules/ucs4-utf8
@@ -2,20 +2,19 @@ Description:
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
diff --git a/modules/utf16-ucs4 b/modules/utf16-ucs4
index 442183f947..9980479463 100644
--- a/modules/utf16-ucs4
+++ b/modules/utf16-ucs4
@@ -2,21 +2,19 @@ Description:
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
diff --git a/modules/utf16-ucs4-unsafe b/modules/utf16-ucs4-unsafe
index dd6f1f3126..e438f383da 100644
--- a/modules/utf16-ucs4-unsafe
+++ b/modules/utf16-ucs4-unsafe
@@ -2,21 +2,19 @@ Description:
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
diff --git a/modules/utf8-ucs4 b/modules/utf8-ucs4
index 6a21828269..eb1a100a00 100644
--- a/modules/utf8-ucs4
+++ b/modules/utf8-ucs4
@@ -2,21 +2,19 @@ Description:
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
diff --git a/modules/utf8-ucs4-unsafe b/modules/utf8-ucs4-unsafe
index 65bf23918b..b0417f5105 100644
--- a/modules/utf8-ucs4-unsafe
+++ b/modules/utf8-ucs4-unsafe
@@ -2,21 +2,19 @@ Description:
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