Update or add comments to files and functions for use by Doxygen.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12153 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
@@ -1,5 +1,46 @@
|
||||
/** @file
|
||||
Wide character classification functions and macros.
|
||||
Wide character classification and mapping utilities.
|
||||
|
||||
The following macros are defined in this file:<BR>
|
||||
@verbatim
|
||||
WEOF Wide char version of end-of-file.
|
||||
@endverbatim
|
||||
|
||||
The following types are defined in this file:<BR>
|
||||
@verbatim
|
||||
wint_t Type capable of holding all wchar_t values and WEOF.
|
||||
wctrans_t A type for holding locale-specific character mappings.
|
||||
wctype_t Type for holding locale-specific character classifications.
|
||||
@endverbatim
|
||||
|
||||
The following functions are declared in this file:<BR>
|
||||
@verbatim
|
||||
############### Wide Character Classification Functions
|
||||
int iswalnum (wint_t);
|
||||
int iswalpha (wint_t);
|
||||
int iswcntrl (wint_t);
|
||||
int iswdigit (wint_t);
|
||||
int iswgraph (wint_t);
|
||||
int iswlower (wint_t);
|
||||
int iswprint (wint_t);
|
||||
int iswpunct (wint_t);
|
||||
int iswblank (wint_t);
|
||||
int iswspace (wint_t);
|
||||
int iswupper (wint_t);
|
||||
int iswxdigit (wint_t);
|
||||
|
||||
############### Extensible Wide Character Classification Functions
|
||||
wctype_t wctype (const char *);
|
||||
int iswctype (wint_t, wctype_t);
|
||||
|
||||
############### Wide Character Case Mapping Utilities
|
||||
wint_t towlower (wint_t);
|
||||
wint_t towupper (wint_t);
|
||||
|
||||
############### Extensible Wide Character Case Mapping Utilities
|
||||
wctrans_t wctrans (const char *);
|
||||
wint_t towctrans (wint_t, wctrans_t);
|
||||
@endverbatim
|
||||
|
||||
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||
This program and the accompanying materials are licensed and made available under
|
||||
@@ -45,44 +86,258 @@
|
||||
#include <machine/ansi.h>
|
||||
|
||||
#ifdef _EFI_WINT_T
|
||||
/** wint_t is an integer type unchanged by default argument promotions that can
|
||||
hold any value corresponding to members of the extended character set, as
|
||||
well as at least one value that does not correspond to any member of the
|
||||
extended character set: WEOF.
|
||||
*/
|
||||
typedef _EFI_WINT_T wint_t;
|
||||
#undef _BSD_WINT_T_
|
||||
#undef _EFI_WINT_T
|
||||
#endif
|
||||
|
||||
#ifdef _BSD_WCTRANS_T_
|
||||
typedef wint_t (*wctrans_t)(wint_t);
|
||||
#undef _BSD_WCTRANS_T_
|
||||
/** A scalar type for holding locale-specific character mappings. */
|
||||
typedef wint_t (*wctrans_t)(wint_t);
|
||||
#undef _BSD_WCTRANS_T_
|
||||
#endif
|
||||
|
||||
#ifdef _BSD_WCTYPE_T_
|
||||
typedef _BSD_WCTYPE_T_ wctype_t;
|
||||
#undef _BSD_WCTYPE_T_
|
||||
/** A scalar type capable of holding values representing locale-specific
|
||||
character classifications. */
|
||||
typedef _BSD_WCTYPE_T_ wctype_t;
|
||||
#undef _BSD_WCTYPE_T_
|
||||
#endif
|
||||
|
||||
#ifndef WEOF
|
||||
#define WEOF ((wint_t)-1)
|
||||
/** WEOF expands to a constant expression of type wint_t whose value does not
|
||||
correspond to any member of the extended character set. It is accepted
|
||||
(and returned) by several functions, declared in this file, to indicate
|
||||
end-of-file, that is, no more input from a stream. It is also used as a
|
||||
wide character value that does not correspond to any member of the
|
||||
extended character set.
|
||||
*/
|
||||
#define WEOF ((wint_t)-1)
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
int /*EFIAPI*/ iswalnum(wint_t);
|
||||
int /*EFIAPI*/ iswalpha(wint_t);
|
||||
int /*EFIAPI*/ iswcntrl(wint_t);
|
||||
int /*EFIAPI*/ iswctype(wint_t, wctype_t);
|
||||
int /*EFIAPI*/ iswdigit(wint_t);
|
||||
int /*EFIAPI*/ iswgraph(wint_t);
|
||||
int /*EFIAPI*/ iswlower(wint_t);
|
||||
int /*EFIAPI*/ iswprint(wint_t);
|
||||
int /*EFIAPI*/ iswpunct(wint_t);
|
||||
int /*EFIAPI*/ iswblank(wint_t);
|
||||
int /*EFIAPI*/ iswspace(wint_t);
|
||||
int /*EFIAPI*/ iswupper(wint_t);
|
||||
int /*EFIAPI*/ iswxdigit(wint_t);
|
||||
wint_t /*EFIAPI*/ towctrans(wint_t, wctrans_t);
|
||||
wint_t /*EFIAPI*/ towlower(wint_t);
|
||||
wint_t /*EFIAPI*/ towupper(wint_t);
|
||||
wctrans_t /*EFIAPI*/ wctrans(const char *);
|
||||
wctype_t /*EFIAPI*/ wctype(const char *);
|
||||
/** Test for any wide character for which iswalpha or iswdigit is TRUE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswalnum (wint_t WC);
|
||||
|
||||
/** Test for any wide character for which iswupper or iswlower is TRUE,
|
||||
OR, a locale-specific character where none of iswcntrl, iswdigit,
|
||||
iswpunct, or iswspace is TRUE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswalpha (wint_t WC);
|
||||
|
||||
/** Test for any wide control character.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswcntrl (wint_t WC);
|
||||
|
||||
/** Test if the value of WC is a wide character that corresponds to a decimal digit.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswdigit (wint_t WC);
|
||||
|
||||
/** Test for wide characters for which iswprint is TRUE and iswspace is FALSE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswgraph (wint_t WC);
|
||||
|
||||
/** The iswlower function tests for any wide character that corresponds to a
|
||||
lowercase letter or is one of a locale-specific set of wide characters
|
||||
for which none of iswcntrl, iswdigit, iswpunct, or iswspace is TRUE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswlower (wint_t WC);
|
||||
|
||||
/** Test for any printing wide character.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswprint (wint_t WC);
|
||||
|
||||
/** The iswpunct function tests for any printing wide character that is one
|
||||
of a locale-specific set of punctuation wide characters for which
|
||||
neither iswspace nor iswalnum is TRUE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswpunct (wint_t WC);
|
||||
|
||||
/** Test for standard blank characters or locale-specific characters
|
||||
for which iswspace is TRUE and are used to separate words within a line
|
||||
of text. In the "C" locale, iswblank only returns TRUE for the standard
|
||||
blank characters space (L' ') and horizontal tab (L'\t').
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswblank (wint_t WC);
|
||||
|
||||
/** The iswspace function tests for any wide character that corresponds to a
|
||||
locale-specific set of white-space wide characters for which none of
|
||||
iswalnum, iswgraph, or iswpunct is TRUE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswspace (wint_t WC);
|
||||
|
||||
/** Tests for any wide character that corresponds to an uppercase letter or
|
||||
is one of a locale-specific set of wide characters for which none of
|
||||
iswcntrl, iswdigit, iswpunct, or iswspace is TRUE.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswupper (wint_t WC);
|
||||
|
||||
/** The iswxdigit function tests for any wide character that corresponds to a
|
||||
hexadecimal-digit character.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
|
||||
@return Returns non-zero (TRUE) if and only if the value of WC conforms
|
||||
to the classification described for this function.
|
||||
*/
|
||||
int iswxdigit (wint_t WC);
|
||||
|
||||
/** Construct a value that describes a class of wide characters, identified
|
||||
by the string pointed to by Desc. The constructed value is suitable for
|
||||
use as the second argument to the iswctype function.
|
||||
|
||||
The following strings name classes of wide characters that the iswctype
|
||||
function is able to test against. These strings are valid in all locales
|
||||
as Desc arguments to wctype().
|
||||
- "alnum"
|
||||
- "alpha"
|
||||
- "blank"
|
||||
- "cntrl"
|
||||
- "digit"
|
||||
- "graph"
|
||||
- "lower"
|
||||
- "print"
|
||||
- "punct"
|
||||
- "space"
|
||||
- "upper"
|
||||
- "xdigit
|
||||
|
||||
@param[in] Desc A pointer to a multibyte character string naming a
|
||||
class of wide characters.
|
||||
|
||||
@return If Desc identifies a valid class of wide characters in the
|
||||
current locale, the wctype function returns a nonzero value that
|
||||
is valid as the second argument to the iswctype function;
|
||||
otherwise, it returns zero.
|
||||
*/
|
||||
wctype_t wctype (const char *Desc);
|
||||
|
||||
/** Determine whether the wide character WC has the property described by Wct.
|
||||
|
||||
@param[in] WC The wide character to be classified.
|
||||
@param[in] Wct A value describing a class of wide characters.
|
||||
|
||||
@return The iswctype function returns nonzero (TRUE) if and only if the
|
||||
value of the wide character WC has the property described by Wct.
|
||||
*/
|
||||
int iswctype (wint_t WC, wctype_t Wct);
|
||||
|
||||
/** Convert an uppercase letter to a corresponding lowercase letter.
|
||||
|
||||
@param[in] WC The wide character to be converted.
|
||||
|
||||
@return If the argument is a wide character for which iswupper is TRUE
|
||||
and there are one or more corresponding wide characters, as
|
||||
specified by the current locale, for which iswlower is TRUE, the
|
||||
towlower function returns one of the corresponding wide
|
||||
characters (always the same one for any given locale); otherwise,
|
||||
the argument is returned unchanged.
|
||||
*/
|
||||
wint_t towlower (wint_t WC);
|
||||
|
||||
/** Convert a lowercase letter to a corresponding uppercase letter.
|
||||
|
||||
@param[in] WC The wide character to be converted.
|
||||
|
||||
@return If the argument is a wide character for which iswlower is TRUE
|
||||
and there are one or more corresponding wide characters, as
|
||||
specified by the current locale, for which iswupper is TRUE, the
|
||||
towupper function returns one of the corresponding wide
|
||||
characters (always the same one for any given locale); otherwise,
|
||||
the argument is returned unchanged.
|
||||
*/
|
||||
wint_t towupper (wint_t WC);
|
||||
|
||||
/** Construct a value that describes a mapping between wide characters
|
||||
identified by the string argument, S.
|
||||
|
||||
The strings listed below are valid in all locales as the S argument to
|
||||
the wctrans function.
|
||||
- "tolower"
|
||||
- "toupper"
|
||||
|
||||
@param[in] S A pointer to a multibyte character string naming a
|
||||
mapping between wide characters.
|
||||
|
||||
@return If S identifies a valid mapping of wide characters in the current
|
||||
locale, the wctrans function returns a nonzero value that is
|
||||
valid as the second argument to the towctrans function;
|
||||
otherwise, it returns zero.
|
||||
*/
|
||||
wctrans_t wctrans (const char *S);
|
||||
|
||||
/** Map the wide character WC using the mapping described by WTr. The current
|
||||
locale will be the same as during the call to wctrans that returned
|
||||
the value WTr.
|
||||
|
||||
@param[in] WC The wide character to be converted.
|
||||
@param[in] WTr A value describing a mapping of wide characters in the
|
||||
current locale.
|
||||
|
||||
@return Returns the mapped value of WC using the mapping selected by WTr.
|
||||
*/
|
||||
wint_t towctrans (wint_t WC, wctrans_t WTr);
|
||||
__END_DECLS
|
||||
|
||||
#endif /* _WCTYPE_H_ */
|
||||
|
Reference in New Issue
Block a user