1 /* Display width functions.
2 Copyright (C) 2001-2002, 2005, 2007 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify it
5 under the terms of the GNU Lesser 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.
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.
14 You should have received a copy of the GNU Lesser General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 /* Get locale_charset() declaration. */
26 #include "localcharset.h"
35 /* These functions are locale dependent. The encoding argument identifies
36 the encoding (e.g. "ISO-8859-2" for Polish). */
38 /* Determine number of column positions required for UC. */
40 uc_width (ucs4_t uc, const char *encoding);
42 /* Determine number of column positions required for first N units
43 (or fewer if S ends before this) in S. */
45 u8_width (const uint8_t *s, size_t n, const char *encoding);
47 u16_width (const uint16_t *s, size_t n, const char *encoding);
49 u32_width (const uint32_t *s, size_t n, const char *encoding);
51 /* Determine number of column positions required for S. */
53 u8_strwidth (const uint8_t *s, const char *encoding);
55 u16_strwidth (const uint16_t *s, const char *encoding);
57 u32_strwidth (const uint32_t *s, const char *encoding);
64 #endif /* _UNIWIDTH_H */