Mercurial > hg > octave-nkf > gnulib-hg
annotate lib/uniwidth.in.h @ 17848:ab58d4870664
version-etc: new year
* doc/gnulib.texi:
* lib/version-etc.c (COPYRIGHT_YEAR): Update copyright date.
* all files: Run 'make update-copyright'.
author | Paul Eggert <eggert@cs.ucla.edu> |
---|---|
date | Thu, 01 Jan 2015 01:38:23 +0000 |
parents | 344018b6e5d7 |
children |
rev | line source |
---|---|
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
1 /* Display width functions. |
17848 | 2 Copyright (C) 2001-2002, 2005, 2007, 2009-2015 Free Software Foundation, |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
3 Inc. |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
4 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
5 This program is free software: you can redistribute it and/or modify it |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
6 under the terms of the GNU Lesser General Public License as published |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
7 by the Free Software Foundation; either version 3 of the License, or |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
8 (at your option) any later version. |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
9 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
10 This program is distributed in the hope that it will be useful, |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
11 but WITHOUT ANY WARRANTY; without even the implied warranty of |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
13 Lesser General Public License for more details. |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
14 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public License |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
16 along with this program. If not, see <http://www.gnu.org/licenses/>. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
17 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
18 #ifndef _UNIWIDTH_H |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
19 #define _UNIWIDTH_H |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
20 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
21 #include "unitypes.h" |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
22 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
23 /* Get size_t. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
24 #include <stddef.h> |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
25 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
26 /* Get locale_charset() declaration. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
27 #include "localcharset.h" |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
28 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
29 #ifdef __cplusplus |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
30 extern "C" { |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
31 #endif |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
32 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
33 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
34 /* Display width. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
35 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
36 /* These functions are locale dependent. The encoding argument identifies |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
37 the encoding (e.g. "ISO-8859-2" for Polish). */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
38 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
39 /* Determine number of column positions required for UC. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
40 extern int |
16128
6beadb731202
mark functions with const and pure attributes
Jim Meyering <meyering@redhat.com>
parents:
14079
diff
changeset
|
41 uc_width (ucs4_t uc, const char *encoding) |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
42 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
43 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
44 /* Determine number of column positions required for first N units |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
45 (or fewer if S ends before this) in S. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
46 extern int |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
47 u8_width (const uint8_t *s, size_t n, const char *encoding) |
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
48 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
49 extern int |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
50 u16_width (const uint16_t *s, size_t n, const char *encoding) |
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
51 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
52 extern int |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
53 u32_width (const uint32_t *s, size_t n, const char *encoding) |
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
54 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
55 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
56 /* Determine number of column positions required for S. */ |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
57 extern int |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
58 u8_strwidth (const uint8_t *s, const char *encoding) |
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
59 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
60 extern int |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
61 u16_strwidth (const uint16_t *s, const char *encoding) |
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
62 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
63 extern int |
16716
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
64 u32_strwidth (const uint32_t *s, const char *encoding) |
079fb1e73828
Enable common subexpression optimization in GCC.
Bruno Haible <bruno@clisp.org>
parents:
16201
diff
changeset
|
65 _UC_ATTRIBUTE_PURE; |
13354
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
66 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
67 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
68 #ifdef __cplusplus |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
69 } |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
70 #endif |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
71 |
86634e33e086
New module 'libunistring-optional'.
Bruno Haible <bruno@clisp.org>
parents:
diff
changeset
|
72 #endif /* _UNIWIDTH_H */ |