+++ /dev/null
-/** @file\r
- Wide character classification and mapping utilities.\r
-\r
- The following macros are defined in this file:<BR>\r
-@verbatim\r
- WEOF Wide char version of end-of-file.\r
-@endverbatim\r
-\r
- The following types are defined in this file:<BR>\r
-@verbatim\r
- wint_t Type capable of holding all wchar_t values and WEOF.\r
- wctrans_t A type for holding locale-specific character mappings.\r
- wctype_t Type for holding locale-specific character classifications.\r
-@endverbatim\r
-\r
- The following functions are declared in this file:<BR>\r
-@verbatim\r
- ############### Wide Character Classification Functions\r
- int iswalnum (wint_t);\r
- int iswalpha (wint_t);\r
- int iswcntrl (wint_t);\r
- int iswdigit (wint_t);\r
- int iswgraph (wint_t);\r
- int iswlower (wint_t);\r
- int iswprint (wint_t);\r
- int iswpunct (wint_t);\r
- int iswblank (wint_t);\r
- int iswspace (wint_t);\r
- int iswupper (wint_t);\r
- int iswxdigit (wint_t);\r
-\r
- ############### Extensible Wide Character Classification Functions\r
- wctype_t wctype (const char *);\r
- int iswctype (wint_t, wctype_t);\r
-\r
- ############### Wide Character Case Mapping Utilities\r
- wint_t towlower (wint_t);\r
- wint_t towupper (wint_t);\r
-\r
- ############### Extensible Wide Character Case Mapping Utilities\r
- wctrans_t wctrans (const char *);\r
- wint_t towctrans (wint_t, wctrans_t);\r
-@endverbatim\r
-\r
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
- This program and the accompanying materials are licensed and made available under\r
- the terms and conditions of the BSD License that accompanies this distribution.\r
- The full text of the license may be found at\r
- http://opensource.org/licenses/bsd-license.\r
-\r
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
- * Copyright (c)1999 Citrus Project,\r
- * All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND\r
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\r
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\r
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\r
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\r
- * SUCH DAMAGE.\r
- *\r
- * citrus Id: wctype.h,v 1.4 2000/12/21 01:50:21 itojun Exp\r
-\r
- NetBSD: wctype.h,v 1.6 2005/02/03 04:39:32 perry Exp\r
-**/\r
-#ifndef _WCTYPE_H_\r
-#define _WCTYPE_H_\r
-\r
-#include <sys/EfiCdefs.h>\r
-#include <machine/ansi.h>\r
-\r
-#ifdef _EFI_WINT_T\r
- /** wint_t is an integer type unchanged by default argument promotions that can\r
- hold any value corresponding to members of the extended character set, as\r
- well as at least one value that does not correspond to any member of the\r
- extended character set: WEOF.\r
- */\r
- typedef _EFI_WINT_T wint_t;\r
- #undef _BSD_WINT_T_\r
- #undef _EFI_WINT_T\r
-#endif\r
-\r
-#ifdef _BSD_WCTRANS_T_\r
- /** A scalar type for holding locale-specific character mappings. */\r
- typedef wint_t (*wctrans_t)(wint_t);\r
- #undef _BSD_WCTRANS_T_\r
-#endif\r
-\r
-#ifdef _BSD_WCTYPE_T_\r
- /** A scalar type capable of holding values representing locale-specific\r
- character classifications. */\r
- typedef _BSD_WCTYPE_T_ wctype_t;\r
- #undef _BSD_WCTYPE_T_\r
-#endif\r
-\r
-#ifndef WEOF\r
- /** WEOF expands to a constant expression of type wint_t whose value does not\r
- correspond to any member of the extended character set. It is accepted\r
- (and returned) by several functions, declared in this file, to indicate\r
- end-of-file, that is, no more input from a stream. It is also used as a\r
- wide character value that does not correspond to any member of the\r
- extended character set.\r
- */\r
- #define WEOF ((wint_t)-1)\r
-#endif\r
-\r
-__BEGIN_DECLS\r
- /** Test for any wide character for which iswalpha or iswdigit is TRUE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswalnum (wint_t WC);\r
-\r
- /** Test for any wide character for which iswupper or iswlower is TRUE,\r
- OR, a locale-specific character where none of iswcntrl, iswdigit,\r
- iswpunct, or iswspace is TRUE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswalpha (wint_t WC);\r
-\r
- /** Test for any wide control character.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswcntrl (wint_t WC);\r
-\r
- /** Test if the value of WC is a wide character that corresponds to a decimal digit.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswdigit (wint_t WC);\r
-\r
- /** Test for wide characters for which iswprint is TRUE and iswspace is FALSE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswgraph (wint_t WC);\r
-\r
- /** The iswlower function tests for any wide character that corresponds to a\r
- lowercase letter or is one of a locale-specific set of wide characters\r
- for which none of iswcntrl, iswdigit, iswpunct, or iswspace is TRUE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswlower (wint_t WC);\r
-\r
- /** Test for any printing wide character.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswprint (wint_t WC);\r
-\r
- /** The iswpunct function tests for any printing wide character that is one\r
- of a locale-specific set of punctuation wide characters for which\r
- neither iswspace nor iswalnum is TRUE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswpunct (wint_t WC);\r
-\r
- /** Test for standard blank characters or locale-specific characters\r
- for which iswspace is TRUE and are used to separate words within a line\r
- of text. In the "C" locale, iswblank only returns TRUE for the standard\r
- blank characters space (L' ') and horizontal tab (L'\t').\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswblank (wint_t WC);\r
-\r
- /** The iswspace function tests for any wide character that corresponds to a\r
- locale-specific set of white-space wide characters for which none of\r
- iswalnum, iswgraph, or iswpunct is TRUE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswspace (wint_t WC);\r
-\r
- /** Tests for any wide character that corresponds to an uppercase letter or\r
- is one of a locale-specific set of wide characters for which none of\r
- iswcntrl, iswdigit, iswpunct, or iswspace is TRUE.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswupper (wint_t WC);\r
-\r
- /** The iswxdigit function tests for any wide character that corresponds to a\r
- hexadecimal-digit character.\r
-\r
- @param[in] WC The wide character to be classified.\r
-\r
- @return Returns non-zero (TRUE) if and only if the value of WC conforms\r
- to the classification described for this function.\r
- */\r
- int iswxdigit (wint_t WC);\r
-\r
- /** Construct a value that describes a class of wide characters, identified\r
- by the string pointed to by Desc. The constructed value is suitable for\r
- use as the second argument to the iswctype function.\r
-\r
- The following strings name classes of wide characters that the iswctype\r
- function is able to test against. These strings are valid in all locales\r
- as Desc arguments to wctype().\r
- - "alnum"\r
- - "alpha"\r
- - "blank"\r
- - "cntrl"\r
- - "digit"\r
- - "graph"\r
- - "lower"\r
- - "print"\r
- - "punct"\r
- - "space"\r
- - "upper"\r
- - "xdigit\r
-\r
- @param[in] Desc A pointer to a multibyte character string naming a\r
- class of wide characters.\r
-\r
- @return If Desc identifies a valid class of wide characters in the\r
- current locale, the wctype function returns a nonzero value that\r
- is valid as the second argument to the iswctype function;\r
- otherwise, it returns zero.\r
- */\r
- wctype_t wctype (const char *Desc);\r
-\r
- /** Determine whether the wide character WC has the property described by Wct.\r
-\r
- @param[in] WC The wide character to be classified.\r
- @param[in] Wct A value describing a class of wide characters.\r
-\r
- @return The iswctype function returns nonzero (TRUE) if and only if the\r
- value of the wide character WC has the property described by Wct.\r
- */\r
- int iswctype (wint_t WC, wctype_t Wct);\r
-\r
- /** Convert an uppercase letter to a corresponding lowercase letter.\r
-\r
- @param[in] WC The wide character to be converted.\r
-\r
- @return If the argument is a wide character for which iswupper is TRUE\r
- and there are one or more corresponding wide characters, as\r
- specified by the current locale, for which iswlower is TRUE, the\r
- towlower function returns one of the corresponding wide\r
- characters (always the same one for any given locale); otherwise,\r
- the argument is returned unchanged.\r
- */\r
- wint_t towlower (wint_t WC);\r
-\r
- /** Convert a lowercase letter to a corresponding uppercase letter.\r
-\r
- @param[in] WC The wide character to be converted.\r
-\r
- @return If the argument is a wide character for which iswlower is TRUE\r
- and there are one or more corresponding wide characters, as\r
- specified by the current locale, for which iswupper is TRUE, the\r
- towupper function returns one of the corresponding wide\r
- characters (always the same one for any given locale); otherwise,\r
- the argument is returned unchanged.\r
- */\r
- wint_t towupper (wint_t WC);\r
-\r
- /** Construct a value that describes a mapping between wide characters\r
- identified by the string argument, S.\r
-\r
- The strings listed below are valid in all locales as the S argument to\r
- the wctrans function.\r
- - "tolower"\r
- - "toupper"\r
-\r
- @param[in] S A pointer to a multibyte character string naming a\r
- mapping between wide characters.\r
-\r
- @return If S identifies a valid mapping of wide characters in the current\r
- locale, the wctrans function returns a nonzero value that is\r
- valid as the second argument to the towctrans function;\r
- otherwise, it returns zero.\r
- */\r
- wctrans_t wctrans (const char *S);\r
-\r
- /** Map the wide character WC using the mapping described by WTr. The current\r
- locale will be the same as during the call to wctrans that returned\r
- the value WTr.\r
-\r
- @param[in] WC The wide character to be converted.\r
- @param[in] WTr A value describing a mapping of wide characters in the\r
- current locale.\r
-\r
- @return Returns the mapped value of WC using the mapping selected by WTr.\r
- */\r
- wint_t towctrans (wint_t WC, wctrans_t WTr);\r
-__END_DECLS\r
-\r
-#endif /* _WCTYPE_H_ */\r