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