Blame wctype/bits/wctype-wchar.h

Packit 6c4009
/* Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit 6c4009
   This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
   The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
   modify it under the terms of the GNU Lesser General Public
Packit 6c4009
   License as published by the Free Software Foundation; either
Packit 6c4009
   version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
   The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
   Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
   You should have received a copy of the GNU Lesser General Public
Packit 6c4009
   License along with the GNU C Library; if not, see
Packit 6c4009
   <http://www.gnu.org/licenses/>.  */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 *	ISO C99 Standard: 7.25
Packit 6c4009
 *	Wide character classification and mapping utilities  <wctype.h>
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef _BITS_WCTYPE_WCHAR_H
Packit 6c4009
#define _BITS_WCTYPE_WCHAR_H 1
Packit 6c4009
Packit 6c4009
#if !defined _WCTYPE_H && !defined _WCHAR_H
Packit 6c4009
#error "Never include <bits/wctype-wchar.h> directly; include <wctype.h> or <wchar.h> instead."
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
#include <bits/types.h>
Packit 6c4009
#include <bits/types/wint_t.h>
Packit 6c4009
Packit 6c4009
/* The definitions in this header are specified to appear in <wctype.h>
Packit 6c4009
   in ISO C99, but in <wchar.h> in Unix98.  _GNU_SOURCE follows C99.  */
Packit 6c4009
Packit 6c4009
/* Scalar type that can hold values which represent locale-specific
Packit 6c4009
   character classifications.  */
Packit 6c4009
typedef unsigned long int wctype_t;
Packit 6c4009
Packit 6c4009
# ifndef _ISwbit
Packit 6c4009
/* The characteristics are stored always in network byte order (big
Packit 6c4009
   endian).  We define the bit value interpretations here dependent on the
Packit 6c4009
   machine's byte order.  */
Packit 6c4009
Packit 6c4009
#  include <endian.h>
Packit 6c4009
#  if __BYTE_ORDER == __BIG_ENDIAN
Packit 6c4009
#   define _ISwbit(bit)	(1 << (bit))
Packit 6c4009
#  else /* __BYTE_ORDER == __LITTLE_ENDIAN */
Packit 6c4009
#   define _ISwbit(bit)	\
Packit 6c4009
	((bit) < 8 ? (int) ((1UL << (bit)) << 24)			      \
Packit 6c4009
	 : ((bit) < 16 ? (int) ((1UL << (bit)) << 8)			      \
Packit 6c4009
	    : ((bit) < 24 ? (int) ((1UL << (bit)) >> 8)			      \
Packit 6c4009
	       : (int) ((1UL << (bit)) >> 24))))
Packit 6c4009
#  endif
Packit 6c4009
Packit 6c4009
enum
Packit 6c4009
{
Packit 6c4009
  __ISwupper = 0,			/* UPPERCASE.  */
Packit 6c4009
  __ISwlower = 1,			/* lowercase.  */
Packit 6c4009
  __ISwalpha = 2,			/* Alphabetic.  */
Packit 6c4009
  __ISwdigit = 3,			/* Numeric.  */
Packit 6c4009
  __ISwxdigit = 4,			/* Hexadecimal numeric.  */
Packit 6c4009
  __ISwspace = 5,			/* Whitespace.  */
Packit 6c4009
  __ISwprint = 6,			/* Printing.  */
Packit 6c4009
  __ISwgraph = 7,			/* Graphical.  */
Packit 6c4009
  __ISwblank = 8,			/* Blank (usually SPC and TAB).  */
Packit 6c4009
  __ISwcntrl = 9,			/* Control character.  */
Packit 6c4009
  __ISwpunct = 10,			/* Punctuation.  */
Packit 6c4009
  __ISwalnum = 11,			/* Alphanumeric.  */
Packit 6c4009
Packit 6c4009
  _ISwupper = _ISwbit (__ISwupper),	/* UPPERCASE.  */
Packit 6c4009
  _ISwlower = _ISwbit (__ISwlower),	/* lowercase.  */
Packit 6c4009
  _ISwalpha = _ISwbit (__ISwalpha),	/* Alphabetic.  */
Packit 6c4009
  _ISwdigit = _ISwbit (__ISwdigit),	/* Numeric.  */
Packit 6c4009
  _ISwxdigit = _ISwbit (__ISwxdigit),	/* Hexadecimal numeric.  */
Packit 6c4009
  _ISwspace = _ISwbit (__ISwspace),	/* Whitespace.  */
Packit 6c4009
  _ISwprint = _ISwbit (__ISwprint),	/* Printing.  */
Packit 6c4009
  _ISwgraph = _ISwbit (__ISwgraph),	/* Graphical.  */
Packit 6c4009
  _ISwblank = _ISwbit (__ISwblank),	/* Blank (usually SPC and TAB).  */
Packit 6c4009
  _ISwcntrl = _ISwbit (__ISwcntrl),	/* Control character.  */
Packit 6c4009
  _ISwpunct = _ISwbit (__ISwpunct),	/* Punctuation.  */
Packit 6c4009
  _ISwalnum = _ISwbit (__ISwalnum)	/* Alphanumeric.  */
Packit 6c4009
};
Packit 6c4009
# endif /* Not _ISwbit  */
Packit 6c4009
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Wide-character classification functions: 7.15.2.1.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/* Test for any wide character for which `iswalpha' or `iswdigit' is
Packit 6c4009
   true.  */
