Import upstream version 1.28
[debian/tar] / gnu / uniwidth.in.h
1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Display width functions.
4    Copyright (C) 2001-2002, 2005, 2007, 2009-2014 Free Software Foundation,
5    Inc.
6
7    This program is free software: you can redistribute it and/or modify it
8    under the terms of the GNU General Public License as published
9    by the Free Software Foundation; either version 3 of the License, or
10    (at your option) any later version.
11
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15    General Public License for more details.
16
17    You should have received a copy of the GNU General Public License
18    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
19
20 #ifndef _UNIWIDTH_H
21 #define _UNIWIDTH_H
22
23 #include "unitypes.h"
24
25 /* Get size_t.  */
26 #include <stddef.h>
27
28 /* Get locale_charset() declaration.  */
29 #include "localcharset.h"
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35
36 /* Display width.  */
37
38 /* These functions are locale dependent.  The encoding argument identifies
39    the encoding (e.g. "ISO-8859-2" for Polish).  */
40
41 /* Determine number of column positions required for UC.  */
42 extern int
43        uc_width (ucs4_t uc, const char *encoding)
44        _UC_ATTRIBUTE_PURE;
45
46 /* Determine number of column positions required for first N units
47    (or fewer if S ends before this) in S.  */
48 extern int
49        u8_width (const uint8_t *s, size_t n, const char *encoding)
50        _UC_ATTRIBUTE_PURE;
51 extern int
52        u16_width (const uint16_t *s, size_t n, const char *encoding)
53        _UC_ATTRIBUTE_PURE;
54 extern int
55        u32_width (const uint32_t *s, size_t n, const char *encoding)
56        _UC_ATTRIBUTE_PURE;
57
58 /* Determine number of column positions required for S.  */
59 extern int
60        u8_strwidth (const uint8_t *s, const char *encoding)
61        _UC_ATTRIBUTE_PURE;
62 extern int
63        u16_strwidth (const uint16_t *s, const char *encoding)
64        _UC_ATTRIBUTE_PURE;
65 extern int
66        u32_strwidth (const uint32_t *s, const char *encoding)
67        _UC_ATTRIBUTE_PURE;
68
69
70 #ifdef __cplusplus
71 }
72 #endif
73
74 #endif /* _UNIWIDTH_H */