From 5973fdf3621d596452f3b9d8af3492ccc530600a Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 24 Mar 2007 14:11:25 +0000 Subject: [PATCH] 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. --- ChangeLog | 57 +++++++++++++++++++++++ NEWS | 13 ++++++ lib/striconveh.c | 2 - lib/ucs4-utf16.h | 43 ------------------ lib/ucs4-utf8.h | 43 ------------------ lib/unistr.h | 101 +++++++++++++++++++++++++++++++++++++---- lib/unistr/u16-check.c | 4 +- lib/unistr/u16-chr.c | 4 +- lib/unistr/u16-mblen.c | 2 +- lib/unistr/u16-prev.c | 2 +- lib/unistr/u16-strchr.c | 4 +- lib/unistr/u16-strmblen.c | 2 +- lib/unistr/u16-strmbtouc.c | 2 +- lib/unistr/u16-strrchr.c | 4 +- lib/unistr/u8-check.c | 4 +- lib/unistr/u8-chr.c | 4 +- lib/unistr/u8-mblen.c | 2 +- lib/unistr/u8-prev.c | 2 +- lib/unistr/u8-strchr.c | 4 +- lib/unistr/u8-strmblen.c | 2 +- lib/unistr/u8-strmbtouc.c | 2 +- lib/unistr/u8-strrchr.c | 4 +- lib/unistr/ucs4-utf16.c | 4 +- lib/unistr/ucs4-utf8.c | 4 +- lib/unistr/utf16-ucs4-unsafe.c | 2 +- lib/unistr/utf16-ucs4.c | 2 +- lib/unistr/utf8-ucs4-unsafe.c | 2 +- lib/unistr/utf8-ucs4.c | 2 +- lib/utf16-ucs4-unsafe.h | 45 ------------------ lib/utf16-ucs4.h | 45 ------------------ lib/utf8-ucs4-unsafe.h | 45 ------------------ lib/utf8-ucs4.h | 45 ------------------ m4/ucs4-utf.m4 | 11 ----- m4/utf-ucs4.m4 | 11 ----- modules/ucs4-utf16 | 7 ++- modules/ucs4-utf8 | 7 ++- modules/utf16-ucs4 | 8 ++-- modules/utf16-ucs4-unsafe | 8 ++-- modules/utf8-ucs4 | 8 ++-- modules/utf8-ucs4-unsafe | 8 ++-- 40 files changed, 205 insertions(+), 366 deletions(-) delete mode 100644 lib/ucs4-utf16.h delete mode 100644 lib/ucs4-utf8.h delete mode 100644 lib/utf16-ucs4-unsafe.h delete mode 100644 lib/utf16-ucs4.h delete mode 100644 lib/utf8-ucs4-unsafe.h delete mode 100644 lib/utf8-ucs4.h delete mode 100644 m4/ucs4-utf.m4 delete mode 100644 m4/utf-ucs4.m4 diff --git a/ChangeLog b/ChangeLog index 804e38178..9e738cd49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,62 @@ 2007-03-24 Bruno Haible + * 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 + * 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 5a0f654cb..ef6734d2e 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 56c0c0478..8bee60ae8 100644 --- a/lib/striconveh.c +++ b/lib/striconveh.c @@ -28,8 +28,6 @@ #if HAVE_ICONV # include -# 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 8450a99f5..000000000 --- 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 , 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 -#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 e8c3e7f24..000000000 --- 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 , 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 -#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 5643ea72b..5bab492e1 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 a2e483e1b..6a6c112af 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 , 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 6ca1458b6..66ce48629 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 , 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 a581bfc24..b952f075c 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 9601ed7a1..422b70f9e 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 4b152ecab..5a9936571 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 , 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 55fb31d08..dc6d6c777 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 cf8174dfc..7fda3b590 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 bf3f4ce88..da46d92d1 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 , 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 c178c994b..e5688439e 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 , 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 c94ce6666..81234cc41 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 , 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 12ecd833c..4d42b493b 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 b3b56ddcb..2d8ae4593 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 cce594cb4..57db8d4bd 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 , 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 5084c2485..00fd66a47 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 6cf3f469b..ebdb7044c 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 95f7d9f0f..dedad5a11 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 , 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 c79c3f5ac..7ea56a18b 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 , 2002. This program is free software; you can redistribute it and/or modify it @@ -20,7 +20,7 @@ #include /* 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 82034382c..f9fcee05a 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 , 2002. This program is free software; you can redistribute it and/or modify it @@ -20,7 +20,7 @@ #include /* 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 201432366..bc41205bb 100644 --- a/lib/unistr/utf16-ucs4-unsafe.c +++ b/lib/unistr/utf16-ucs4-unsafe.c @@ -20,7 +20,7 @@ #include /* 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 4fa363394..8cef32999 100644 --- a/lib/unistr/utf16-ucs4.c +++ b/lib/unistr/utf16-ucs4.c @@ -20,7 +20,7 @@ #include /* 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 c40da0ef4..00ba199b3 100644 --- a/lib/unistr/utf8-ucs4-unsafe.c +++ b/lib/unistr/utf8-ucs4-unsafe.c @@ -20,7 +20,7 @@ #include /* 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 707953b93..15343db2c 100644 --- a/lib/unistr/utf8-ucs4.c +++ b/lib/unistr/utf8-ucs4.c @@ -20,7 +20,7 @@ #include /* 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 ca4670369..000000000 --- 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 , 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 -#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 37e289d0d..000000000 --- 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 , 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 -#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 d956f0bc1..000000000 --- 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 , 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 -#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 feaf83661..000000000 --- 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 , 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 -#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 73a661864..000000000 --- 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 f64857757..000000000 --- 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 54ca0ea67..05daefb00 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 7048494a6..5dd97d88a 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 442183f94..998047946 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 dd6f1f312..e438f383d 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 6a2182826..eb1a100a0 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 65bf23918..b0417f510 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 -- 2.11.0