Mercurial > gnulib
annotate lib/uniconv/u32-conv-from-enc.c @ 40057:b06060465f09
maint: Run 'make update-copyright'
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Tue, 01 Jan 2019 00:25:11 +0100 |
parents | 10eb9086bea0 |
children |
rev | line source |
---|---|
7951
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* Conversion to UTF-32 from legacy encodings. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
2 Copyright (C) 2002, 2006-2007, 2009-2019 Free Software Foundation, Inc. |
7951
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 |
9307
ad8a75a45dc9
Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7951
diff
changeset
|
4 This program is free software: you can redistribute it and/or modify it |
ad8a75a45dc9
Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7951
diff
changeset
|
5 under the terms of the GNU Lesser General Public License as published |
ad8a75a45dc9
Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7951
diff
changeset
|
6 by the Free Software Foundation; either version 3 of the License, or |
ad8a75a45dc9
Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7951
diff
changeset
|
7 (at your option) any later version. |
7951
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 This program is distributed in the hope that it will be useful, |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
9307
ad8a75a45dc9
Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7951
diff
changeset
|
12 Lesser General Public License for more details. |
7951
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 |
9307
ad8a75a45dc9
Change copyright notice from LGPLv2.0+ to LGPLv3+.
Bruno Haible <bruno@clisp.org>
parents:
7951
diff
changeset
|
14 You should have received a copy of the GNU Lesser General Public License |
19190 | 15 along with this program. If not, see <https://www.gnu.org/licenses/>. */ |
7951
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 /* Written by Bruno Haible <bruno@clisp.org>. */ |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 #include <config.h> |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 /* Specification. */ |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 #include "uniconv.h" |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 #include <errno.h> |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 #include <stdlib.h> |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 #include "striconveha.h" |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 #include "unistr.h" |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 /* Name of UTF-32 or UCS-4 encoding with machine dependent endianness and |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 alignment. */ |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 #if defined _LIBICONV_VERSION |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 # define UTF32_NAME "UCS-4-INTERNAL" |
13885 | 34 #elif ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) && !defined __UCLIBC__ |
7951
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 # define UTF32_NAME "WCHAR_T" |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 #endif |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 #define FUNC u32_conv_from_encoding |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 #define UNIT uint32_t |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 #define U8_TO_U u8_to_u32 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
41 #define U_MBLEN u32_mblen |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
42 #if defined UTF32_NAME |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 # define UTF_NAME UTF32_NAME |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 # define HAVE_UTF_NAME 1 |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 #endif |
aec1ff6acd3e
New module 'uniconv/u32-conv-from-enc'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 #include "u-conv-from-enc.h" |