mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 21:54:27 +02:00
Update or add comments to files and functions for use by Doxygen.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12089 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
7dad86fc60
commit
681cc25c17
@ -1,5 +1,6 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Provides a definition of the assert macro.
|
Provides a definition of the assert macro used to insert diagnostic messages
|
||||||
|
into code.
|
||||||
|
|
||||||
This header file defines the assert macro and refers to the NDEBUG macro,
|
This header file defines the assert macro and refers to the NDEBUG macro,
|
||||||
which is NOT defined in this file.
|
which is NOT defined in this file.
|
||||||
@ -9,51 +10,62 @@
|
|||||||
|
|
||||||
If the NDEBUG macro is defined at the point where assert.h
|
If the NDEBUG macro is defined at the point where assert.h
|
||||||
is included, the assert macro is defined so as to not produce code.
|
is included, the assert macro is defined so as to not produce code.
|
||||||
Otherwise, the assertion is tested and if the assertion is true a
|
Otherwise, the assertion is tested and if the assertion is FALSE
|
||||||
diagnostic message of the form
|
(e.g. evaluates to 0) a diagnostic message of the form<BR>
|
||||||
"ASSERT <FileName>(<LineNumber>): <Description>\n" is produced.
|
"Assertion failed: (EXPR), file FILE, function FUNC, line LINE.\n"<BR>
|
||||||
A true assertion will also result in the application being terminated.
|
is produced.
|
||||||
|
A FALSE evaluation will also result in the application being aborted.
|
||||||
|
|
||||||
The behavior of the assert macro can be further modified by setting attributes
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
in the PcdDebugPropertyMask PCD entry when building the Application Toolkit.
|
This program and the accompanying materials are licensed and made available under
|
||||||
If DEBUG_PROPERTY_ASSERT_BREAKPOINT_ENABLED bit of PcdDebugProperyMask is set
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
then CpuBreakpoint() is called. Otherwise, if the
|
The full text of the license may be found at
|
||||||
DEBUG_PROPERTY_ASSERT_DEADLOOP_ENABLED bit of PcdDebugProperyMask is set then
|
http://opensource.org/licenses/bsd-license.
|
||||||
CpuDeadLoop() is called. If neither of these bits are set, then the
|
|
||||||
application will be terminated immediately after the message is printed to
|
|
||||||
the debug output device.
|
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
|
||||||
This program and the accompanying materials are licensed and made available under
|
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
|
||||||
The full text of the license may be found at
|
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
#include <sys/EfiCdefs.h>
|
#include <sys/EfiCdefs.h>
|
||||||
|
|
||||||
#undef assert ///< Remove any existing definition for assert.
|
#undef assert ///< Remove any existing definition for assert.
|
||||||
|
|
||||||
|
/** Internal helper function for the assert macro.
|
||||||
|
The __assert function prints a diagnostic message then exits the
|
||||||
|
currently running application.
|
||||||
|
|
||||||
|
This function should NEVER be called directly.
|
||||||
|
|
||||||
|
Some pre-processors do not provide the __func__ identifier. When that is
|
||||||
|
the case, __func__ will be NULL. This function accounts for this and
|
||||||
|
will modify the diagnostic message appropriately.
|
||||||
|
|
||||||
|
|
||||||
|
@param[in] file The name of the file containing the assert.
|
||||||
|
@param[in] func The name of the function containing the assert.
|
||||||
|
@param[in] line The line number the assert is located on.
|
||||||
|
@param[in] failedexpr A literal representation of the assert's expression.
|
||||||
|
|
||||||
|
@return The __assert function will never return. It aborts the
|
||||||
|
current application and returns to the environment that
|
||||||
|
the application was launched from.
|
||||||
|
**/
|
||||||
extern void
|
extern void
|
||||||
__assert(const char *func, const char *file, int line, const char *failedexpr);
|
__assert(const char *file, const char *func, int line, const char *failedexpr);
|
||||||
|
|
||||||
/** The assert macro puts diagnostic tests into programs; it expands to a
|
/** The assert macro puts diagnostic tests into programs; it expands to a
|
||||||
void expression.
|
void expression.
|
||||||
|
|
||||||
When it is executed, if expression (which shall have a scalar type) is
|
When it is executed, if expression (which must have a scalar type) is
|
||||||
false (that is, compares equal to 0), the assert macro writes information
|
FALSE (that is, compares equal to 0), the assert macro writes information
|
||||||
about the particular call that failed (including the text of the argument,
|
about the particular call that failed (including the text of the argument,
|
||||||
the name of the source file, the source line number, and the name of the
|
the name of the source file, the source line number, and the name of the
|
||||||
enclosing function - the latter are respectively the values of the
|
enclosing function - the latter are respectively the values of the
|
||||||
preprocessing macros __FILE__ and __LINE__ and of the identifier __func__)
|
preprocessing macros __FILE__ and __LINE__ and of the identifier __func__)
|
||||||
on the standard error stream. It then calls the abort function.
|
on the standard error stream. It then calls the abort function.
|
||||||
|
|
||||||
If NDEBUG is not defined, Expression is evaluated. If Expression evaluates to FALSE, then
|
If NDEBUG is not defined, Expression is evaluated. If Expression evaluates to FALSE,
|
||||||
__assert is called passing in the source filename, source function, source line number,
|
then __assert is called passing in the source filename, source function, source
|
||||||
and the Expression.
|
line number, and the Expression.
|
||||||
|
|
||||||
@param Expression Boolean expression.
|
@param Expression Boolean expression.
|
||||||
|
|
||||||
@ -64,7 +76,7 @@ __assert(const char *func, const char *file, int line, const char *failedexpr);
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
#define assert(Expression) ((Expression) ? (void)0 :\
|
#define assert(Expression) ((Expression) ? (void)0 :\
|
||||||
__assert(__func__, __FILE__, __LINE__, #Expression) )
|
__assert(__FILE__, __func__, __LINE__, #Expression) )
|
||||||
#endif
|
#endif
|
||||||
/// @}
|
/// @}
|
||||||
/* END of file assert.h */
|
/* END of file assert.h */
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Single-byte character classification and case conversion macros and
|
Single-byte character classification, case conversion macros, and
|
||||||
function declarations.
|
function declarations.
|
||||||
|
|
||||||
The header <ctype.h> declares several functions useful for testing and mapping
|
The header <ctype.h> declares several functions useful for testing and mapping
|
||||||
@ -11,19 +11,18 @@
|
|||||||
default is the "C" locale.
|
default is the "C" locale.
|
||||||
|
|
||||||
The term "printing character" refers to a member of a locale-specific
|
The term "printing character" refers to a member of a locale-specific
|
||||||
set of characters, each of which occupies one printing position on a display
|
set of characters, each of which occupies at least one printing position on an output
|
||||||
device; the term control character refers to a member of a locale-specific
|
device; the term control character refers to a member of a locale-specific
|
||||||
set of characters that are not printing characters.
|
set of characters that are not printing characters.
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
http://opensource.org/licenses/bsd-license.
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#ifndef _CTYPE_H
|
#ifndef _CTYPE_H
|
||||||
#define _CTYPE_H
|
#define _CTYPE_H
|
||||||
@ -36,8 +35,10 @@ __BEGIN_DECLS
|
|||||||
/** The isalnum function tests for any character for which isalpha or isdigit
|
/** The isalnum function tests for any character for which isalpha or isdigit
|
||||||
is true.
|
is true.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isalnum(int c);
|
int isalnum(int c);
|
||||||
|
|
||||||
@ -47,29 +48,37 @@ int isalnum(int c);
|
|||||||
isspace is true. In the "C" locale, isalpha returns true only for the
|
isspace is true. In the "C" locale, isalpha returns true only for the
|
||||||
characters for which isupper or islower is true.
|
characters for which isupper or islower is true.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isalpha(int c);
|
int isalpha(int c);
|
||||||
|
|
||||||
/** The iscntrl function tests for any control character.
|
/** The iscntrl function tests for any control character.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int iscntrl(int c);
|
int iscntrl(int c);
|
||||||
|
|
||||||
/** The isdigit function tests for any decimal-digit character.
|
/** The isdigit function tests for any decimal-digit character.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isdigit(int c);
|
int isdigit(int c);
|
||||||
|
|
||||||
/** The isgraph function tests for any printing character except space (' ').
|
/** The isgraph function tests for any printing character except space (' ').
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isgraph(int c);
|
int isgraph(int c);
|
||||||
|
|
||||||
@ -78,15 +87,19 @@ int isgraph(int c);
|
|||||||
isdigit, ispunct, or isspace is true. In the "C" locale, islower returns
|
isdigit, ispunct, or isspace is true. In the "C" locale, islower returns
|
||||||
true only for the lowercase letters.
|
true only for the lowercase letters.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int islower(int c);
|
int islower(int c);
|
||||||
|
|
||||||
/** The isprint function tests for any printing character including space (' ').
|
/** The isprint function tests for any printing character including space (' ').
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isprint(int c);
|
int isprint(int c);
|
||||||
|
|
||||||
@ -95,8 +108,10 @@ int isprint(int c);
|
|||||||
isalnum is true. In the "C" locale, ispunct returns true for every printing
|
isalnum is true. In the "C" locale, ispunct returns true for every printing
|
||||||
character for which neither isspace nor isalnum is true.
|
character for which neither isspace nor isalnum is true.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int ispunct(int c);
|
int ispunct(int c);
|
||||||
|
|
||||||
@ -107,8 +122,10 @@ int ispunct(int c);
|
|||||||
horizontal tab ('\t'), and vertical tab ('\v'). In the "C" locale, isspace
|
horizontal tab ('\t'), and vertical tab ('\v'). In the "C" locale, isspace
|
||||||
returns true only for the standard white-space characters.
|
returns true only for the standard white-space characters.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isspace(int c);
|
int isspace(int c);
|
||||||
|
|
||||||
@ -117,29 +134,47 @@ int isspace(int c);
|
|||||||
isdigit, ispunct, or isspace is true. In the "C" locale, isupper returns
|
isdigit, ispunct, or isspace is true. In the "C" locale, isupper returns
|
||||||
true only for the uppercase letters.
|
true only for the uppercase letters.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isupper(int c);
|
int isupper(int c);
|
||||||
|
|
||||||
/** The isxdigit function tests for any hexadecimal-digit character.
|
/** The isxdigit function tests for any hexadecimal-digit character.
|
||||||
|
|
||||||
@return Returns nonzero (true) if and only if the value of the argument c
|
@param[in] c The character to be tested.
|
||||||
conforms to that in the description of the function.
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isxdigit(int c);
|
int isxdigit(int c);
|
||||||
|
|
||||||
/** The isascii function tests that a character is one of the 128 ASCII characters.
|
/** The isblank function tests that a character is a white-space character that results
|
||||||
|
in a number of space (' ') characters being sent to the output device. In the C locale
|
||||||
|
this is either ' ' or '\t'.
|
||||||
|
|
||||||
@param[in] c The character to test.
|
@param[in] c The character to be tested.
|
||||||
@return Returns nonzero (true) if c is a valid ASCII character. Otherwize,
|
|
||||||
zero (false) is returned.
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
|
**/
|
||||||
|
int isblank(int);
|
||||||
|
|
||||||
|
/** The isascii function tests that a character is one of the 128 7-bit ASCII characters.
|
||||||
|
|
||||||
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isascii(int c);
|
int isascii(int c);
|
||||||
|
|
||||||
/** The tolower function converts an uppercase letter to a corresponding
|
/** The tolower function converts an uppercase letter to a corresponding
|
||||||
lowercase letter.
|
lowercase letter.
|
||||||
|
|
||||||
|
@param[in] c The character to be converted.
|
||||||
|
|
||||||
@return If the argument is a character for which isupper is true and
|
@return If the argument is a character for which isupper is true and
|
||||||
there are one or more corresponding characters, as specified by
|
there are one or more corresponding characters, as specified by
|
||||||
the current locale, for which islower is true, the tolower
|
the current locale, for which islower is true, the tolower
|
||||||
@ -152,6 +187,8 @@ int tolower(int c);
|
|||||||
/** The toupper function converts a lowercase letter to a corresponding
|
/** The toupper function converts a lowercase letter to a corresponding
|
||||||
uppercase letter.
|
uppercase letter.
|
||||||
|
|
||||||
|
@param[in] c The character to be converted.
|
||||||
|
|
||||||
@return If the argument is a character for which islower is true and
|
@return If the argument is a character for which islower is true and
|
||||||
there are one or more corresponding characters, as specified by
|
there are one or more corresponding characters, as specified by
|
||||||
the current locale, for which isupper is true, the toupper
|
the current locale, for which isupper is true, the toupper
|
||||||
@ -161,13 +198,13 @@ int tolower(int c);
|
|||||||
**/
|
**/
|
||||||
int toupper(int c);
|
int toupper(int c);
|
||||||
|
|
||||||
int isblank(int);
|
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
// Character Classification Macros
|
/** Character Classification Macros.
|
||||||
// Undefine individually or define NO_CTYPE_MACROS, before including <ctype.h>,
|
Undefine individually or define NO_CTYPE_MACROS, before including <ctype.h>,
|
||||||
// in order to use the Function version of the character classification macros.
|
in order to use the Function version of the character classification macros.
|
||||||
|
@{
|
||||||
|
**/
|
||||||
#ifndef NO_CTYPE_MACROS
|
#ifndef NO_CTYPE_MACROS
|
||||||
#define isalnum(c) (__isCClass( (int)c, (_CD | _CU | _CL | _XA)))
|
#define isalnum(c) (__isCClass( (int)c, (_CD | _CU | _CL | _XA)))
|
||||||
#define isalpha(c) (__isCClass( (int)c, (_CU | _CL | _XA)))
|
#define isalpha(c) (__isCClass( (int)c, (_CU | _CL | _XA)))
|
||||||
@ -183,5 +220,6 @@ __END_DECLS
|
|||||||
#define tolower(c) (__toLower((int)c))
|
#define tolower(c) (__toLower((int)c))
|
||||||
#define toupper(c) (__toUpper((int)c))
|
#define toupper(c) (__toUpper((int)c))
|
||||||
#endif /* NO_CTYPE_MACROS */
|
#endif /* NO_CTYPE_MACROS */
|
||||||
|
///@}
|
||||||
|
|
||||||
#endif /* _CTYPE_H */
|
#endif /* _CTYPE_H */
|
||||||
|
@ -1,28 +1,43 @@
|
|||||||
/** @file
|
/** @file
|
||||||
The header <errno.h> defines several values, all relating to the reporting of
|
The header <errno.h> defines several macros, all relating to the reporting of
|
||||||
error conditions.
|
error conditions.
|
||||||
|
|
||||||
The enum members expand to integral constant expressions
|
The macros expand to integral constant expressions
|
||||||
with distinct nonzero values, suitable for use in #if preprocessing
|
with distinct nonzero values, suitable for use in #if preprocessing
|
||||||
directives; and errno which expands to a modifiable lvalue that has type int,
|
directives.
|
||||||
the value of which is set to a positive error number by several library
|
|
||||||
functions.
|
|
||||||
|
|
||||||
The value of errno is zero at program startup, but is never set to zero by
|
The ISO/IEC 9899 specification requires that these be macros.
|
||||||
|
|
||||||
|
The macros expand to integral constant expressions
|
||||||
|
with distinct nonzero values, suitable for use in #if preprocessing
|
||||||
|
directives; the variable errno which expands to a modifiable lvalue that has type int,
|
||||||
|
the value of which is set to a positive error number by several library
|
||||||
|
functions; and the variable EFIerrno which is an extension allowing the return status
|
||||||
|
of the underlying UEFI functions to be returned.
|
||||||
|
|
||||||
|
The value of errno and EFIerrno is zero at program startup. On program startup, errno
|
||||||
|
is initialized to zero but is never set to zero by
|
||||||
any library function. The value of errno may be set to a non-zero value by
|
any library function. The value of errno may be set to a non-zero value by
|
||||||
a library function call whether or not there is an error, provided the use
|
a library function call whether or not there is an error, provided the use
|
||||||
of errno is not is not documented in the description of the function in
|
of errno is not documented in the description of the function in
|
||||||
the governing standard: ISO/IEC 9899:1990 with Amendment 1 or ISO/IEC 9899:1999.
|
the governing standard: ISO/IEC 9899:1990 with Amendment 1 or ISO/IEC 9899:199409.
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
EFIerrno, like errno, should only be checked if it is known that the preceeding function call
|
||||||
This program and the accompanying materials are licensed and made available under
|
called a UEFI function. Functions in which UEFI functions are called dependent upon context
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
or parameter values should guarantee that EFIerrno is set to zero by default, or to the status
|
||||||
The full text of the license may be found at
|
value returned by any UEFI functions which are called.
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
All macro definitions in this list must begin with the letter 'E'
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
and be followed by a digit or an uppercase letter.
|
||||||
|
|
||||||
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
|
This program and the accompanying materials are licensed and made available under
|
||||||
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
|
The full text of the license may be found at
|
||||||
|
http://opensource.org/licenses/bsd-license.
|
||||||
|
|
||||||
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
#ifndef _ERRNO_H
|
#ifndef _ERRNO_H
|
||||||
#define _ERRNO_H
|
#define _ERRNO_H
|
||||||
@ -38,42 +53,42 @@ extern RETURN_STATUS EFIerrno;
|
|||||||
|
|
||||||
#define EMINERRORVAL __EMINERRORVAL /* The lowest valid error value */
|
#define EMINERRORVAL __EMINERRORVAL /* The lowest valid error value */
|
||||||
|
|
||||||
#define EPERM __EPERM /* 1 Operation not permitted */
|
#define EPERM __EPERM /* Operation not permitted */
|
||||||
#define ENOENT __ENOENT /* 2 No such file or directory */
|
#define ENOENT __ENOENT /* No such file or directory */
|
||||||
#define ESRCH __ESRCH /* 3 No such process */
|
#define ESRCH __ESRCH /* No such process */
|
||||||
#define EINTR __EINTR /* 4 Interrupted system call */
|
#define EINTR __EINTR /* Interrupted system call */
|
||||||
#define EIO __EIO /* 5 Input/output error */
|
#define EIO __EIO /* Input/output error */
|
||||||
#define ENXIO __ENXIO /* 6 Device not configured */
|
#define ENXIO __ENXIO /* Device not configured */
|
||||||
#define E2BIG __E2BIG /* 7 Argument list too long */
|
#define E2BIG __E2BIG /* Argument list too long */
|
||||||
#define ENOEXEC __ENOEXEC /* 8 Exec format error */
|
#define ENOEXEC __ENOEXEC /* Exec format error */
|
||||||
#define EBADF __EBADF /* 9 Bad file descriptor */
|
#define EBADF __EBADF /* Bad file descriptor */
|
||||||
#define ECHILD __ECHILD /* 10 No child processes */
|
#define ECHILD __ECHILD /* No child processes */
|
||||||
#define EDEADLK __EDEADLK /* 11 Resource deadlock avoided */
|
#define EDEADLK __EDEADLK /* Resource deadlock avoided */
|
||||||
#define ENOMEM __ENOMEM /* 12 Cannot allocate memory */
|
#define ENOMEM __ENOMEM /* Cannot allocate memory */
|
||||||
#define EACCES __EACCES /* 13 Permission denied */
|
#define EACCES __EACCES /* Permission denied */
|
||||||
#define EFAULT __EFAULT /* 14 Bad address */
|
#define EFAULT __EFAULT /* Bad address */
|
||||||
#define ENOTBLK __ENOTBLK /* 15 Block device required */
|
#define ENOTBLK __ENOTBLK /* Block device required */
|
||||||
#define EBUSY __EBUSY /* 16 Device busy */
|
#define EBUSY __EBUSY /* Device busy */
|
||||||
#define EEXIST __EEXIST /* 17 File exists */
|
#define EEXIST __EEXIST /* File exists */
|
||||||
#define EXDEV __EXDEV /* 18 Cross-device link */
|
#define EXDEV __EXDEV /* Cross-device link */
|
||||||
#define ENODEV __ENODEV /* 19 Operation not supported by device */
|
#define ENODEV __ENODEV /* Operation not supported by device */
|
||||||
#define ENOTDIR __ENOTDIR /* 20 Not a directory */
|
#define ENOTDIR __ENOTDIR /* Not a directory */
|
||||||
#define EISDIR __EISDIR /* 21 Is a directory */
|
#define EISDIR __EISDIR /* Is a directory */
|
||||||
#define EINVAL __EINVAL /* 22 Invalid argument */
|
#define EINVAL __EINVAL /* Invalid argument */
|
||||||
#define ENFILE __ENFILE /* 23 Too many open files in system */
|
#define ENFILE __ENFILE /* Too many open files in system */
|
||||||
#define EMFILE __EMFILE /* 24 Too many open file descriptors */
|
#define EMFILE __EMFILE /* Too many open file descriptors */
|
||||||
#define ENOTTY __ENOTTY /* 25 Inappropriate ioctl for device */
|
#define ENOTTY __ENOTTY /* Inappropriate ioctl for device */
|
||||||
#define ETXTBSY __ETXTBSY /* 26 Text file busy */
|
#define ETXTBSY __ETXTBSY /* Text file busy */
|
||||||
#define EFBIG __EFBIG /* 27 File too large */
|
#define EFBIG __EFBIG /* File too large */
|
||||||
#define ENOSPC __ENOSPC /* 28 No space left on device */
|
#define ENOSPC __ENOSPC /* No space left on device */
|
||||||
#define ESPIPE __ESPIPE /* 29 Illegal seek */
|
#define ESPIPE __ESPIPE /* Illegal seek */
|
||||||
#define EROFS __EROFS /* 30 Read-only filesystem */
|
#define EROFS __EROFS /* Read-only filesystem */
|
||||||
#define EMLINK __EMLINK /* 31 Too many links */
|
#define EMLINK __EMLINK /* Too many links */
|
||||||
#define EPIPE __EPIPE /* 32 Broken pipe */
|
#define EPIPE __EPIPE /* Broken pipe */
|
||||||
|
|
||||||
/* math software -- these are the only two values required by the C Standard */
|
/* math software -- these are the only two values required by the C Standard */
|
||||||
#define EDOM __EDOM /* 33 Numerical argument out of domain */
|
#define EDOM __EDOM /* 3umerical argument out of domain */
|
||||||
#define ERANGE __ERANGE /* 34 Result too large */
|
#define ERANGE __ERANGE /* 3esult too large */
|
||||||
|
|
||||||
/* non-blocking and interrupt i/o */
|
/* non-blocking and interrupt i/o */
|
||||||
#define EAGAIN __EAGAIN /* 35 Resource temporarily unavailable */
|
#define EAGAIN __EAGAIN /* 35 Resource temporarily unavailable */
|
||||||
|
@ -12,38 +12,40 @@
|
|||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#ifndef _CTYPE_H
|
#ifndef _CTYPE_H
|
||||||
#error This file, <sys/_ctype.h>, may only be included by <ctype.h>.
|
#error This file, <sys/_ctype.h>, may only be included by <ctype.h>.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern const UINT16 *_cClass; // Locale independent pointer to Character Classification Table
|
extern const UINT16 *_cClass; ///< Locale independent pointer to Character Classification Table.
|
||||||
extern const UINT8 *_uConvT; // Locale independent pointer to Lowercase to Uppercase Conversion Table
|
extern const UINT8 *_uConvT; ///< Locale independent pointer to Lowercase to Uppercase Conversion Table.
|
||||||
extern const UINT8 *_lConvT; // Locale independent pointer to Uppercase to Lowercase Conversion Table
|
extern const UINT8 *_lConvT; ///< Locale independent pointer to Uppercase to Lowercase Conversion Table.
|
||||||
|
|
||||||
extern int __isCClass( int _c, unsigned int mask); // Internal character classification function
|
extern int __isCClass( int _c, unsigned int mask); ///< Internal character classification function.
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
|
||||||
// Character Class bit masks
|
/** Character Class bit masks.
|
||||||
#define _CC 0x0001U // Control Characters
|
@{
|
||||||
#define _CW 0x0002U // White Space
|
**/
|
||||||
#define _CP 0x0004U // Punctuation
|
#define _CC 0x0001U ///< Control Characters
|
||||||
#define _CD 0x0008U // Digits [0-9]
|
#define _CW 0x0002U ///< White Space
|
||||||
#define _CU 0x0010U // Uppercase Letter [A-Z]
|
#define _CP 0x0004U ///< Punctuation
|
||||||
#define _CL 0x0020U // Lowercase Letter [a-z]
|
#define _CD 0x0008U ///< Digits [0-9]
|
||||||
#define _CX 0x0040U // Hexadecimal Digits [A-Fa-f]
|
#define _CU 0x0010U ///< Uppercase Letter [A-Z]
|
||||||
|
#define _CL 0x0020U ///< Lowercase Letter [a-z]
|
||||||
|
#define _CX 0x0040U ///< Hexadecimal Digits [A-Fa-f]
|
||||||
#define _C0 0x0080U
|
#define _C0 0x0080U
|
||||||
#define _CS 0x0100U // Space Characters, ' ' in C locale
|
#define _CS 0x0100U ///< Space Characters, ' ' in C locale
|
||||||
#define _CG 0x0200U // Graphic Characters
|
#define _CG 0x0200U ///< Graphic Characters
|
||||||
#define _CB 0x0400U // Blank Characters, ' ' and '\t' in C locale
|
#define _CB 0x0400U ///< Blank Characters, ' ' and '\t' in C locale
|
||||||
#define _C4 0x0800U
|
#define _C4 0x0800U
|
||||||
#define _XA 0x1000U // eXtra Alpha characters not in _CU or _CL
|
#define _XA 0x1000U ///< eXtra Alpha characters not in _CU or _CL
|
||||||
#define _C6 0x2000U
|
#define _C6 0x2000U
|
||||||
#define _C7 0x4000U
|
#define _C7 0x4000U
|
||||||
#define _C8 0x8000U
|
#define _C8 0x8000U
|
||||||
|
/// @}
|
||||||
|
|
||||||
#ifndef NO_CTYPE_MACROS
|
#ifndef NO_CTYPE_MACROS
|
||||||
#define __isCClass( _c, mask) (((_c) < 0 || (_c) > 127) ? 0 : (_cClass[(_c)] & (mask)))
|
#define __isCClass( _c, mask) (((_c) < 0 || (_c) > 127) ? 0 : (_cClass[(_c)] & (mask)))
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
|
|
||||||
The enum members expand to integral constant expressions
|
The enum members expand to integral constant expressions
|
||||||
with distinct nonzero values, suitable for use in #if preprocessing
|
with distinct nonzero values, suitable for use in #if preprocessing
|
||||||
directives.
|
directives. These default values are specified as an enum in order to ease
|
||||||
|
the maintenance of the values.
|
||||||
|
|
||||||
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
@ -14,7 +15,6 @@
|
|||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#ifdef _ERRNO_H // May only be included from <errno.h>
|
#ifdef _ERRNO_H // May only be included from <errno.h>
|
||||||
#ifndef _SYS_ERRNO_H
|
#ifndef _SYS_ERRNO_H
|
||||||
|
@ -1,140 +1,253 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Character classification and case conversion functions for <ctype.h>.
|
Character classification function implementations for <ctype.h>.
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
http://opensource.org/licenses/bsd-license.
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#include <LibConfig.h>
|
#include <LibConfig.h>
|
||||||
|
|
||||||
#define NO_CTYPE_MACROS // So that we don't define the classification macros
|
#define NO_CTYPE_MACROS // So that we don't define the classification macros
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
/** Internal worker function for character classification.
|
||||||
|
|
||||||
|
Determines if a character is a member of a set of character classes.
|
||||||
|
|
||||||
|
@param[in] _c The character to be tested.
|
||||||
|
@param[in] mask A bitmapped specification of the character classes to
|
||||||
|
test the character against. These bits are defined
|
||||||
|
in _ctype.h.
|
||||||
|
|
||||||
|
@retval 0 The character, _c, is NOT a member of the character classes specified by mask.
|
||||||
|
@retval nonZero The character, _c, IS a member of a specified character class.
|
||||||
|
**/
|
||||||
int
|
int
|
||||||
__isCClass( int _c, unsigned int mask)
|
__isCClass(
|
||||||
|
IN int _c,
|
||||||
|
unsigned int mask
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return ((_c < 0 || _c > 127) ? 0 : (_cClass[_c] & mask));
|
return ((_c < 0 || _c > 127) ? 0 : (_cClass[_c] & mask));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isalnum function tests for any character for which isalpha or isdigit
|
||||||
|
is true.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isalnum(int c)
|
int
|
||||||
|
isalnum(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CD | _CU | _CL | _XA)));
|
return (__isCClass( c, (_CD | _CU | _CL | _XA)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isalpha function tests for any character for which isupper or islower
|
||||||
|
is true, or any character that is one of a locale-specific set of
|
||||||
|
alphabetic characters for which none of iscntrl, isdigit, ispunct, or
|
||||||
|
isspace is true. In the "C" locale, isalpha returns true only for the
|
||||||
|
characters for which isupper or islower is true.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isalpha(int c)
|
int
|
||||||
|
isalpha(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CU | _CL | _XA)));
|
return (__isCClass( c, (_CU | _CL | _XA)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The iscntrl function tests for any control character.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int iscntrl(int c)
|
int
|
||||||
|
iscntrl(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CC)));
|
return (__isCClass( c, (_CC)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isdigit function tests for any decimal-digit character.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isdigit(int c)
|
int
|
||||||
|
isdigit(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CD)));
|
return (__isCClass( c, (_CD)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isgraph function tests for any printing character except space (' ').
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isgraph(int c)
|
int
|
||||||
|
isgraph(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CG)));
|
return (__isCClass( c, (_CG)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The islower function tests for any character that is a lowercase letter or
|
||||||
|
is one of a locale-specific set of characters for which none of iscntrl,
|
||||||
|
isdigit, ispunct, or isspace is true. In the "C" locale, islower returns
|
||||||
|
true only for the lowercase letters.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int islower(int c)
|
int
|
||||||
|
islower(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CL)));
|
return (__isCClass( c, (_CL)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isprint function tests for any printing character including space (' ').
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isprint(int c)
|
int
|
||||||
|
isprint(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CS | _CG)));
|
return (__isCClass( c, (_CS | _CG)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The ispunct function tests for any printing character that is one of a
|
||||||
|
locale-specific set of punctuation characters for which neither isspace nor
|
||||||
|
isalnum is true. In the "C" locale, ispunct returns true for every printing
|
||||||
|
character for which neither isspace nor isalnum is true.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int ispunct(int c)
|
int
|
||||||
|
ispunct(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CP)));
|
return (__isCClass( c, (_CP)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isspace function tests for any character that is a standard white-space
|
||||||
|
character or is one of a locale-specific set of characters for which
|
||||||
|
isalnum is false. The standard white-space characters are the following:
|
||||||
|
space (' '), form feed ('\f'), new-line ('\n'), carriage return ('\r'),
|
||||||
|
horizontal tab ('\t'), and vertical tab ('\v'). In the "C" locale, isspace
|
||||||
|
returns true only for the standard white-space characters.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isspace(int c)
|
int
|
||||||
|
isspace(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CW)));
|
return (__isCClass( c, (_CW)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isupper function tests for any character that is an uppercase letter or
|
||||||
|
is one of a locale-specific set of characters for which none of iscntrl,
|
||||||
|
isdigit, ispunct, or isspace is true. In the "C" locale, isupper returns
|
||||||
|
true only for the uppercase letters.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isupper(int c)
|
int
|
||||||
|
isupper(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CU)));
|
return (__isCClass( c, (_CU)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** The isxdigit function tests for any hexadecimal-digit character.
|
||||||
|
|
||||||
@return
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
**/
|
**/
|
||||||
int isxdigit(int c)
|
int
|
||||||
|
isxdigit(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, (_CD | _CX)));
|
return (__isCClass( c, (_CD | _CX)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_NETBSD_SOURCE)
|
/** The isblank function tests that a character is a white-space character that results
|
||||||
|
in a number of space (' ') characters being sent to the output device. In the C locale
|
||||||
|
this is either ' ' or '\t'.
|
||||||
|
|
||||||
|
@param[in] c The character to be tested.
|
||||||
|
|
||||||
|
@return Returns nonzero (true) if and only if the value of the parameter c
|
||||||
|
can be classified as specified in the description of the function.
|
||||||
|
**/
|
||||||
int
|
int
|
||||||
isblank(int c)
|
isblank(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
{
|
{
|
||||||
return (__isCClass( c, _CB));
|
return (__isCClass( c, _CB));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/** The isascii function tests that a character is one of the 128 ASCII characters.
|
/** The isascii function tests that a character is one of the 128 7-bit ASCII characters.
|
||||||
|
|
||||||
@param[in] c The character to test.
|
@param[in] c The character to test.
|
||||||
|
|
||||||
@return Returns nonzero (true) if c is a valid ASCII character. Otherwize,
|
@return Returns nonzero (true) if c is a valid ASCII character. Otherwize,
|
||||||
zero (false) is returned.
|
zero (false) is returned.
|
||||||
**/
|
**/
|
||||||
int isascii(int c){
|
int
|
||||||
|
isascii(
|
||||||
|
IN int c
|
||||||
|
)
|
||||||
|
{
|
||||||
return ((c >= 0) && (c < 128));
|
return ((c >= 0) && (c < 128));
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Case conversion functions for <ctype.h>
|
Case conversion function implementations for <ctype.h>
|
||||||
|
|
||||||
The tolower function converts an uppercase letter to a corresponding
|
The tolower function converts an uppercase letter to a corresponding
|
||||||
lowercase letter. If the argument is a character for which isupper
|
lowercase letter. If the argument is a character for which isupper
|
||||||
@ -15,34 +15,56 @@
|
|||||||
of the corresponding characters (always the same one for any given locale);
|
of the corresponding characters (always the same one for any given locale);
|
||||||
otherwise, the argument is returned unchanged.
|
otherwise, the argument is returned unchanged.
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
http://opensource.org/licenses/bsd-license.
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#include <LibConfig.h>
|
#include <LibConfig.h>
|
||||||
|
|
||||||
#define NO_CTYPE_MACROS // So that we don't define the classification macros
|
#define NO_CTYPE_MACROS // So that we don't define the classification macros
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
/** The tolower function converts an uppercase letter to a corresponding
|
||||||
|
lowercase letter.
|
||||||
|
|
||||||
|
@param[in] c The character to be converted.
|
||||||
|
|
||||||
|
@return If the argument is a character for which isupper is true and
|
||||||
|
there are one or more corresponding characters, as specified by
|
||||||
|
the current locale, for which islower is true, the tolower
|
||||||
|
function returns one of the corresponding characters (always the
|
||||||
|
same one for any given locale); otherwise, the argument is
|
||||||
|
returned unchanged.
|
||||||
|
**/
|
||||||
int
|
int
|
||||||
tolower(
|
tolower(
|
||||||
int _c
|
IN int _c
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// return ((_c < 0 || _c > 127) ? _c : _lConvT[_c]);
|
|
||||||
return (isupper(_c) ? _lConvT[_c] : _c);
|
return (isupper(_c) ? _lConvT[_c] : _c);
|
||||||
}
|
}
|
||||||
|
|
||||||
int toupper(
|
/** The toupper function converts a lowercase letter to a corresponding
|
||||||
int _c
|
uppercase letter.
|
||||||
|
|
||||||
|
@param[in] c The character to be converted.
|
||||||
|
|
||||||
|
@return If the argument is a character for which islower is true and
|
||||||
|
there are one or more corresponding characters, as specified by
|
||||||
|
the current locale, for which isupper is true, the toupper
|
||||||
|
function returns one of the corresponding characters (always the
|
||||||
|
same one for any given locale); otherwise, the argument is
|
||||||
|
returned unchanged.
|
||||||
|
**/
|
||||||
|
int
|
||||||
|
toupper(
|
||||||
|
IN int _c
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// return ((_c < 0 || _c > 127) ? _c : _uConvT[_c]);
|
|
||||||
return (islower(_c) ? _uConvT[_c] : _c);
|
return (islower(_c) ? _uConvT[_c] : _c);
|
||||||
}
|
}
|
||||||
|
@ -4,20 +4,19 @@
|
|||||||
|
|
||||||
These are the default, C locale, tables.
|
These are the default, C locale, tables.
|
||||||
|
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
http://opensource.org/licenses/bsd-license.
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
|
|
||||||
**/
|
**/
|
||||||
#include <LibConfig.h>
|
#include <LibConfig.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
/// ASCII-8 Character Classification Table
|
/// ASCII-7 Character Classification Table
|
||||||
const UINT16 _C_CharClassTable[128] = {
|
const UINT16 _C_CharClassTable[128] = {
|
||||||
/* 00 NUL */ ( _CC ),
|
/* 00 NUL */ ( _CC ),
|
||||||
/* 01 SOH */ ( _CC ),
|
/* 01 SOH */ ( _CC ),
|
||||||
@ -149,7 +148,7 @@ const UINT16 _C_CharClassTable[128] = {
|
|||||||
/* 7F DEL */ ( _CC )
|
/* 7F DEL */ ( _CC )
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ASCII-8 Upper case to Lower case character conversion table
|
/// ASCII-7 Upper case to Lower case character conversion table
|
||||||
const UINT8 _C_ToLowerTable[128] = {
|
const UINT8 _C_ToLowerTable[128] = {
|
||||||
/* 00 NUL */ 0x00, /* 01 SOH */ 0x01,
|
/* 00 NUL */ 0x00, /* 01 SOH */ 0x01,
|
||||||
/* 02 STX */ 0x02, /* 03 ETX */ 0x03,
|
/* 02 STX */ 0x02, /* 03 ETX */ 0x03,
|
||||||
@ -217,7 +216,7 @@ const UINT8 _C_ToLowerTable[128] = {
|
|||||||
/* 7E '~' */ 0x7E, /* 7F DEL */ 0x7F
|
/* 7E '~' */ 0x7E, /* 7F DEL */ 0x7F
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ASCII-8 Lower case to Upper case character conversion table
|
/// ASCII-7 Lower case to Upper case character conversion table
|
||||||
const UINT8 _C_ToUpperTable[128] = {
|
const UINT8 _C_ToUpperTable[128] = {
|
||||||
/* 00 NUL */ 0x00, /* 01 SOH */ 0x01,
|
/* 00 NUL */ 0x00, /* 01 SOH */ 0x01,
|
||||||
/* 02 STX */ 0x02, /* 03 ETX */ 0x03,
|
/* 02 STX */ 0x02, /* 03 ETX */ 0x03,
|
||||||
@ -285,15 +284,21 @@ const UINT8 _C_ToUpperTable[128] = {
|
|||||||
/* 7E '~' */ 0x7E, /* 7F DEL */ 0x7F
|
/* 7E '~' */ 0x7E, /* 7F DEL */ 0x7F
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Default character classification table is 8-bit ASCII
|
/// Default character classification table is 7-bit ASCII
|
||||||
const UINT16 *_cClass = _C_CharClassTable;
|
const UINT16 *_cClass = _C_CharClassTable;
|
||||||
|
|
||||||
/// Default upper to lower conversion table is 8-bit ASCII
|
/// Default upper to lower conversion table is 7-bit ASCII
|
||||||
const UINT8 *_lConvT = _C_ToLowerTable;
|
const UINT8 *_lConvT = _C_ToLowerTable;
|
||||||
|
|
||||||
/// Default lower to upper conversion table is 8-bit ASCII
|
/// Default lower to upper conversion table is 7-bit ASCII
|
||||||
const UINT8 *_uConvT = _C_ToUpperTable;
|
const UINT8 *_uConvT = _C_ToUpperTable;
|
||||||
|
|
||||||
|
/** Sets the character classification and case conversion tables for the 'C' locale.
|
||||||
|
|
||||||
|
A set of locale-independent pointers are used to point to the classification and
|
||||||
|
conversion tables for the currently specified locale. This function is used to
|
||||||
|
establish the tables for the 'C' locale.
|
||||||
|
**/
|
||||||
void
|
void
|
||||||
__set_C_locale( void )
|
__set_C_locale( void )
|
||||||
{
|
{
|
||||||
|
@ -1,31 +1,57 @@
|
|||||||
/**
|
/** @file
|
||||||
Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
|
The implementation of the __assert function used internally by the assert macro
|
||||||
|
to insert diagnostic messages into code.
|
||||||
|
|
||||||
|
Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
|
||||||
This program and the accompanying materials are licensed and made available under
|
This program and the accompanying materials are licensed and made available under
|
||||||
the terms and conditions of the BSD License that accompanies this distribution.
|
the terms and conditions of the BSD License that accompanies this distribution.
|
||||||
The full text of the license may be found at
|
The full text of the license may be found at
|
||||||
http://opensource.org/licenses/bsd-license.php.
|
http://opensource.org/licenses/bsd-license.
|
||||||
|
|
||||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||||
**/
|
**/
|
||||||
//#include <Uefi.h>
|
|
||||||
//#include <Library/UefiLib.h>
|
|
||||||
|
|
||||||
#include <LibConfig.h>
|
#include <LibConfig.h>
|
||||||
#include <sys/EfiCdefs.h>
|
#include <sys/EfiCdefs.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
/** Internal helper function for the assert macro.
|
||||||
|
The __assert function prints a diagnostic message then exits the
|
||||||
|
currently running application.
|
||||||
|
|
||||||
|
This function should NEVER be called directly.
|
||||||
|
|
||||||
|
Some pre-processors do not provide the __func__ identifier. When that is
|
||||||
|
the case, __func__ will be NULL. This function accounts for this and
|
||||||
|
will modify the diagnostic message appropriately.
|
||||||
|
|
||||||
|
|
||||||
|
@param[in] file The name of the file containing the assert.
|
||||||
|
@param[in] func The name of the function containing the assert
|
||||||
|
or NULL.
|
||||||
|
@param[in] line The line number the assert is located on.
|
||||||
|
@param[in] failedexpr A literal representation of the assert's expression.
|
||||||
|
|
||||||
|
@return The __assert function will never return. It terminates execution
|
||||||
|
of the current application and returns to the environment that
|
||||||
|
the application was launched from.
|
||||||
|
**/
|
||||||
void
|
void
|
||||||
__assert(const char *func, const char *file, int line, const char *failedexpr)
|
__assert(
|
||||||
|
IN const char *file,
|
||||||
|
IN const char *func,
|
||||||
|
IN int line,
|
||||||
|
IN const char *failedexpr
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (func == NULL)
|
if (func == NULL)
|
||||||
printf("Assertion failed: (%s), file %s, line %d.\n",
|
printf("Assertion failed: (%s), file %s, line %d.\n",
|
||||||
failedexpr, file, line);
|
failedexpr, file, line);
|
||||||
else
|
else
|
||||||
printf("Assertion failed: (%s), function %s, file %s, line %d.\n",
|
printf("Assertion failed: (%s), file %s, function %s, line %d.\n",
|
||||||
failedexpr, func, file, line);
|
failedexpr, file, func, line);
|
||||||
abort();
|
abort();
|
||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user