Blame lib/uniwidth.in.h

Packit 709fb3
/* Display width functions.
Packit 709fb3
   Copyright (C) 2001-2002, 2005, 2007, 2009-2017 Free Software Foundation,
Packit 709fb3
   Inc.
Packit 709fb3
Packit 709fb3
   This program is free software: you can redistribute it and/or modify it
Packit 709fb3
   under the terms of the GNU General Public License as published
Packit 709fb3
   by the Free Software Foundation; either version 3 of the License, or
Packit 709fb3
   (at your option) any later version.
Packit 709fb3
Packit 709fb3
   This program is distributed in the hope that it will be useful,
Packit 709fb3
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 709fb3
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 709fb3
   General Public License for more details.
Packit 709fb3
Packit 709fb3
   You should have received a copy of the GNU General Public License
Packit 709fb3
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit 709fb3
Packit 709fb3
#ifndef _UNIWIDTH_H
Packit 709fb3
#define _UNIWIDTH_H
Packit 709fb3
Packit 709fb3
#include "unitypes.h"
Packit 709fb3
Packit 709fb3
/* Get size_t.  */
Packit 709fb3
#include <stddef.h>
Packit 709fb3
Packit 709fb3
/* Get locale_charset() declaration.  */
Packit 709fb3
#include "localcharset.h"
Packit 709fb3
Packit 709fb3
#ifdef __cplusplus
Packit 709fb3
extern "C" {
Packit 709fb3
#endif
Packit 709fb3
Packit 709fb3
Packit 709fb3
/* Display width.  */
Packit 709fb3
Packit 709fb3
/* These functions are locale dependent.  The encoding argument identifies
Packit 709fb3
   the encoding (e.g. "ISO-8859-2" for Polish).  */
Packit 709fb3
Packit 709fb3
/* Determine number of column positions required for UC.  */
Packit 709fb3
extern int
Packit 709fb3
       uc_width (ucs4_t uc, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
Packit 709fb3
/* Determine number of column positions required for first N units
Packit 709fb3
   (or fewer if S ends before this) in S.  */
Packit 709fb3
extern int
Packit 709fb3
       u8_width (const uint8_t *s, size_t n, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
extern int
Packit 709fb3
       u16_width (const uint16_t *s, size_t n, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
extern int
Packit 709fb3
       u32_width (const uint32_t *s, size_t n, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
Packit 709fb3
/* Determine number of column positions required for S.  */
Packit 709fb3
extern int
Packit 709fb3
       u8_strwidth (const uint8_t *s, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
extern int
Packit 709fb3
       u16_strwidth (const uint16_t *s, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
extern int
Packit 709fb3
       u32_strwidth (const uint32_t *s, const char *encoding)
Packit 709fb3
       _UC_ATTRIBUTE_PURE;
Packit 709fb3
Packit 709fb3
Packit 709fb3
#ifdef __cplusplus
Packit 709fb3
}
Packit 709fb3
#endif
Packit 709fb3
Packit 709fb3
#endif /* _UNIWIDTH_H */