]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Update or add comments to files and functions for use by Doxygen.
authordarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Aug 2011 18:13:02 +0000 (18:13 +0000)
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 4 Aug 2011 18:13:02 +0000 (18:13 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12089 6f19259b-4bc3-4df7-8a09-765794883524

StdLib/Include/assert.h
StdLib/Include/ctype.h
StdLib/Include/errno.h
StdLib/Include/sys/_ctype.h
StdLib/Include/sys/errno.h
StdLib/LibC/Ctype/CClass.c
StdLib/LibC/Ctype/CConv.c
StdLib/LibC/Ctype/iCtype.c
StdLib/LibC/Main/assert.c

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