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