Packit 6c4009
extern int iswalnum (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character for which `iswupper' or 'iswlower' is
Packit 6c4009
   true, or any wide character that is one of a locale-specific set of
Packit 6c4009
   wide-characters for which none of `iswcntrl', `iswdigit',
Packit 6c4009
   `iswpunct', or `iswspace' is true.  */
Packit 6c4009
extern int iswalpha (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any control wide character.  */
Packit 6c4009
extern int iswcntrl (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character that corresponds to a decimal-digit
Packit 6c4009
   character.  */
Packit 6c4009
extern int iswdigit (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character for which `iswprint' is true and
Packit 6c4009
   `iswspace' is false.  */
Packit 6c4009
extern int iswgraph (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character that corresponds to a lowercase letter
Packit 6c4009
   or is one of a locale-specific set of wide characters for which
Packit 6c4009
   none of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true.  */
Packit 6c4009
extern int iswlower (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any printing wide character.  */
Packit 6c4009
extern int iswprint (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any printing wide character that is one of a
Packit 6c4009
   locale-specific et of wide characters for which neither `iswspace'
Packit 6c4009
   nor `iswalnum' is true.  */
Packit 6c4009
extern int iswpunct (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character that corresponds to a locale-specific
Packit 6c4009
   set of wide characters for which none of `iswalnum', `iswgraph', or
Packit 6c4009
   `iswpunct' is true.  */
Packit 6c4009
extern int iswspace (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character that corresponds to an uppercase letter
Packit 6c4009
   or is one of a locale-specific set of wide character for which none
Packit 6c4009
   of `iswcntrl', `iswdigit', `iswpunct', or `iswspace' is true.  */
Packit 6c4009
extern int iswupper (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character that corresponds to a hexadecimal-digit
Packit 6c4009
   character equivalent to that performed be the functions described
Packit 6c4009
   in the previous subclause.  */
Packit 6c4009
extern int iswxdigit (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Test for any wide character that corresponds to a standard blank
Packit 6c4009
   wide character or a locale-specific set of wide characters for
Packit 6c4009
   which `iswalnum' is false.  */
Packit 6c4009
# ifdef __USE_ISOC99
Packit 6c4009
extern int iswblank (wint_t __wc) __THROW;
Packit 6c4009
# endif
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Extensible wide-character classification functions: 7.15.2.2.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/* Construct value that describes a class of wide characters identified
Packit 6c4009
   by the string argument PROPERTY.  */
Packit 6c4009
extern wctype_t wctype (const char *__property) __THROW;
Packit 6c4009
Packit 6c4009
/* Determine whether the wide-character WC has the property described by
Packit 6c4009
   DESC.  */
Packit 6c4009
extern int iswctype (wint_t __wc, wctype_t __desc) __THROW;
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Wide-character case-mapping functions: 7.15.3.1.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
/* Converts an uppercase letter to the corresponding lowercase letter.  */
Packit 6c4009
extern wint_t towlower (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
/* Converts an lowercase letter to the corresponding uppercase letter.  */
Packit 6c4009
extern wint_t towupper (wint_t __wc) __THROW;
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* bits/wctype-wchar.h.  */