]> 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>
Wed, 17 Aug 2011 22:54:56 +0000 (22:54 +0000)
committerdarylm503 <darylm503@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 17 Aug 2011 22:54:56 +0000 (22:54 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12153 6f19259b-4bc3-4df7-8a09-765794883524

StdLib/Include/stdio.h
StdLib/Include/stdlib.h
StdLib/Include/string.h
StdLib/Include/sys/EfiSysCall.h
StdLib/Include/time.h
StdLib/Include/wchar.h
StdLib/Include/wctype.h

index 7f3204bf74924648b19b42589cbf01952cb378e6..f916f9e34f879cc6352c8fdbb6064c53cec57ebf 100644 (file)
@@ -715,8 +715,7 @@ int       setvbuf (FILE * __restrict fp, char * __restrict Buff, int BufMode, si
     @param[in]  stream    An open File specifier to which the output is sent.\r
     @param[in]  format    A multi-byte character sequence containing characters\r
                           to be copied unchanged, and conversion specifiers\r
-                          which convert their associated arguments.  Copied and\r
-                          converted characters are sent to the output stream.\r
+                          which convert their associated arguments.\r
     @param      ...       Variable number of parameters as required by format.\r
 \r
     @return     The fprintf function returns the number of characters\r
index d51d4bffd28a3edd5eb0db8e641981b99412b95e..1166847867295764ed9e9d5a963ff32289f784f1 100644 (file)
   The header <stdlib.h> declares five types and several functions of general\r
   utility, and defines several macros.\r
 \r
+  The files stddef.h and stdlib.h are "catch all" headers for definitions and declarations\r
+  that don't fit well in the other headers.  There are two separate header files because\r
+  the contents of <stddef.h> are valid in both freestanding and hosted environment, while the\r
+  header <stdlib.h> contains elements that are only valid in a hosted environment.\r
+\r
+  The following macros are defined in this file:<BR>\r
+  @verbatim\r
+    EXIT_FAILURE    An expression indicating application failure, used as an argument to exit().\r
+    EXIT_SUCCESS    An expression indicating application success, used as an argument to exit().\r
+    RAND_MAX        The maximum value returned by the rand function.\r
+    MB_CUR_MAX      Maximum number of bytes in a multibyte character for the current locale.\r
+    ATEXIT_MAX      Maximum number of routines that may be registered by the atexit function.\r
+  @endverbatim\r
+\r
+  The following types are defined in this file:<BR>\r
+  @verbatim\r
+    size_t      Unsigned integer type of the result of the sizeof operator.\r
+    wchar_t     The type of a wide character.\r
+    div_t       Type of the value returned by the div function.\r
+    ldiv_t      Type of the value returned by the ldiv function.\r
+    lldiv_t     Type of the value returned by the lldiv function.\r
+  @endverbatim\r
+\r
+  The following functions are declared in this file:<BR>\r
+  @verbatim\r
+    ################  Communication with the environment\r
+    void        abort   (void) __noreturn;\r
+    int         atexit  (void (*)(void));\r
+    void        exit    (int status) __noreturn;\r
+    void        _Exit   (int status) __noreturn;\r
+    char       *getenv  (const char *name);\r
+    int         setenv  (register const char * name,\r
+                         register const char * value, int rewrite);\r
+    int         system  (const char *string);\r
+\r
+    ################  Integer arithmetic functions\r
+    int         abs     (int j);\r
+    long        labs    (long j);\r
+    long long   llabs   (long long j);\r
+    div_t       div     (int numer, int denom);\r
+    ldiv_t      ldiv    (long numer, long denom);\r
+    lldiv_t     lldiv   (long long numer, long long denom);\r
+\r
+    ################  Pseudo-random sequence generation functions\r
+    int         rand    (void);\r
+    void        srand   (unsigned seed);\r
+\r
+    ################  Memory management functions\r
+    void       *calloc  (size_t Num, size_t Size);\r
+    void        free    (void *);\r
+    void       *malloc  (size_t);\r
+    void       *realloc (void *Ptr, size_t NewSize);\r
+\r
+    ################  Searching and Sorting utilities\r
+    void       *bsearch (const void *key,  const void *base0,\r
+                         size_t nmemb,     size_t size,\r
+                         int (*compar)(const void *, const void *));\r
+    void        qsort   (void *base, size_t nmemb, size_t size,\r
+                         int (*compar)(const void *, const void *));\r
+\r
+    ################  Multibyte/wide character conversion functions\r
+    int         mblen   (const char *, size_t);\r
+    int         mbtowc  (wchar_t * __restrict, const char * __restrict, size_t);\r
+    int         wctomb  (char *, wchar_t);\r
+\r
+    ################  Multibyte/wide string conversion functions\r
+    size_t      mbstowcs  (wchar_t * __restrict dest,\r
+                           const char * __restrict src, size_t limit);\r
+    size_t      wcstombs  (char * __restrict dest,\r
+                           const wchar_t * __restrict src, size_t limit);\r
+\r
+    ################  Miscelaneous functions for *nix compatibility\r
+    char       *realpath    (char *file_name, char *resolved_name);\r
+    const char *getprogname (void);\r
+    void        setprogname (const char *progname);\r
+\r
+    ############  Integer Numeric conversion functions\r
+    int                   atoi      (const char *nptr);\r
+    long                  atol      (const char *nptr);\r
+    long long             atoll     (const char *nptr);\r
+    long                  strtol    (const char * __restrict nptr,\r
+                                     char ** __restrict endptr, int base);\r
+    unsigned long         strtoul   (const char * __restrict nptr,\r
+                                     char ** __restrict endptr, int base);\r
+    long long             strtoll   (const char * __restrict nptr,\r
+                                     char ** __restrict endptr, int base);\r
+    unsigned long long    strtoull  (const char * __restrict nptr,\r
+                                     char ** __restrict endptr, int base);\r
+\r
+    #########  Floating-point Numeric conversion functions\r
+    double                atof      (const char *);\r
+    double                strtod    (const char * __restrict nptr,\r
+                                     char ** __restrict endptr);\r
+    float                 strtof    (const char * __restrict nptr,\r
+                                     char ** __restrict endptr);\r
+    long double           strtold   (const char * __restrict nptr,\r
+                                     char ** __restrict endptr);\r
+  @endverbatim\r
+\r
   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available under\r
   the terms and conditions of the BSD License that accompanies this distribution.\r
   The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.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 _STDLIB_H\r
 #define _STDLIB_H\r
 #include  <sys/EfiCdefs.h>\r
 \r
 #ifdef _EFI_SIZE_T_\r
+  /** Unsigned integer type of the result of the sizeof operator. **/\r
   typedef _EFI_SIZE_T_  size_t;\r
   #undef _EFI_SIZE_T_\r
   #undef _BSD_SIZE_T_\r
 \r
 #ifndef __cplusplus\r
   #ifdef _EFI_WCHAR_T\r
+    /** Type of a wide (Unicode) character. **/\r
     typedef _EFI_WCHAR_T wchar_t;\r
     #undef  _EFI_WCHAR_T\r
     #undef _BSD_WCHAR_T_\r
 \r
 /// A structure type that is the type of the value returned by the div function.\r
 typedef struct {\r
-  int quot;   /* quotient */\r
-  int rem;    /* remainder */\r
+  int quot;   /**< quotient */\r
+  int rem;    /**< remainder */\r
 } div_t;\r
 \r
 /// A structure type that is the type of the value returned by the ldiv function.\r
@@ -48,17 +148,17 @@ typedef struct {
   long long rem;\r
 } lldiv_t;\r
 \r
-/** Expand to integer constant expressions that can be used as the argument to\r
+/** @{\r
+    Expand to integer constant expressions that can be used as the argument to\r
     the exit function to return unsuccessful or successful termination status,\r
     respectively, to the host environment.\r
 **/\r
 #define EXIT_FAILURE  1\r
 #define EXIT_SUCCESS  0\r
+/*@}*/\r
 \r
 /** Expands to an integer constant expression that is the maximum value\r
     returned by the rand function.\r
-\r
-    The value of the RAND_MAX macro shall be at least 32767.\r
 **/\r
 #define RAND_MAX  0x7fffffff\r
 \r
@@ -98,10 +198,13 @@ void    abort(void) __noreturn;
 \r
     The implementation supports the registration of up to 32 functions.\r
 \r
+    @param[in]  Handler   Pointer to the function to register as one of the\r
+                          routines to call at application exit time.\r
+\r
     @return   The atexit function returns zero if the registration succeeds,\r
               nonzero if it fails.\r
 **/\r
-int     atexit(void (*)(void));\r
+int     atexit(void (*Handler)(void));\r
 \r
 /** The exit function causes normal program termination to occur. If more than\r
     one call to the exit function is executed by a program,\r
@@ -118,14 +221,13 @@ int     atexit(void (*)(void));
     streams are closed, and all files created by the tmpfile function\r
     are removed.\r
 \r
-    Finally, control is returned to the host environment. If the value of\r
-    status is zero, or EXIT_SUCCESS, status is returned unchanged. If the value\r
-    of status is EXIT_FAILURE, EAPPLICATION is returned.\r
-    Otherwise, status is returned unchanged.\r
+    Finally, control is returned to the host environment.\r
+\r
+    @param[in]  status    A value to be returned when the application exits.\r
 \r
-    While this function does not return, it can NOT be marked as "__noreturn"\r
-    without causing a warning to be emitted because the compilers can not\r
-    determine that the function truly does not return.\r
+    @return   If the value of status is zero, or EXIT_SUCCESS, status is\r
+              returned unchanged. If the value of status is EXIT_FAILURE,\r
+              RETURN_ABORTED is returned.  Otherwise, status is returned unchanged.\r
 **/\r
 void    exit(int status) __noreturn;\r
 \r
@@ -137,12 +239,14 @@ void    exit(int status) __noreturn;
     buffered data are not flushed, open streams are not closed, and temporary\r
     files are not removed by abort.\r
 \r
-    While this function does not return, it can NOT be marked as "__noreturn"\r
-    without causing a warning to be emitted because the compilers can not\r
-    determine that the function truly does not return.\r
-\r
     The status returned to the host environment is determined in the same way\r
     as for the exit function.\r
+\r
+    @param[in]  status    A value to be returned when the application exits.\r
+\r
+    @return   If the value of status is zero, or EXIT_SUCCESS, status is\r
+              returned unchanged. If the value of status is EXIT_FAILURE,\r
+              RETURN_ABORTED is returned.  Otherwise, status is returned unchanged.\r
 **/\r
 void    _Exit(int status) __noreturn;\r
 \r
@@ -151,6 +255,8 @@ void    _Exit(int status) __noreturn;
     set of environment names and the method for altering the environment list\r
     are determined by the underlying UEFI Shell implementation.\r
 \r
+    @param[in]  name    Pointer to a string naming the environment variable to retrieve.\r
+\r
     @return   The getenv function returns a pointer to a string associated with\r
               the matched list member.  The string pointed to shall not be\r
               modified by the program, but may be overwritten by a subsequent\r
@@ -159,16 +265,14 @@ void    _Exit(int status) __noreturn;
 **/\r
 char   *getenv(const char *name);\r
 \r
-/**\r
-  Add or update a variable in the environment list\r
-\r
-  @param name     Address of a zero terminated name string\r
-  @param value    Address of a zero terminated value string\r
-  @param rewrite  TRUE allows overwriting existing values\r
+/** Add or update a variable in the environment list.\r
 \r
-  @retval Returns 0 upon success\r
-  @retval Returns -1 upon failure, sets errno with more information\r
+    @param[in]  name     Address of a zero terminated name string.\r
+    @param[in]  value    Address of a zero terminated value string.\r
+    @param[in]  rewrite  TRUE allows overwriting existing values.\r
 \r
+    @retval  0  Returns 0 upon success.\r
+    @retval -1  Returns -1 upon failure, sets errno with more information.\r
 **/\r
 int\r
 setenv (\r
@@ -184,6 +288,8 @@ setenv (
     document; this might then cause the program calling system to behave in a\r
     non-conforming manner or to terminate.\r
 \r
+    @param[in]  string    Pointer to the command string to be executed.\r
+\r
     @return   If the argument is a null pointer, the system function returns\r
               nonzero only if a command processor is available. If the argument\r
               is not a null pointer, and the system function does return, it\r
@@ -196,17 +302,23 @@ int     system(const char *string);
 \r
 /** Computes the absolute value of an integer j.\r
 \r
+    @param[in]  j   The value to find the absolute value of.\r
+\r
     @return   The absolute value of j.\r
 **/\r
 int     abs(int j);\r
 \r
-/** Computes the absolute value of an integer j.\r
+/** Computes the absolute value of a long integer j.\r
+\r
+    @param[in]  j   The value to find the absolute value of.\r
 \r
     @return   The absolute value of j.\r
 **/\r
 long    labs(long j);\r
 \r
-/** Computes the absolute value of an integer j.\r
+/** Computes the absolute value of a long long integer j.\r
+\r
+    @param[in]  j   The value to find the absolute value of.\r
 \r
     @return   The absolute value of j.\r
 **/\r
@@ -215,6 +327,9 @@ long long
 \r
 /** Computes numer / denom and numer % denom in a single operation.\r
 \r
+    @param[in]  numer   The numerator for the division.\r
+    @param[in]  denom   The denominator for the division.\r
+\r
     @return   Returns a structure of type div_t, comprising both the\r
               quotient and the remainder.\r
 **/\r
@@ -222,6 +337,9 @@ div_t   div(int numer, int denom);
 \r
 /** Computes numer / denom and numer % denom in a single operation.\r
 \r
+    @param[in]  numer   The numerator for the division.\r
+    @param[in]  denom   The denominator for the division.\r
+\r
     @return   Returns a structure of type ldiv_t, comprising both the\r
               quotient and the remainder.\r
 **/\r
@@ -229,6 +347,9 @@ ldiv_t  ldiv(long numer, long denom);
 \r
 /** Computes numer / denom and numer % denom in a single operation.\r
 \r
+    @param[in]  numer   The numerator for the division.\r
+    @param[in]  denom   The denominator for the division.\r
+\r
     @return   Returns a structure of type lldiv_t, comprising both the\r
               quotient and the remainder.\r
 **/\r
@@ -241,7 +362,9 @@ lldiv_t lldiv(long long numer, long long denom);
     equivalent to:\r
       - atoi: (int)strtol(nptr, (char **)NULL, 10)\r
 \r
-  @return   The atoi function returns the converted value.\r
+    @param[in]  nptr  Pointer to the string to be converted.\r
+\r
+    @return   The atoi function returns the converted value.\r
 **/\r
 int     atoi(const char *nptr);\r
 \r
@@ -250,7 +373,9 @@ int     atoi(const char *nptr);
     equivalent to:\r
       - atol: strtol(nptr, (char **)NULL, 10)\r
 \r
-  @return   The atol function returns the converted value.\r
+    @param[in]  nptr  Pointer to the string to be converted.\r
+\r
+    @return   The atol function returns the converted value.\r
 **/\r
 long    atol(const char *nptr);\r
 \r
@@ -259,7 +384,9 @@ long    atol(const char *nptr);
     is equivalent to:\r
       - atoll: strtoll(nptr, (char **)NULL, 10)\r
 \r
-  @return   The atoll function returns the converted value.\r
+    @param[in]  nptr  Pointer to the string to be converted.\r
+\r
+    @return   The atoll function returns the converted value.\r
 **/\r
 long long\r
         atoll(const char *nptr);\r
@@ -276,7 +403,7 @@ long long
     integer, and return the result.\r
 \r
     If the value of base is zero, the expected form of the subject sequence is\r
-    that of an integer constant as described in 6.4.4.1, optionally preceded\r
+    that of an integer constant, optionally preceded\r
     by a plus or minus sign, but not including an integer suffix. If the value\r
     of base is between 2 and 36 (inclusive), the expected form of the subject\r
     sequence is a sequence of letters and digits representing an integer with\r
@@ -310,13 +437,17 @@ long long
     conversion is performed; the value of nptr is stored in the object pointed\r
     to by endptr, provided that endptr is not a null pointer.\r
 \r
-  @return   The strtol, strtoll, strtoul, and strtoull functions return the\r
-            converted value, if any. If no conversion could be performed, zero\r
-            is returned. If the correct value is outside the range of\r
-            representable values, LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX,\r
-            ULONG_MAX, or ULLONG_MAX is returned (according to the return type\r
-            and sign of the value, if any), and the value of the macro ERANGE\r
-            is stored in errno.\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
+    @param[in]    base    The base, 0 to 36, of the number represented by the input string.\r
+\r
+    @return   The strtol, strtoll, strtoul, and strtoull functions return the\r
+              converted value, if any. If no conversion could be performed, zero\r
+              is returned. If the correct value is outside the range of\r
+              representable values, LONG_MIN, LONG_MAX, LLONG_MIN, LLONG_MAX,\r
+              ULONG_MAX, or ULLONG_MAX is returned (according to the return type\r
+              and sign of the value, if any), and the value of the macro ERANGE\r
+              is stored in errno.\r
 **/\r
 long    strtol(const char * __restrict nptr, char ** __restrict endptr, int base);\r
 \r
@@ -325,10 +456,14 @@ long    strtol(const char * __restrict nptr, char ** __restrict endptr, int base
 \r
     See the description for strtol for more information.\r
 \r
-  @return   The strtoul function returns the converted value, if any. If no\r
-            conversion could be performed, zero is returned. If the correct\r
-            value is outside the range of representable values, ULONG_MAX is\r
-            returned and the value of the macro ERANGE is stored in errno.\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
+    @param[in]    base    The base, 0 to 36, of the number represented by the input string.\r
+\r
+    @return   The strtoul function returns the converted value, if any. If no\r
+              conversion could be performed, zero is returned. If the correct\r
+              value is outside the range of representable values, ULONG_MAX is\r
+              returned and the value of the macro ERANGE is stored in errno.\r
 **/\r
 unsigned long\r
         strtoul(const char * __restrict nptr, char ** __restrict endptr, int base);\r
@@ -338,11 +473,15 @@ unsigned long
 \r
     See the description for strtol for more information.\r
 \r
-  @return   The strtoll function returns the converted value, if any. If no\r
-            conversion could be performed, zero is returned. If the correct\r
-            value is outside the range of representable values, LLONG_MIN or\r
-            LLONG_MAX is returned (according to the sign of the value, if any),\r
-            and the value of the macro ERANGE is stored in errno.\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
+    @param[in]    base    The base, 0 to 36, of the number represented by the input string.\r
+\r
+    @return   The strtoll function returns the converted value, if any. If no\r
+              conversion could be performed, zero is returned. If the correct\r
+              value is outside the range of representable values, LLONG_MIN or\r
+              LLONG_MAX is returned (according to the sign of the value, if any),\r
+              and the value of the macro ERANGE is stored in errno.\r
 **/\r
 long long\r
         strtoll(const char * __restrict nptr, char ** __restrict endptr, int base);\r
@@ -352,40 +491,83 @@ long long
 \r
     See the description for strtol for more information.\r
 \r
-  @return   The strtoull function returns the converted value, if any. If no\r
-            conversion could be performed, zero is returned. If the correct\r
-            value is outside the range of representable values, ULLONG_MAX is\r
-            returned and the value of the macro ERANGE is stored in errno.\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
+    @param[in]    base    The base, 0 to 36, of the number represented by the input string.\r
+\r
+    @return   The strtoull function returns the converted value, if any. If no\r
+              conversion could be performed, zero is returned. If the correct\r
+              value is outside the range of representable values, ULLONG_MAX is\r
+              returned and the value of the macro ERANGE is stored in errno.\r
 **/\r
 unsigned long long\r
         strtoull(const char * __restrict nptr, char ** __restrict endptr, int base);\r
 \r
 /* #########  Floating-point Numeric conversion functions  ################ */\r
 \r
-/**\r
+/** Convert the initial part of a string to double representation.\r
+\r
+    @param[in]  nptr  Pointer to the string to be converted.\r
 \r
-  @return\r
+    @return   The floating-point value representing the string nptr.\r
 **/\r
-double  atof(const char *);\r
+double  atof(const char *nptr);\r
+\r
+/** @{\r
+    The strtod, strtof, and strtold functions convert the initial portion of\r
+    the string pointed to by nptr to double, float, and long double\r
+    representation, respectively. First, they decompose the input string into\r
+    three parts: an initial, possibly empty, sequence of white-space characters\r
+    (as specified by the isspace function), a subject sequence resembling a\r
+    floating-point constant or representing an infinity or NaN; and a final\r
+    string of one or more unrecognized characters, including the terminating\r
+    null character of the input string. Then, they attempt to convert the\r
+    subject sequence to a floating-point number, and return the result.\r
+*/\r
+\r
+/** Convert a string to a double and point to the character after the last converted.\r
 \r
-/**\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
 \r
-  @return\r
+    @return   A floating-point value representing the string nptr.\r
+              A pointer to the final string is stored in the object pointed to\r
+              by endptr, provided that endptr is not a null pointer.\r
+              If the subject sequence is empty or does not have the expected\r
+              form, no conversion is performed; the value of nptr is stored in\r
+              the object pointed to by endptr, provided that endptr is not a null pointer.\r
 **/\r
 double  strtod(const char * __restrict nptr, char ** __restrict endptr);\r
 \r
-/**\r
+/** Convert a string to a float and point to the character after the last converted.\r
 \r
-  @return\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
+\r
+    @return   A floating-point value representing the string nptr.\r
+              A pointer to the final string is stored in the object pointed to\r
+              by endptr, provided that endptr is not a null pointer.\r
+              If the subject sequence is empty or does not have the expected\r
+              form, no conversion is performed; the value of nptr is stored in\r
+              the object pointed to by endptr, provided that endptr is not a null pointer.\r
 **/\r
 float   strtof(const char * __restrict nptr, char ** __restrict endptr);\r
 \r
-/**\r
+/** Convert a string to a long double and point to the character after the last converted.\r
+\r
+    @param[in]    nptr    Pointer to the string to be converted.\r
+    @param[out]   endptr  If not NULL, points to an object to receive a pointer to the final string.\r
 \r
-  @return\r
+    @return   A floating-point value representing the string nptr.\r
+              A pointer to the final string is stored in the object pointed to\r
+              by endptr, provided that endptr is not a null pointer.\r
+              If the subject sequence is empty or does not have the expected\r
+              form, no conversion is performed; the value of nptr is stored in\r
+              the object pointed to by endptr, provided that endptr is not a null pointer.\r
 **/\r
 long double\r
         strtold(const char * __restrict nptr, char ** __restrict endptr);\r
+/*@}*/\r
 \r
 /* ################  Pseudo-random sequence generation functions  ######### */\r
 \r
@@ -403,6 +585,8 @@ int     rand(void);
     pseudo-random numbers shall be repeated. If rand is called before any calls\r
     to srand have been made, the same sequence shall be generated as when srand\r
     is first called with a seed value of 1.\r
+\r
+    @param[in]  seed    The value used to "seed" the random number generator with.\r
 **/\r
 void    srand(unsigned seed);\r
 \r
@@ -411,6 +595,9 @@ void    srand(unsigned seed);
 /** The calloc function allocates space for an array of Num objects, each of\r
     whose size is Size.  The space is initialized to all bits zero.\r
 \r
+    @param[in]  Num   The number of objects to allocate space for.\r
+    @param[in]  Size  The size, in bytes, of each object.\r
+\r
     @return   NULL is returned if the space could not be allocated and errno\r
               contains the cause.  Otherwise, a pointer to an 8-byte aligned\r
               region of the requested size is returned.\r
@@ -426,9 +613,8 @@ void   *calloc(size_t Num, size_t Size);
     realloc, the behavior is undefined.\r
 \r
     @param  Ptr     Pointer to a previously allocated region of memory to be freed.\r
-\r
 **/\r
-void    free(void *);\r
+void    free(void *Ptr);\r
 \r
 /** The malloc function allocates space for an object whose size is specified\r
     by size and whose value is indeterminate.\r
@@ -437,7 +623,7 @@ void    free(void *);
     region of memory that is 8-byte aligned and of the specified size.  The\r
     region is allocated with type EfiLoaderData.\r
 \r
-    @param  size    Size, in bytes, of the region to allocate.\r
+    @param  Size    Size, in bytes, of the region to allocate.\r
 \r
     @return   NULL is returned if the space could not be allocated and errno\r
               contains the cause.  Otherwise, a pointer to an 8-byte aligned\r
@@ -446,7 +632,7 @@ void    free(void *);
               - EINVAL: Requested Size is zero.\r
               - ENOMEM: Memory could not be allocated.\r
 **/\r
-void   *malloc(size_t);\r
+void   *malloc(size_t Size);\r
 \r
 /** The realloc function changes the size of the object pointed to by Ptr to\r
     the size specified by NewSize.\r
@@ -483,35 +669,40 @@ void   *realloc(void *Ptr, size_t NewSize);
 \r
 /* ################  Searching and Sorting utilities  ##################### */\r
 \r
-/** The bsearch function searches an array of nmemb objects, the initial\r
-    element of which is pointed to by base, for an element that matches the\r
-    object pointed to by key. The size of each element of the array is\r
-    specified by size.\r
+/** The bsearch function searches an array of Nmemb objects, the initial\r
+    element of which is pointed to by Base, for an element that matches the\r
+    object pointed to by Key. The size of each element of the array is\r
+    specified by Size.\r
 \r
-    The comparison function pointed to by compar is called with two arguments\r
-    that point to the key object and to an array element, in that order. The\r
+    The comparison function pointed to by Compar is called with two arguments\r
+    that point to the Key object and to an array element, in that order. The\r
     function returns an integer less than, equal to, or greater than zero if\r
-    the key object is considered, respectively, to be less than, to match, or\r
+    the Key object is considered, respectively, to be less than, to match, or\r
     to be greater than the array element. The array consists of: all the\r
     elements that compare less than, all the elements that compare equal to,\r
     and all the elements that compare greater than the key object,\r
     in that order.\r
 \r
-  @return   The bsearch function returns a pointer to a matching element of the\r
-            array, or a null pointer if no match is found. If two elements\r
-            compare as equal, which element is matched is unspecified.\r
+    @param[in]  Key     Pointer to the object to search for.\r
+    @param[in]  Base    Pointer to the first element of an array to search.\r
+    @param[in]  Nmemb   Number of objects in the search array.\r
+    @param[in]  Size    The size of each object in the search array.\r
+    @param[in]  Compar  Pointer to the function used to compare two objects.\r
+\r
+    @return   The bsearch function returns a pointer to a matching element of the\r
+              array, or a null pointer if no match is found. If two elements\r
+              compare as equal, which element is matched is unspecified.\r
 **/\r
-void *\r
-bsearch(  const void *key,  const void *base0,\r
-          size_t nmemb,     size_t size,\r
-          int (*compar)(const void *, const void *)\r
-);\r
+void   *bsearch(  const void *Key,  const void *Base,\r
+                  size_t Nmemb,     size_t Size,\r
+                  int (*Compar)(const void *, const void *)\r
+        );\r
 \r
-/** The qsort function sorts an array of nmemb objects, the initial element of\r
-    which is pointed to by base.  The size of each object is specified by size.\r
+/** The qsort function sorts an array of Nmemb objects, the initial element of\r
+    which is pointed to by Base.  The size of each object is specified by Size.\r
 \r
     The contents of the array are sorted into ascending order according to a\r
-    comparison function pointed to by compar, which is called with two\r
+    comparison function pointed to by Compar, which is called with two\r
     arguments that point to the objects being compared. The function shall\r
     return an integer less than, equal to, or greater than zero if the first\r
     argument is considered to be respectively less than, equal to, or greater\r
@@ -519,165 +710,183 @@ bsearch(  const void *key,  const void *base0,
 \r
     If two elements compare as equal, their order in the resulting sorted array\r
     is unspecified.\r
+\r
+    @param[in,out]  Base    Pointer to the first element of an array to sort.\r
+    @param[in]      Nmemb   Number of objects in the array.\r
+    @param[in]      Size    The size of each object in the array.\r
+    @param[in]      Compar  Pointer to the function used to compare two objects.\r
 **/\r
-void qsort( void *base, size_t nmemb, size_t size,\r
-            int (*compar)(const void *, const void *));\r
+void    qsort( void *base, size_t nmemb, size_t size,\r
+               int (*compar)(const void *, const void *));\r
 \r
 /* ################  Multibyte/wide character conversion functions  ####### */\r
 \r
 /** Determine the number of bytes comprising a multibyte character.\r
 \r
-  If s is not a null pointer, the mblen function determines the number of bytes\r
-  contained in the multibyte character pointed to by s. Except that the\r
+  If S is not a null pointer, the mblen function determines the number of bytes\r
+  contained in the multibyte character pointed to by S. Except that the\r
   conversion state of the mbtowc function is not affected, it is equivalent to\r
-    mbtowc((wchar_t *)0, s, n);\r
+    mbtowc((wchar_t *)0, S, N);\r
 \r
-  The implementation shall behave as if no library function calls the mblen\r
-  function.\r
+  @param[in]  S   NULL to query whether multibyte characters have\r
+                  state-dependent encodings.  Otherwise, points to a\r
+                  multibyte character.\r
+  @param[in]  N   The maximum number of bytes in a multibyte character.\r
 \r
-  @return   If s is a null pointer, the mblen function returns a nonzero or\r
+  @return   If S is a null pointer, the mblen function returns a nonzero or\r
             zero value, if multibyte character encodings, respectively, do\r
-            or do not have state-dependent encodings. If s is not a null\r
-            pointer, the mblen function either returns 0 (if s points to the\r
+            or do not have state-dependent encodings. If S is not a null\r
+            pointer, the mblen function either returns 0 (if S points to the\r
             null character), or returns the number of bytes that are contained\r
-            in the multibyte character (if the next n or fewer bytes form a\r
+            in the multibyte character (if the next N or fewer bytes form a\r
             valid multibyte character), or returns -1 (if they do not form a\r
             valid multibyte character).\r
 **/\r
-int     mblen(const char *, size_t);\r
+int     mblen(const char *S, size_t N);\r
 \r
 /** Convert a multibyte character into a wide character.\r
 \r
-    If s is not a null pointer, the mbtowc function inspects at most n bytes\r
-    beginning with the byte pointed to by s to determine the number of bytes\r
+    If S is not a null pointer, the mbtowc function inspects at most N bytes\r
+    beginning with the byte pointed to by S to determine the number of bytes\r
     needed to complete the next multibyte character (including any shift\r
     sequences). If the function determines that the next multibyte character\r
     is complete and valid, it determines the value of the corresponding wide\r
-    character and then, if pwc is not a null pointer, stores that value in\r
-    the object pointed to by pwc. If the corresponding wide character is the\r
+    character and then, if Pwc is not a null pointer, stores that value in\r
+    the object pointed to by Pwc. If the corresponding wide character is the\r
     null wide character, the function is left in the initial conversion state.\r
 \r
-    The implementation shall behave as if no library function calls the\r
-    mbtowc function.\r
+    @param[out]   Pwc Pointer to a wide-character object to receive the converted character.\r
+    @param[in]    S   Pointer to a multibyte character to convert.\r
+    @param[in]    N   Maximum number of bytes in a multibyte character.\r
 \r
-    @return   If s is a null pointer, the mbtowc function returns a nonzero or\r
+    @return   If S is a null pointer, the mbtowc function returns a nonzero or\r
               zero value, if multibyte character encodings, respectively, do\r
-              or do not have state-dependent encodings. If s is not a null\r
-              pointer, the mbtowc function either returns 0 (if s points to\r
+              or do not have state-dependent encodings. If S is not a null\r
+              pointer, the mbtowc function either returns 0 (if S points to\r
               the null character), or returns the number of bytes that are\r
-              contained in the converted multibyte character (if the next n or\r
+              contained in the converted multibyte character (if the next N or\r
               fewer bytes form a valid multibyte character), or returns -1\r
               (if they do not form a valid multibyte character).\r
 \r
-              In no case will the value returned be greater than n or the value\r
+              In no case will the value returned be greater than N or the value\r
               of the MB_CUR_MAX macro.\r
 **/\r
-int     mbtowc(wchar_t * __restrict, const char * __restrict, size_t);\r
+int     mbtowc(wchar_t * __restrict Pwc, const char * __restrict S, size_t N);\r
 \r
-/**\r
-The wctomb function determines the number of bytes needed to represent the multibyte\r
-character corresponding to the wide character given by wc (including any shift\r
-sequences), and stores the multibyte character representation in the array whose first\r
-element is pointed to by s (if s is not a null pointer). At most MB_CUR_MAX characters\r
-are stored. If wc is a null wide character, a null byte is stored, preceded by any shift\r
-sequence needed to restore the initial shift state, and the function is left in the initial\r
-conversion state.\r
+/** Convert a wide character into a multibyte character.\r
 \r
-The implementation shall behave as if no library function calls the wctomb function.\r
+    The wctomb function determines the number of bytes needed to represent the\r
+    multibyte character corresponding to the wide character given by WC\r
+    (including any shift sequences), and stores the multibyte character\r
+    representation in the array whose first element is pointed to by S (if S is\r
+    not a null pointer). At most MB_CUR_MAX characters are stored. If WC is a\r
+    null wide character, a null byte is stored, preceded by any shift sequence\r
+    needed to restore the initial shift state, and the function is left in the\r
+    initial conversion state.\r
 \r
-  @return\r
-If s is a null pointer, the wctomb function returns a nonzero or zero value, if multibyte\r
-character encodings, respectively, do or do not have state-dependent encodings. If s is\r
-not a null pointer, the wctomb function returns -1 if the value of wc does not correspond\r
-to a valid multibyte character, or returns the number of bytes that are contained in the\r
-multibyte character corresponding to the value of wc.\r
+    @param[out]   S   Pointer to the object to receive the converted multibyte character.\r
+    @param[in]    WC  Wide character to be converted.\r
 \r
-In no case will the value returned be greater than the value of the MB_CUR_MAX macro.\r
+    @return   If S is a null pointer, the wctomb function returns a nonzero or\r
+              zero value, if multibyte character encodings, respectively, do or\r
+              do not have state-dependent encodings. If S is not a null pointer,\r
+              the wctomb function returns -1 if the value of WC does not\r
+              correspond to a valid multibyte character, or returns the number\r
+              of bytes that are contained in the multibyte character\r
+              corresponding to the value of WC.\r
 \r
+              In no case will the value returned be greater than the value of\r
+              the MB_CUR_MAX macro.\r
 **/\r
-int     wctomb(char *, wchar_t);\r
+int     wctomb(char *S, wchar_t WC);\r
 \r
 /* ################  Multibyte/wide string conversion functions  ########## */\r
 \r
 /** Convert a multibyte character string into a wide-character string.\r
 \r
     The mbstowcs function converts a sequence of multibyte characters that\r
-    begins in the initial shift state from the array pointed to by src into\r
+    begins in the initial shift state from the array pointed to by Src into\r
     a sequence of corresponding wide characters and stores not more than limit\r
-    wide characters into the array pointed to by dest.  No multibyte\r
+    wide characters into the array pointed to by Dest.  No multibyte\r
     characters that follow a null character (which is converted into a null\r
     wide character) will be examined or converted. Each multibyte character\r
     is converted as if by a call to the mbtowc function, except that the\r
     conversion state of the mbtowc function is not affected.\r
 \r
-    No more than limit elements will be modified in the array pointed to by dest.\r
+    No more than Limit elements will be modified in the array pointed to by Dest.\r
     If copying takes place between objects that overlap,\r
     the behavior is undefined.\r
 \r
-  @return   If an invalid multibyte character is encountered, the mbstowcs\r
-            function returns (size_t)(-1). Otherwise, the mbstowcs function\r
-            returns the number of array elements modified, not including a\r
-            terminating null wide character, if any.\r
+    @param[out]   Dest    Pointer to the array to receive the converted string.\r
+    @param[in]    Src     Pointer to the string to be converted.\r
+    @param[in]    Limit   Maximum number of elements to be written to Dest.\r
 \r
+    @return   If an invalid multibyte character is encountered, the mbstowcs\r
+              function returns (size_t)(-1). Otherwise, the mbstowcs function\r
+              returns the number of array elements modified, not including a\r
+              terminating null wide character, if any.\r
 **/\r
-size_t  mbstowcs(wchar_t * __restrict dest, const char * __restrict src, size_t limit);\r
+size_t  mbstowcs(wchar_t * __restrict Dest, const char * __restrict Src, size_t Limit);\r
 \r
 /** Convert a wide-character string into a multibyte character string.\r
 \r
     The wcstombs function converts a sequence of wide characters from the\r
-    array pointed to by src into a sequence of corresponding multibyte\r
+    array pointed to by Src into a sequence of corresponding multibyte\r
     characters that begins in the initial shift state, and stores these\r
-    multibyte characters into the array pointed to by dest, stopping if a\r
-    multibyte character would exceed the limit of limit total bytes or if a\r
+    multibyte characters into the array pointed to by Dest, stopping if a\r
+    multibyte character would exceed the limit of Limit total bytes or if a\r
     null character is stored. Each wide character is converted as if by\r
     a call to the wctomb function, except that the conversion state of\r
     the wctomb function is not affected.\r
 \r
-    No more than limit bytes will be modified in the array pointed to by dest.\r
+    No more than Limit bytes will be modified in the array pointed to by Dest.\r
     If copying takes place between objects that overlap,\r
     the behavior is undefined.\r
 \r
-  @return   If a wide character is encountered that does not correspond to a\r
-            valid multibyte character, the wcstombs function returns\r
-            (size_t)(-1). Otherwise, the wcstombs function returns the number\r
-            of bytes modified, not including a terminating null character,\r
-            if any.\r
+    @param[out]   Dest    Pointer to the array to receive the converted string.\r
+    @param[in]    Src     Pointer to the string to be converted.\r
+    @param[in]    Limit   Maximum number of elements to be written to Dest.\r
+\r
+    @return   If a wide character is encountered that does not correspond to a\r
+              valid multibyte character, the wcstombs function returns\r
+              (size_t)(-1). Otherwise, the wcstombs function returns the number\r
+              of bytes modified, not including a terminating null character,\r
+              if any.\r
 **/\r
-size_t  wcstombs(char * __restrict dest, const wchar_t * __restrict src, size_t limit);\r
+size_t  wcstombs(char * __restrict Dest, const wchar_t * __restrict Src, size_t Limit);\r
+\r
+/* ################  Miscelaneous functions for *nix compatibility  ########## */\r
 \r
-/**\r
-  The realpath() function shall derive, from the pathname pointed to by \r
-  file_name, an absolute pathname that names the same file, whose resolution \r
-  does not involve '.', '..', or symbolic links. The generated pathname shall\r
-  be stored as a null-terminated string, up to a maximum of {PATH_MAX} bytes,\r
-  in the buffer pointed to by resolved_name.\r
+/** The realpath() function shall derive, from the pathname pointed to by\r
+    file_name, an absolute pathname that names the same file, whose resolution\r
+    does not involve '.', '..', or symbolic links. The generated pathname shall\r
+    be stored as a null-terminated string, up to a maximum of {PATH_MAX} bytes,\r
+    in the buffer pointed to by resolved_name.\r
 \r
-  If resolved_name is a null pointer, the behavior of realpath() is \r
-  implementation-defined.\r
+    If resolved_name is a null pointer, the behavior of realpath() is\r
+    implementation-defined.\r
 \r
-  @param[in] file_name            The filename to convert.\r
-  @param[in,out] resolved_name    The resultant name.\r
+    @param[in]      file_name         The filename to convert.\r
+    @param[in,out]  resolved_name     The resultant name.\r
 \r
-  @retval NULL                    An error occured.\r
-  @return resolved_name.\r
+    @retval NULL                    An error occured.\r
+    @retval resolved_name.\r
 **/\r
 char * realpath(char *file_name, char *resolved_name);\r
 \r
-/**\r
-  The getprogname() function returns the name of the program.  If the name\r
-  has not been set yet, it will return NULL.\r
+/** The getprogname() function returns the name of the program.  If the name\r
+    has not been set yet, it will return NULL.\r
 \r
-  @retval         The name of the program.\r
-  @retval NULL    The name has not been set.\r
+  @return   The getprogname function returns NULL if the program's name has not\r
+            been set, otherwise it returns the name of the program.\r
 **/\r
 const char * getprogname(void);\r
 \r
-/**\r
-  The setprogname() function sets the name of the program.\r
+/** The setprogname() function sets the name of the program.\r
 \r
-  @param[in]        The name of the program.  This memory must be retained \r
-                    by the caller until no calls to "getprogname" will be \r
-                    called.\r
+  @param[in]  progname    The name of the program.  This memory must be retained\r
+                          by the caller until no calls to "getprogname" will be\r
+                          called.\r
 **/\r
 void setprogname(const char *progname);\r
 \r
index 517b9e6e98a6474e9fe12d1581973db585cd6738..0c809441e830fa6c7dcdff245cfdffcd440cb1f2 100644 (file)
@@ -1,29 +1,87 @@
 /** @file\r
-  The header <string.h> declares one type and several functions, and defines\r
-  one macro useful for manipulating arrays of character type and other objects\r
-  treated as arrays of character type.  Various methods are used for\r
-  determining the lengths of the arrays, but in all cases a char * or void *\r
-  argument points to the initial (lowest addressed) character of the array. If\r
-  an array is accessed beyond the end of an object, the behavior is undefined.\r
-\r
-  Where an argument declared as size_t n specifies the length of the array for\r
-  a function, n can have the value zero on a call to that function. Unless\r
-  explicitly stated otherwise in the description of those functions, pointer\r
-  arguments on such a call shall still have valid values.\r
-\r
-  For all functions declared in this header, each character shall be\r
-  interpreted as if it had the type unsigned char (and therefore every possible\r
-  object representation is valid and has a different value).\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
-\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
+    The header <string.h> declares one type and several functions, and defines\r
+    one macro useful for manipulating arrays of character type and other objects\r
+    treated as arrays of character type.  Various methods are used for\r
+    determining the lengths of the arrays, but in all cases a char * or void *\r
+    argument points to the initial (lowest addressed) character of the array. If\r
+    an array is accessed beyond the end of an object, the behavior is undefined.\r
+\r
+    Where an argument declared as size_t n specifies the length of the array for\r
+    a function, n can have the value zero on a call to that function. Unless\r
+    explicitly stated otherwise in the description of those functions, pointer\r
+    arguments on such a call must still have valid values.\r
+\r
+    For all functions declared in this header, each character shall be\r
+    interpreted as if it had the type unsigned char (and therefore every possible\r
+    object representation is valid and has a different value).\r
+\r
+    The following macros are defined in this file:<BR>\r
+    @verbatim\r
+      NULL\r
+      bcopy(a,b,c)    ( memcpy((void *)b, (const void *)a, (size_t)c))\r
+      bcmp(a,b,c)     ( memcmp((void *)a, (void *)b, (size_t)c))\r
+    @endverbatim\r
+\r
+    The following types are defined in this file:<BR>\r
+    @verbatim\r
+      size_t      Unsigned integer type of the result of the sizeof operator.\r
+    @endverbatim\r
+\r
+    The following functions are declared in this file:<BR>\r
+    @verbatim\r
+      ################ Copying Functions\r
+      void     *memcpy      (void * __restrict s1, const void * __restrict s2, size_t n);\r
+      void     *memmove     (void *s1, const void *s2, size_t n);\r
+      char     *strcpy      (char * __restrict s1, const char * __restrict s2);\r
+      char     *strncpy     (char * __restrict s1, const char * __restrict s2, size_t n);\r
+      int       strncpyX    (char * __restrict s1, const char * __restrict s2, size_t n);\r
+\r
+      ################ Concatenation Functions\r
+      char     *strcat      (char * __restrict s1, const char * __restrict s2);\r
+      char     *strncat     (char * __restrict s1, const char * __restrict s2, size_t n);\r
+      int       strncatX    (char * __restrict s1, const char * __restrict s2, size_t n);\r
+\r
+      ################ Comparison Functions\r
+      int       memcmp      (const void *s1, const void *s2, size_t n);\r
+      int       strcmp      (const char *s1, const char *s2);\r
+      int       strcoll     (const char *s1, const char *s2);\r
+      int       strncmp     (const char *s1, const char *s2, size_t n);\r
+      size_t    strxfrm     (char * __restrict s1, const char * __restrict s2, size_t n);\r
+\r
+      ################ Search Functions\r
+      void     *memchr      (const void *s, int c, size_t n);\r
+      char     *strchr      (const char *s, int c);\r
+      size_t    strcspn     (const char *s1, const char *s2);\r
+      char     *strpbrk     (const char *s1, const char *s2);\r
+      char     *strrchr     (const char *s, int c);\r
+      size_t    strspn      (const char *s1 , const char *s2);\r
+      char     *strstr      (const char *s1 , const char *s2);\r
+      char     *strtok      (char * __restrict s1, const char * __restrict s2);\r
+\r
+      ################ Miscellaneous Functions\r
+      void     *memset      (void *s, int c, size_t n);\r
+      char     *strerror    (int num);\r
+      size_t    strlen      (const char *);\r
+\r
+      ################ BSD Compatibility Functions\r
+      char     *strdup      (const char *);\r
+      int       strerror_r  (int, char *, size_t);\r
+      int       strcasecmp  (const char *s1, const char *s2);\r
+      void     *memccpy     (void *, const void *, int, size_t);\r
+      int       strncasecmp (const char *s1, const char *s2, size_t n);\r
+      size_t    strlcpy     (char *destination, const char *source, size_t size);\r
+      size_t    strlcat     (char *destination, const char *source, size_t size);\r
+      char     *strsep      (register char **stringp, register const char *delim);\r
+    @endverbatim\r
+\r
+    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+    This program and the accompanying materials are licensed and made available under\r
+    the terms and conditions of the BSD License that accompanies this distribution.\r
+    The full text of the license may be found at\r
+    http://opensource.org/licenses/bsd-license.\r
+\r
+    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 **/\r
 #ifndef _STRING_H\r
 #define _STRING_H\r
@@ -39,239 +97,311 @@ __BEGIN_DECLS
 \r
 /* ################   Copying Functions   ################################# */\r
 \r
-/** The memcpy function copies n characters from the object pointed to by s2\r
-    into the object pointed to by s1. If copying takes place between objects\r
+/** The memcpy function copies N characters from the object pointed to by Src\r
+    into the object pointed to by Dest. If copying takes place between objects\r
     that overlap, the behavior is undefined.\r
 \r
-    @return   The memcpy function returns the value of s1.\r
+    @param[out]   Dest  Pointer to the destination of the copy operation.\r
+    @param[in]    Src   Pointer to the Source data to be copied.\r
+    @param[in]    N     Number of characters (bytes) to be copied.\r
+\r
+    @return   The memcpy function returns the value of Dest.\r
 **/\r
-void     *memcpy(void * __restrict s1, const void * __restrict s2, size_t n);\r
+void     *memcpy(void * __restrict Dest, const void * __restrict Src, size_t N);\r
 \r
-/** The memmove function copies n characters from the object pointed to by s2\r
-    into the object pointed to by s1. Copying takes place as if the n\r
-    characters from the object pointed to by s2 are first copied into a\r
-    temporary array of n characters that does not overlap the objects pointed\r
-    to by s1 and s2, and then the n characters from the temporary array are\r
-    copied into the object pointed to by s1.\r
+/** The memmove function copies N characters from the object pointed to by Src\r
+    into the object pointed to by Dest. Copying takes place as if the N\r
+    characters from the object pointed to by Src are first copied into a\r
+    temporary array of N characters that does not overlap the objects pointed\r
+    to by Dest and Src, and then the N characters from the temporary array are\r
+    copied into the object pointed to by Dest.\r
 \r
-    @return   The memmove function returns the value of s1.\r
+    @param[out]   Dest  Pointer to the destination of the copy operation.\r
+    @param[in]    Src   Pointer to the Source data to be copied.\r
+    @param[in]    N     Number of characters (bytes) to be copied.\r
+\r
+    @return   The memmove function returns the value of Dest.\r
 **/\r
-void     *memmove(void *s1, const void *s2, size_t n);\r
+void     *memmove(void *Dest, const void *Src, size_t N);\r
 \r
-/** The strcpy function copies the string pointed to by s2 (including the\r
-    terminating null character) into the array pointed to by s1. If copying\r
+/** The strcpy function copies the string pointed to by Src (including the\r
+    terminating null character) into the array pointed to by Dest. If copying\r
     takes place between objects that overlap, the behavior is undefined.\r
 \r
-    @return   The strcpy function returns the value of s1.\r
+    @param[out]   Dest  Pointer to the destination of the copy operation.\r
+    @param[in]    Src   Pointer to the Source data to be copied.\r
+\r
+    @return   The strcpy function returns the value of Dest.\r
 **/\r
-char     *strcpy(char * __restrict s1, const char * __restrict s2);\r
+char     *strcpy(char * __restrict Dest, const char * __restrict Src);\r
 \r
-/** The strncpy function copies not more than n characters (characters that\r
-    follow a null character are not copied) from the array pointed to by s2 to\r
-    the array pointed to by s1. If copying takes place between objects that\r
+/** The strncpy function copies not more than N characters (characters that\r
+    follow a null character are not copied) from the array pointed to by Src to\r
+    the array pointed to by Dest. If copying takes place between objects that\r
     overlap, the behavior is undefined.\r
 \r
-    If the array pointed to by s2 is a string that is shorter than n\r
+    If the array pointed to by Src is a string that is shorter than N\r
     characters, null characters are appended to the copy in the array pointed\r
-    to by s1, until n characters in all have been written.\r
+    to by Dest, until N characters in all have been written.\r
 \r
-    @return   The strncpy function returns the value of s1.\r
+    @param[out]   Dest  Pointer to the destination of the copy operation.\r
+    @param[in]    Src   Pointer to the Source data to be copied.\r
+    @param[in]    N     Number of characters (bytes) to be copied.\r
+\r
+    @return   The strncpy function returns the value of Dest.\r
 **/\r
-char     *strncpy(char * __restrict s1, const char * __restrict s2, size_t n);\r
+char     *strncpy(char * __restrict Dest, const char * __restrict Src, size_t N);\r
 \r
-/** The strncpyX function copies not more than n-1 characters (characters that\r
-    follow a null character are not copied) from the array pointed to by s2 to\r
-    the array pointed to by s1. Array s1 is guaranteed to be NULL terminated.\r
+/** The strncpyX function copies not more than N-1 characters (characters that\r
+    follow a null character are not copied) from the array pointed to by Src to\r
+    the array pointed to by Dest. Array Dest is guaranteed to be NULL terminated.\r
     If copying takes place between objects that overlap,\r
     the behavior is undefined.\r
 \r
     strncpyX exists because normal strncpy does not indicate if the copy was\r
-    terminated because of exhausting the buffer or reaching the end of s2.\r
+    terminated because of exhausting the buffer or reaching the end of Src.\r
+\r
+    @param[out]   Dest  Pointer to the destination of the copy operation.\r
+    @param[in]    Src   Pointer to the Source data to be copied.\r
+    @param[in]    N     Number of characters (bytes) to be copied.\r
 \r
     @return   The strncpyX function returns 0 if the copy operation was\r
-              terminated because it reached the end of s1.  Otherwise,\r
+              terminated because it reached the end of Dest.  Otherwise,\r
               a non-zero value is returned indicating how many characters\r
-              remain in s1.\r
+              remain in Dest.\r
 **/\r
-int       strncpyX(char * __restrict s1, const char * __restrict s2, size_t n);\r
+int       strncpyX(char * __restrict Dest, const char * __restrict Src, size_t N);\r
 \r
 /* ################   Concatenation Functions   ########################### */\r
 \r
-/** The strcat function appends a copy of the string pointed to by s2\r
+/** The strcat function appends a copy of the string pointed to by Src\r
     (including the terminating null character) to the end of the string pointed\r
-    to by s1. The initial character of s2 overwrites the null character at the\r
-    end of s1. If copying takes place between objects that overlap, the\r
+    to by Dest. The initial character of Src overwrites the null character at the\r
+    end of Dest. If copying takes place between objects that overlap, the\r
     behavior is undefined.\r
 \r
-    @return   The strcat function returns the value of s1.\r
+    @param[out]   Dest  Pointer to the destination of the concatenation operation.\r
+    @param[in]    Src   Pointer to the Source data to be concatenated.\r
+\r
+    @return   The strcat function returns the value of Dest.\r
 **/\r
-char     *strcat(char * __restrict s1, const char * __restrict s2);\r
+char     *strcat(char * __restrict Dest, const char * __restrict Src);\r
 \r
-/** The strncat function appends not more than n characters (a null character\r
+/** The strncat function appends not more than N characters (a null character\r
     and characters that follow it are not appended) from the array pointed to\r
-    by s2 to the end of the string pointed to by s1. The initial character of\r
-    s2 overwrites the null character at the end of s1. A terminating null\r
+    by Src to the end of the string pointed to by Dest. The initial character of\r
+    Src overwrites the null character at the end of Dest. A terminating null\r
     character is always appended to the result. If copying takes place\r
     between objects that overlap, the behavior is undefined.\r
 \r
-    @return   The strncat function returns the value of s1.\r
+    @param[out]   Dest  Pointer to the destination of the concatenation operation.\r
+    @param[in]    Src   Pointer to the Source data to be concatenated.\r
+    @param[in]    N     Max Number of characters (bytes) to be concatenated.\r
+\r
+    @return   The strncat function returns the value of Dest.\r
 **/\r
-char     *strncat(char * __restrict s1, const char * __restrict s2, size_t n);\r
+char     *strncat(char * __restrict Dest, const char * __restrict Src, size_t N);\r
 \r
-/** The strncatX function appends not more than n characters (a null character\r
+/** The strncatX function appends not more than N characters (a null character\r
     and characters that follow it are not appended) from the array pointed to\r
-    by s2 to the end of the string pointed to by s1. The initial character of\r
-    s2 overwrites the null character at the end of s1. The result is always\r
+    by Src to the end of the string pointed to by Dest. The initial character of\r
+    Src overwrites the null character at the end of Dest. The result is always\r
     terminated with a null character. If copying takes place between objects\r
     that overlap, the behavior is undefined.\r
 \r
     strncatX exists because normal strncat does not indicate if the operation\r
-    was terminated because of exhausting n or reaching the end of s2.\r
+    was terminated because of exhausting N or reaching the end of Src.\r
+\r
+    @param[out]   Dest  Pointer to the destination of the concatenation operation.\r
+    @param[in]    Src   Pointer to the Source data to be concatenated.\r
+    @param[in]    N     Max Number of characters (bytes) to be concatenated.\r
 \r
     @return   The strncatX function returns 0 if the operation was terminated\r
-              because it reached the end of s1.  Otherwise, a non-zero value is\r
-              returned indicating how many characters remain in s1.\r
+              because it reached the end of Dest.  Otherwise, a non-zero value is\r
+              returned indicating how many characters remain in Dest.\r
 **/\r
 int       strncatX(char * __restrict s1, const char * __restrict s2, size_t n);\r
 \r
 /* ################   Comparison Functions   ############################## */\r
 \r
-/** The memcmp function compares the first n characters of the object pointed\r
-    to by s1 to the first n characters of the object pointed to by s2.\r
+/** The memcmp function compares the first N characters of the object pointed\r
+    to by S1 to the first N characters of the object pointed to by S2.\r
+\r
+    @param[out]   S1  Pointer to the first object to be compared.\r
+    @param[in]    S2  Pointer to the object to be compared to S1.\r
+    @param[in]    N   Max Number of characters (bytes) to be compared.\r
 \r
     @return   The memcmp function returns an integer greater than, equal to, or\r
-              less than zero, accordingly as the object pointed to by s1 is\r
-              greater than, equal to, or less than the object pointed to by s2.\r
+              less than zero, accordingly as the object pointed to by S1 is\r
+              greater than, equal to, or less than the object pointed to by S2.\r
 **/\r
-int       memcmp(const void *s1, const void *s2, size_t n);\r
+int       memcmp(const void *S1, const void *S2, size_t N);\r
 \r
-/** The strcmp function compares the string pointed to by s1 to the string\r
-    pointed to by s2.\r
+/** The strcmp function compares the string pointed to by S1 to the string\r
+    pointed to by S2.\r
+\r
+    @param[out]   S1  Pointer to the first string to be compared.\r
+    @param[in]    S2  Pointer to the string to be compared to S1.\r
 \r
     @return   The strcmp function returns an integer greater than, equal to, or\r
-              less than zero, accordingly as the string pointed to by s1 is\r
-              greater than, equal to, or less than the string pointed to by s2.\r
+              less than zero, accordingly as the string pointed to by S1 is\r
+              greater than, equal to, or less than the string pointed to by S2.\r
 **/\r
-int       strcmp(const char *s1, const char *s2);\r
+int       strcmp(const char *S1, const char *S2);\r
 \r
-/** The strcoll function compares the string pointed to by s1 to the string\r
-    pointed to by s2, both interpreted as appropriate to the LC_COLLATE\r
+/** The strcoll function compares the string pointed to by S1 to the string\r
+    pointed to by S2, both interpreted as appropriate to the LC_COLLATE\r
     category of the current locale.\r
 \r
+    @param[out]   S1  Pointer to the first string to be compared.\r
+    @param[in]    S2  Pointer to the string to be compared to S1.\r
+\r
     @return   The strcoll function returns an integer greater than, equal to,\r
-              or less than zero, accordingly as the string pointed to by s1 is\r
-              greater than, equal to, or less than the string pointed to by s2\r
+              or less than zero, accordingly as the string pointed to by S1 is\r
+              greater than, equal to, or less than the string pointed to by S2\r
               when both are interpreted as appropriate to the current locale.\r
 **/\r
-int       strcoll(const char *s1, const char *s2);\r
+int       strcoll(const char *S1, const char *S2);\r
+\r
+/** The strncmp function compares not more than N characters (characters that\r
+    follow a null character are not compared) from the array pointed to by S1\r
+    to the array pointed to by S2.\r
 \r
-/** The strncmp function compares not more than n characters (characters that\r
-    follow a null character are not compared) from the array pointed to by s1\r
-    to the array pointed to by s2.\r
+    @param[out]   S1  Pointer to the first object to be compared.\r
+    @param[in]    S2  Pointer to the object to be compared to S1.\r
+    @param[in]    N   Max Number of characters (bytes) to be compared.\r
 \r
     @return   The strncmp function returns an integer greater than, equal to,\r
               or less than zero, accordingly as the possibly null-terminated\r
-              array pointed to by s1 is greater than, equal to, or less than\r
-              the possibly null-terminated array pointed to by s2.\r
+              array pointed to by S1 is greater than, equal to, or less than\r
+              the possibly null-terminated array pointed to by S2.\r
 **/\r
-int       strncmp(const char *s1, const char *s2, size_t n);\r
+int       strncmp(const char *S1, const char *S2, size_t N);\r
 \r
-/** The strxfrm function transforms the string pointed to by s2 and places the\r
-    resulting string into the array pointed to by s1. The transformation is\r
+/** The strxfrm function transforms the string pointed to by Src and places the\r
+    resulting string into the array pointed to by Dest. The transformation is\r
     such that if the strcmp function is applied to two transformed strings, it\r
     returns a value greater than, equal to, or less than zero, corresponding to\r
     the result of the strcoll function applied to the same two original\r
-    strings. No more than n characters are placed into the resulting array\r
-    pointed to by s1, including the terminating null character. If n is zero,\r
-    s1 is permitted to be a null pointer. If copying takes place between\r
+    strings. No more than N characters are placed into the resulting array\r
+    pointed to by Dest, including the terminating null character. If N is zero,\r
+    Dest is permitted to be a null pointer. If copying takes place between\r
     objects that overlap, the behavior is undefined.\r
 \r
+    @param[out]   Dest  Pointer to the object to receive the transformed string.\r
+    @param[in]    Src   Pointer to the string to be transformed.\r
+    @param[in]    N     Max Number of characters (bytes) to be transformed.\r
+\r
     @return   The strxfrm function returns the length of the transformed string\r
               (not including the terminating null character). If the value\r
-              returned is n or more, the contents of the array pointed to by s1\r
+              returned is N or more, the contents of the array pointed to by Dest\r
               are indeterminate.\r
 **/\r
-size_t    strxfrm(char * __restrict s1, const char * __restrict s2, size_t n);\r
+size_t    strxfrm(char * __restrict Dest, const char * __restrict Src, size_t N);\r
 \r
 /* ################   Search Functions   ################################## */\r
 \r
-/** The memchr function locates the first occurrence of c (converted to an\r
-    unsigned char) in the initial n characters (each interpreted as\r
-    unsigned char) of the object pointed to by s.\r
+/** The memchr function locates the first occurrence of C (converted to an\r
+    unsigned char) in the initial N characters (each interpreted as\r
+    unsigned char) of the object pointed to by S.\r
+\r
+    @param[in]    S   Pointer to the object to be searched.\r
+    @param[in]    C   The character value to search for.\r
+    @param[in]    N   Max Number of characters (bytes) to be searched.\r
 \r
     @return   The memchr function returns a pointer to the located character,\r
               or a null pointer if the character does not occur in the object.\r
 **/\r
-void     *memchr(const void *s, int c, size_t n);\r
+void     *memchr(const void *S, int C, size_t N);\r
 \r
-/** The strchr function locates the first occurrence of c (converted to a char)\r
-    in the string pointed to by s. The terminating null character is considered\r
+/** The strchr function locates the first occurrence of C (converted to a char)\r
+    in the string pointed to by S. The terminating null character is considered\r
     to be part of the string.\r
 \r
+    @param[in]    S   Pointer to the object to be searched.\r
+    @param[in]    C   The character value to search for.\r
+\r
     @return   The strchr function returns a pointer to the located character,\r
               or a null pointer if the character does not occur in the string.\r
 **/\r
-char     *strchr(const char *s, int c);\r
+char     *strchr(const char *S, int C);\r
 \r
 /** The strcspn function computes the length of the maximum initial segment of\r
-    the string pointed to by s1 which consists entirely of characters NOT from\r
-    the string pointed to by s2.\r
+    the string pointed to by S1 which consists entirely of characters NOT from\r
+    the string pointed to by S2.\r
+\r
+    @param[in]    S1  Pointer to the object to be searched.\r
+    @param[in]    S2  Pointer to the list of characters to search for.\r
 \r
     @return   The strcspn function returns the length of the segment.\r
 **/\r
-size_t    strcspn(const char *s1, const char *s2);\r
+size_t    strcspn(const char *S1, const char *S2);\r
 \r
 /** The strpbrk function locates the first occurrence in the string pointed to\r
-    by s1 of any character from the string pointed to by s2.\r
+    by S1 of any character from the string pointed to by S2.\r
+\r
+    @param[in]    S1  Pointer to the object to be searched.\r
+    @param[in]    S2  Pointer to the list of characters to search for.\r
 \r
     @return   The strpbrk function returns a pointer to the character, or a\r
-              null pointer if no character from s2 occurs in s1.\r
+              null pointer if no character from S2 occurs in S1.\r
 **/\r
-char     *strpbrk(const char *s1, const char *s2);\r
+char     *strpbrk(const char *S1, const char *S2);\r
 \r
-/** The strrchr function locates the last occurrence of c (converted to a char)\r
-    in the string pointed to by s. The terminating null character is considered\r
+/** The strrchr function locates the last occurrence of C (converted to a char)\r
+    in the string pointed to by S. The terminating null character is considered\r
     to be part of the string.\r
 \r
+    @param[in]    S   Pointer to the object to be searched.\r
+    @param[in]    C   The character value to search for.\r
+\r
     @return   The strrchr function returns a pointer to the character, or a\r
-              null pointer if c does not occur in the string.\r
+              null pointer if C does not occur in the string.\r
 **/\r
-char     *strrchr(const char *s, int c);\r
+char     *strrchr(const char *S, int C);\r
 \r
 /** The strspn function computes the length of the maximum initial segment of\r
-    the string pointed to by s1 which consists entirely of characters from the\r
-    string pointed to by s2.\r
+    the string pointed to by S1 which consists entirely of characters from the\r
+    string pointed to by S2.\r
+\r
+    @param[in]    S1  Pointer to the object to be searched.\r
+    @param[in]    S2  Pointer to the list of characters to search for.\r
 \r
     @return   The strspn function returns the length of the segment.\r
 **/\r
-size_t    strspn(const char *s1 , const char *s2);\r
+size_t    strspn(const char *S1 , const char *S2);\r
 \r
 /** The strstr function locates the first occurrence in the string pointed to\r
-    by s1 of the sequence of characters (excluding the terminating null\r
-    character) in the string pointed to by s2.\r
+    by S1 of the sequence of characters (excluding the terminating null\r
+    character) in the string pointed to by S2.\r
+\r
+    @param[in]    S1  Pointer to the object to be searched.\r
+    @param[in]    S2  Pointer to the sequence of characters to search for.\r
 \r
     @return   The strstr function returns a pointer to the located string, or a\r
-              null pointer if the string is not found. If s2 points to a string\r
-              with zero length, the function returns s1.\r
+              null pointer if the string is not found. If S2 points to a string\r
+              with zero length, the function returns S1.\r
 **/\r
-char     *strstr(const char *s1 , const char *s2);\r
+char     *strstr(const char *S1 , const char *S2);\r
+\r
+/** Break a string into a sequence of tokens.\r
 \r
-/** A sequence of calls to the strtok function breaks the string pointed to by\r
-    s1 into a sequence of tokens, each of which is delimited by a character\r
-    from the string pointed to by s2. The first call in the sequence has a\r
+    A sequence of calls to the strtok function breaks the string pointed to by\r
+    S1 into a sequence of tokens, each of which is delimited by a character\r
+    from the string pointed to by S2. The first call in the sequence has a\r
     non-null first argument; subsequent calls in the sequence have a null first\r
-    argument. The separator string pointed to by s2 may be different from call\r
+    argument. The separator string pointed to by S2 may be different from call\r
     to call.\r
 \r
-    The first call in the sequence searches the string pointed to by s1 for the\r
+    The first call in the sequence searches the string pointed to by S1 for the\r
     first character that is not contained in the current separator string\r
-    pointed to by s2. If no such character is found, then there are no tokens\r
-    in the string pointed to by s1 and the strtok function returns a null\r
+    pointed to by S2. If no such character is found, then there are no tokens\r
+    in the string pointed to by S1 and the strtok function returns a null\r
     pointer. If such a character is found, it is the start of the first token.\r
 \r
     The strtok function then searches from there for a character that is\r
     contained in the current separator string. If no such character is found,\r
-    the current token extends to the end of the string pointed to by s1, and\r
+    the current token extends to the end of the string pointed to by S1, and\r
     subsequent searches for a token will return a null pointer. If such a\r
     character is found, it is overwritten by a null character, which terminates\r
     the current token. The strtok function saves a pointer to the following\r
@@ -281,40 +411,48 @@ char     *strstr(const char *s1 , const char *s2);
     argument, starts searching from the saved pointer and behaves as\r
     described above.\r
 \r
+    @param[in]    S1  Pointer to the string to be tokenized.\r
+    @param[in]    S2  Pointer to a list of separator characters.\r
+\r
     @return   The strtok function returns a pointer to the first character of a\r
               token, or a null pointer if there is no token.\r
 **/\r
-char     *strtok(char * __restrict s1, const char * __restrict s2);\r
+char     *strtok(char * __restrict S1, const char * __restrict S2);\r
 \r
 /* ################   Miscellaneous Functions   ########################### */\r
 \r
-/** The memset function copies the value of c (converted to an unsigned char)\r
-    into each of the first n characters of the object pointed to by s.\r
+/** The memset function copies the value of C (converted to an unsigned char)\r
+    into each of the first N characters of the object pointed to by S.\r
+\r
+    @param[out]   S   Pointer to the first element of the object to be set.\r
+    @param[in]    C   Value to store in each element of S.\r
+    @param[in]    N   Number of elements in S to be set.\r
 \r
-    @return   The memset function returns the value of s.\r
+    @return   The memset function returns the value of S.\r
 **/\r
-void     *memset(void *s, int c, size_t n);\r
+void     *memset(void *S, int C, size_t N);\r
 \r
-/** The strerror function maps the number in errnum to a message string.\r
-    Typically, the values for errnum come from errno, but strerror shall map\r
+/** The strerror function maps the number in Num to a message string.\r
+    Typically, the values for Num come from errno, but strerror shall map\r
     any value of type int to a message.\r
 \r
-    The implementation shall behave as if no library function calls the\r
-    strerror function.\r
+    @param[in]  Num   A value to be converted to a message.\r
 \r
     @return   The strerror function returns a pointer to the string, the\r
               contents of which are locale specific.  The array pointed to\r
-              shall not be modified by the program, but may be overwritten by\r
+              must not be modified by the program, but may be overwritten by\r
               a subsequent call to the strerror function.\r
 **/\r
-char     *strerror(int num);\r
+char     *strerror(int Num);\r
+\r
+/** The strlen function computes the length of the string pointed to by S.\r
 \r
-/** The strlen function computes the length of the string pointed to by s.\r
+    @param[in]  S   Pointer to the string to determine the length of.\r
 \r
     @return   The strlen function returns the number of characters that\r
               precede the terminating null character.\r
 **/\r
-size_t    strlen(const char *);\r
+size_t    strlen(const char *S);\r
 \r
 \r
 /* ################   BSD Compatibility Functions   ####################### */\r
index a49eeda1fced66e7f04c5e9cefe785fd0b594d05..bfbd14e1c5ddfb3fa9f9d903464ff9f2c1ac464c 100644 (file)
@@ -1,17 +1,74 @@
 /** @file\r
   Function declarations for UEFI "system calls".\r
 \r
-  Concept derived from NetBSD's unistd.h file.\r
+    The following macros are defined in this file:<BR>\r
+@verbatim\r
+      STDIN_FILENO      0     standard input file descriptor\r
+      STDOUT_FILENO     1     standard output file descriptor\r
+      STDERR_FILENO     2     standard error file descriptor\r
+      F_OK              0     test for existence of file\r
+      X_OK           0x01     test for execute or search permission\r
+      W_OK           0x02     test for write permission\r
+      R_OK           0x04     test for read permission\r
+      SEEK_SET          0     set file offset to offset\r
+      SEEK_CUR          1     set file offset to current plus offset\r
+      SEEK_END          2     set file offset to EOF plus offset\r
+      VALID_OPEN        1\r
+      VALID_CLOSED      0\r
+      VALID_DONT_CARE  -1\r
+@endverbatim\r
+\r
+    The following types are defined in this file:<BR>\r
+@verbatim\r
+      struct stat;    Structure declared in <sys/stat.h>\r
+@endverbatim\r
+\r
+    The following functions are declared in this file:<BR>\r
+@verbatim\r
+      ###############  System Calls used in stdio.\r
+      int       close     (int fd);\r
+      ssize_t   read      (int fd, void *buf, size_t n);\r
+      ssize_t   write     (int fd, const void *buf, size_t n);\r
+      int       unlink    (const char *name);\r
+      int       dup2      (int, int);\r
+      int       rmdir     (const char *);\r
+      int       isatty    (int);\r
+\r
+      ###############  System Calls which are also declared in sys/fcntl.h.\r
+      int       open      (const char *name, int oflags, int mode);\r
+      int       creat     (const char *, mode_t);\r
+      int       fcntl     (int, int, ...);\r
+\r
+      ###############  System Calls which are also declared in stat.h.\r
+      int       mkdir     (const char *, mode_t);\r
+      int       fstat     (int, struct stat *);\r
+      int       lstat     (const char *, struct stat *);\r
+      int       stat      (const char *, void *);\r
+      int       chmod     (const char *, mode_t);\r
+\r
+      ###############  System Calls which are also declared in sys/types.h.\r
+      off_t     lseek     (int, off_t, int);\r
+      int       truncate  (const char *, off_t);\r
+      int       ftruncate (int, off_t);   //  IEEE Std 1003.1b-93\r
+\r
+      ###############  EFI-specific Functions.\r
+      int       DeleteOnClose (int fd);    Mark an open file to be deleted when closed.\r
+      int       FindFreeFD    (int MinFd);\r
+      BOOLEAN   ValidateFD    (int fd, int IsOpen);\r
+\r
+      ###############  Functions added for compatibility.\r
+      char     *getcwd    (char *, size_t);\r
+      int       chdir     (const char *);\r
+@endverbatim\r
 \r
   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available under\r
   the terms and conditions of the BSD License that accompanies this distribution.\r
   The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.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 _EFI_SYS_CALL_H\r
 #define _EFI_SYS_CALL_H\r
 \r
 struct stat;  /* Structure declared in <sys/stat.h> */\r
 \r
-#define STDIN_FILENO  0 /* standard input file descriptor */\r
-#define STDOUT_FILENO 1 /* standard output file descriptor */\r
-#define STDERR_FILENO 2 /* standard error file descriptor */\r
+#define STDIN_FILENO  0 /**< standard input file descriptor */\r
+#define STDOUT_FILENO 1 /**< standard output file descriptor */\r
+#define STDERR_FILENO 2 /**< standard error file descriptor */\r
 \r
 /* access function */\r
-#define F_OK       0  /* test for existence of file */\r
-#define X_OK    0x01  /* test for execute or search permission */\r
-#define W_OK    0x02  /* test for write permission */\r
-#define R_OK    0x04  /* test for read permission */\r
+#define F_OK       0  /**< test for existence of file */\r
+#define X_OK    0x01  /**< test for execute or search permission */\r
+#define W_OK    0x02  /**< test for write permission */\r
+#define R_OK    0x04  /**< test for read permission */\r
 \r
 /* whence values for lseek(2)\r
    Always ensure that these are consistent with <stdio.h> and <unistd.h>!\r
 */\r
 #ifndef SEEK_SET\r
-  #define SEEK_SET  0 /* set file offset to offset */\r
+  #define SEEK_SET  0 /**< set file offset to offset */\r
 #endif\r
 #ifndef SEEK_CUR\r
-  #define SEEK_CUR  1 /* set file offset to current plus offset */\r
+  #define SEEK_CUR  1 /**< set file offset to current plus offset */\r
 #endif\r
 #ifndef SEEK_END\r
-  #define SEEK_END  2 /* set file offset to EOF plus offset */\r
+  #define SEEK_END  2 /**< set file offset to EOF plus offset */\r
 #endif\r
 \r
 // Parameters for the ValidateFD function.\r
@@ -50,44 +107,234 @@ struct stat;  /* Structure declared in <sys/stat.h> */
 #define VALID_DONT_CARE   -1\r
 \r
 __BEGIN_DECLS\r
-\r
 /* EFI versions of BSD system calls used in stdio */\r
-int       close     (int fd);\r
-ssize_t   read      (int fd, void *buf, size_t n);\r
-ssize_t   write     (int fd, const void *buf, size_t n);\r
-int       unlink    (const char *name);\r
-int       dup2      (int, int);\r
-int       rmdir     (const char *);\r
-int       isatty    (int);\r
+\r
+  /** Close a file or device.\r
+\r
+    @param[in]  fd    File Descriptor for the file or device to close.\r
+\r
+    @retval   0   Successful completion.\r
+    @retval  -1   An error occurred, identified by errno.\r
+                    - EBADF fd is not a valid File Descriptor.\r
+                    - EINTR The function was interrupted by a signal.\r
+                    - EIO An I/O error occurred.\r
+  **/\r
+  int       close     (int fd);\r
+\r
+  /** Read from a file or device.\r
+\r
+    @param[in]  fd    File Descriptor for the file or device to read.\r
+    @param[in]  buf   Buffer to read data into.\r
+    @param[in]  N     Maximum number of bytes to read.\r
+\r
+    @return   On successful completion, read returns a non-negative integer\r
+              indicating the number of bytes actually read.  Otherwise, it\r
+              returns -1 and sets errno as follows:\r
+                - EAGAIN\r
+                - EWOULDBLOCK\r
+                - EBADF\r
+                - EBADMSG\r
+                - EINTR\r
+                - EINVAL\r
+                - EIO\r
+                - EISDIR\r
+                - EOVERFLOW\r
+                - ECONNRESET\r
+                - ENOTCONN\r
+                - ETIMEDOUT\r
+                - ENOBUFS\r
+                - ENOMEM\r
+                - ENXIO\r
+  **/\r
+  ssize_t   read      (int fd, void *buf, size_t n);\r
+\r
+  /** Write to a file or device.\r
+\r
+    @param[in]  fd    File Descriptor for the file or device to write.\r
+    @param[in]  buf   Buffer to write data from.\r
+    @param[in]  N     Maximum number of bytes to write.\r
+\r
+    @return   On successful completion, write returns a non-negative integer\r
+              indicating the number of bytes actually written.  Otherwise, it\r
+              returns -1 and sets errno as follows:\r
+                - EAGAIN\r
+                - EWOULDBLOCK\r
+                - EBADF\r
+                - EFBIG\r
+                - EINTR\r
+                - EINVAL\r
+                - EIO\r
+                - ENOSPC\r
+                - EPIPE\r
+                - ERANGE\r
+                - ECONNRESET\r
+                - ENOBUFS\r
+                - ENXIO\r
+                - ENETDOWN\r
+                - ENETUNREACH\r
+  **/\r
+  ssize_t   write     (int fd, const void *buf, size_t n);\r
+\r
+  /** Unlink (delete) a file.\r
+\r
+    @param[in]  name    The name of the file to be deleted.\r
+\r
+    @retval   0   Successful completion.\r
+    @retval  -1   Unable to perform operation, errno contains further\r
+                  information.  The file name is unchanged.\r
+  **/\r
+  int       unlink    (const char *name);\r
+\r
+  /** Make file descriptor Fd2 a duplicate of file descriptor Fd1.\r
+\r
+    @param[in]  Fd1   File descriptor to be duplicated\r
+    @param[in]  Fd2   File descriptor to become a duplicate of Fd1.\r
+\r
+    @retval   0   Successful completion.\r
+    @retval  -1   Unable to perform operation, errno contains further\r
+                  information.\r
+  **/\r
+  int       dup2      (int Fd1, int Fd2);\r
+\r
+  /** Remove a directory.\r
+\r
+    @param[in]  Path    Path to the directory to be deleted.\r
+\r
+    @retval   0   Successful completion.\r
+    @retval  -1   Unable to perform operation, errno contains further\r
+                  information.  The named directory remains unchanged.\r
+  **/\r
+  int       rmdir     (const char *Path);\r
+\r
+  /** Determine if fd refers to an interactive terminal device.\r
+\r
+    @param[in]  fd    The file descriptor to be tested.\r
+\r
+    @retval   0   The file descriptor, fd, is not for a terminal.  errno is set\r
+                  indicating the cause for failure.\r
+                    - EBADF   fd is not a valid open file descriptor.\r
+                    - ENOTTY  fd does not refer to a terminal.\r
+    @retval   1   The file descriptor, fd, is for a terminal.\r
+  **/\r
+  int       isatty    (int fd);\r
 \r
 /* These system calls are also declared in sys/fcntl.h */\r
 #ifndef __FCNTL_SYSCALLS_DECLARED\r
   #define __FCNTL_SYSCALLS_DECLARED\r
+\r
+  /** Open or create a file named by name.\r
+\r
+      The file name may be one of:\r
+        - An absolute path beginning with '/'.\r
+        - A relative path beginning with "." or ".." or a directory name\r
+        - A file name\r
+        - A mapped path which begins with a name followed by a colon, ':'.\r
+\r
+      Mapped paths are use to refer to specific mass storage volumes or devices.\r
+      In a Shell-hosted environment, the map command will list valid map names\r
+      for both file system and block devices.  Mapped paths can also refer to\r
+      devices such as the UEFI console.  Supported UEFI console mapped paths are:\r
+        - stdin:        Standard Input        (from the System Table)\r
+        - stdout:       Standard Output       (from the System Table)\r
+        - stderr:       Standard Error Output (from the System Table)\r
+\r
+    @param[in]  name\r
+    @param[in]  oflags\r
+    @param[in]  mode\r
+\r
+    @return\r
+  **/\r
   int     open      (const char *name, int oflags, int mode);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     creat     (const char *, mode_t);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     fcntl     (int, int, ...);\r
 #endif  // __FCNTL_SYSCALLS_DECLARED\r
 \r
 /* These system calls are also declared in stat.h */\r
 #ifndef __STAT_SYSCALLS_DECLARED\r
   #define __STAT_SYSCALLS_DECLARED\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     mkdir     (const char *, mode_t);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     fstat     (int, struct stat *);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     lstat     (const char *, struct stat *);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     stat      (const char *, void *);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     chmod     (const char *, mode_t);\r
 #endif  // __STAT_SYSCALLS_DECLARED\r
 \r
 // These are also declared in sys/types.h\r
 #ifndef __OFF_T_SYSCALLS_DECLARED\r
   #define __OFF_T_SYSCALLS_DECLARED\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   off_t   lseek     (int, off_t, int);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     truncate  (const char *, off_t);\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
   int     ftruncate (int, off_t);   //  IEEE Std 1003.1b-93\r
 #endif /* __OFF_T_SYSCALLS_DECLARED */\r
 \r
 /* EFI-specific Functions. */\r
-int       DeleteOnClose(int fd);    /* Mark an open file to be deleted when closed. */\r
+\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
+  int       DeleteOnClose(int fd);    /* Mark an open file to be deleted when closed. */\r
 \r
 /* Find and reserve a free File Descriptor.\r
 \r
@@ -97,7 +344,7 @@ int       DeleteOnClose(int fd);    /* Mark an open file to be deleted when clos
   @return   Returns -1 if there are no free FDs.  Otherwise returns the\r
             found fd.\r
 */\r
-int       FindFreeFD  (int MinFd);\r
+  int       FindFreeFD  (int MinFd);\r
 \r
 /*  Validate that fd refers to a valid file descriptor.\r
     IsOpen is interpreted as follows:\r
@@ -108,15 +355,26 @@ int       FindFreeFD  (int MinFd);
     @retval TRUE  fd is VALID\r
     @retval FALSE fd is INVALID\r
 */\r
-BOOLEAN   ValidateFD (int fd, int IsOpen);\r
+  BOOLEAN   ValidateFD (int fd, int IsOpen);\r
 \r
-char     *getcwd    (char *, size_t);\r
-int       chdir     (const char *);\r
 \r
-/* These system calls don't YET have EFI implementations. */\r
-int       access    (const char *path, int amode);\r
-int       reboot    (int, char *);\r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
+  char     *getcwd    (char *, size_t);\r
 \r
+  /**\r
+    @param[in]\r
+\r
+    @return\r
+  **/\r
+  int       chdir     (const char *);\r
+\r
+/* These system calls don't YET have EFI implementations. */\r
+  int       access    (const char *path, int amode);\r
+  int       reboot    (int, char *);\r
 __END_DECLS\r
 \r
 #endif  /* _EFI_SYS_CALL_H */\r
index a0ebbb9881605a7498ab3dd5f9c30d18fc043c92..ecef1e2f6139409c67531a97730bc401cde1bb35 100644 (file)
     if Daylight Saving Time is not in effect, and negative if the information\r
     is not available.\r
 \r
+    The following macros are defined in this file:<BR>\r
+    @verbatim\r
+      NULL\r
+      CLOCKS_PER_SEC    The number of values per second returned by the clock function.\r
+    @endverbatim\r
+\r
+    The following types are defined in this file:<BR>\r
+    @verbatim\r
+      size_t      Unsigned integer type of the result of the sizeof operator.\r
+      clock_t     Arithmetic type capable of representing a time from the clock function.\r
+      time_t      Arithmetic type capable of representing a time.\r
+      struct tm   Holds the components of a calendar time; or broken-down time.\r
+    @endverbatim\r
+\r
+    The following functions are declared in this file:<BR>\r
+    @verbatim\r
+      ###############  Time Manipulation Functions\r
+      clock_t       clock     (void);\r
+      double        difftime  (time_t time1, time_t time0);\r
+      time_t        mktime    (struct tm *timeptr);\r
+      time_t        time      (time_t *timer);\r
+\r
+      #################  Time Conversion Functions\r
+      char        * asctime   (const struct tm *timeptr);\r
+      char        * ctime     (const time_t *timer);\r
+      struct tm   * gmtime    (const time_t *timer);\r
+      time_t        timegm    (struct tm*);\r
+      struct tm   * localtime (const time_t *timer);\r
+      size_t        strftime  (char * __restrict s, size_t maxsize,\r
+                               const char * __restrict format,\r
+                               const struct tm * __restrict timeptr);\r
+      char        * strptime  (const char *, const char * format, struct tm*);\r
+    @endverbatim\r
+\r
     Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made available under\r
     the terms and conditions of the BSD License that accompanies this distribution.\r
@@ -41,7 +75,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
 #ifndef _TIME_H\r
 #define _TIME_H\r
   #undef _BSD_SIZE_T_\r
 #endif\r
 \r
-/** An arithmetic type capable of representing values returned by clock(); **/\r
 #ifdef _EFI_CLOCK_T\r
+  /** An arithmetic type capable of representing values returned by clock(); **/\r
   typedef _EFI_CLOCK_T  clock_t;\r
   #undef _EFI_CLOCK_T\r
 #endif\r
 \r
-/** An arithmetic type capable of representing values returned as calendar time\r
-    values, such as that returned by mktime();\r
-**/\r
 #ifdef _EFI_TIME_T\r
+  /** An arithmetic type capable of representing values returned as calendar time\r
+      values, such as that returned by mktime();\r
+  **/\r
   typedef _EFI_TIME_T  time_t;\r
   #undef _EFI_TIME_T\r
 #endif\r
 \r
-/** Value added to tm_year to get the full year value.  TM_YEAR_BASE + 110 --> 2010\r
-**/\r
+/** Value added to tm_year to get the full year value.  TM_YEAR_BASE + 110 --> 2010 **/\r
 #define TM_YEAR_BASE  1900\r
 \r
-/** Values for the tm_wday member of struct tm.\r
-  @{\r
+/** @{\r
+    Values for the tm_wday member of struct tm.\r
 **/\r
 #define TM_SUNDAY     0\r
 #define TM_MONDAY     1\r
 #define TM_THURSDAY   4\r
 #define TM_FRIDAY     5\r
 #define TM_SATURDAY   6\r
-/** @}  **/\r
+/*@}*/\r
 \r
-/** Values for the tm_mon member of struct tm.\r
-  @{\r
+/** @{\r
+    Values for the tm_mon member of struct tm.\r
 **/\r
 #define TM_JANUARY     0\r
 #define TM_FEBRUARY    1\r
 #define TM_OCTOBER     9\r
 #define TM_NOVEMBER   10\r
 #define TM_DECEMBER   11\r
-/** @}  **/\r
+/*@}*/\r
 \r
 /** A structure holding the components of a calendar time, called the\r
     broken-down time.  The first nine (9) members are as mandated by the\r
@@ -133,17 +165,21 @@ struct tm {
               the macro CLOCKS_PER_SEC.  If the processor time used is not\r
               available or its value cannot be represented, the function\r
               returns the value (clock_t)(-1).\r
-\r
-              On IA32 or X64 platforms, the value returned is the number of\r
-              CPU TimeStamp Counter ticks since the appliation started.\r
 **/\r
 clock_t  clock(void);\r
 \r
-/**\r
+/** Compute the difference between two calendar times: time1 - time0.\r
+\r
+    @param[in]  time1   An arithmetic calendar time.\r
+    @param[in]  time2   Another arithmetic calendar time.\r
+\r
+    @return   The difference between the two times expressed in seconds.\r
 **/\r
 double difftime(time_t time1, time_t time0);\r
 \r
-/** The mktime function converts the broken-down time, expressed as local time,\r
+/** Convert a broken-down time into an arithmetic calendar time.\r
+\r
+    The mktime function converts the broken-down time, expressed as local time,\r
     in the structure pointed to by timeptr into a calendar time value with the\r
     same encoding as that of the values returned by the time function. The\r
     original values of the tm_wday and tm_yday components of the structure are\r
@@ -155,6 +191,8 @@ double difftime(time_t time1, time_t time0);
     the final value of tm_mday is not set until tm_mon and tm_year\r
     are determined.\r
 \r
+    @param[in]  timeptr   Pointer to a broken-down time to be converted.\r
+\r
     @return   The mktime function returns the specified calendar time encoded\r
               as a value of type time_t. If the calendar time cannot be\r
               represented, the function returns the value (time_t)(-1).\r
@@ -163,7 +201,10 @@ time_t mktime(struct tm *timeptr);
 \r
 /** The time function determines the current calendar time.\r
 \r
-    The encoding of the value is unspecified.\r
+    The encoding of the value is unspecified and undocumented.\r
+\r
+    @param[out]   timer   An optional pointer to an object in which to\r
+                          store the calendar time.\r
 \r
     @return   The time function returns the implementation's best approximation\r
               of the current calendar time. The value (time_t)(-1) is returned\r
@@ -176,23 +217,33 @@ time_t time(time_t *timer);
 /* #################  Time Conversion Functions  ########################## */\r
 \r
 /** The asctime function converts the broken-down time in the structure pointed\r
-    to by timeptr into a string in the form\r
+    to by timeptr into a string in the form<BR>\r
+    @verbatim\r
           Sun Sep 16 01:03:52 1973\n\0\r
+    @endverbatim\r
+\r
+    @param[in]  timeptr   A pointer to a broken-down time to convert.\r
 \r
     @return   The asctime function returns a pointer to the string.\r
 **/\r
 char * asctime(const struct tm *timeptr);\r
 \r
-/** The ctime function converts the calendar time pointed to by timer to local\r
+/** The ctime function converts the calendar time pointed to by timer to local\r
     time in the form of a string. It is equivalent to asctime(localtime(timer))\r
 \r
+    @param[in]  timer   Pointer to a calendar time value to convert into a\r
+                        string representation.\r
+\r
     @return   The ctime function returns the pointer returned by the asctime\r
               function with that broken-down time as argument.\r
 **/\r
 char * ctime(const time_t *timer);\r
 \r
 /** The gmtime function converts the calendar time pointed to by timer into a\r
-    brokendown time, expressed as UTC.\r
+    broken-down time, expressed as UTC.\r
+\r
+    @param[in]  timer   Pointer to a calendar time value to convert into a\r
+                        broken-down time.\r
 \r
     @return   The gmtime function returns a pointer to the broken-down time,\r
               or a null pointer if the specified time cannot be converted to UTC.\r
@@ -201,6 +252,9 @@ struct tm  * gmtime(const time_t *timer);
 \r
 /** The timegm function is the opposite of gmtime.\r
 \r
+    @param[in]  tm    Pointer to a broken-down time to convert into a\r
+                      calendar time.\r
+\r
     @return   The calendar time expressed as UTC.\r
 **/\r
 time_t timegm(struct tm*);\r
@@ -208,6 +262,8 @@ time_t timegm(struct tm*);
 /** The localtime function converts the calendar time pointed to by timer into\r
     a broken-down time, expressed as local time.\r
 \r
+    @param[in]  timer   Pointer to a calendar time value to be converted.\r
+\r
     @return   The localtime function returns a pointer to the broken-down time,\r
               or a null pointer if the specified time cannot be converted to\r
               local time.\r
index bab02b05b91cba4edf103eb94b25aa8c60764418..7a064ee0b49bcdae7eadb24583212edfe643684f 100644 (file)
     in this file causes copying to take place between objects that overlap, the\r
     behavior is undefined.\r
 \r
-    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+    The following macros are defined in this file:<BR>\r
+    @verbatim\r
+      NULL        Actually defined in <sys/EfiCdefs.h>\r
+      WCHAR_MIN   Minimum value of a wide char.\r
+      WCHAR_MAX   Maximum value of a wide char.\r
+      WEOF        Wide char version of end-of-file.\r
+    @endverbatim\r
+\r
+    The following types are defined in this file:<BR>\r
+    @verbatim\r
+      size_t      Unsigned integer type of the result of the sizeof operator.\r
+      wchar_t     Type of wide characters.\r
+      wint_t      Type capable of holding all wchar_t values and WEOF.\r
+      mbstate_t   Type of object holding multibyte conversion state.\r
+      struct tm   Incomplete declaration of the broken-down time structure.\r
+    @endverbatim\r
+\r
+    The following functions are declared in this file:<BR>\r
+@verbatim\r
+      ###############  Formatted Input/Output Functions\r
+      int       fwprintf  (FILE * __restrict stream,\r
+                           const wchar_t * __restrict format, ...);\r
+      int       fwscanf   (FILE * __restrict stream,\r
+                           const wchar_t * __restrict format, ...);\r
+      int       swprintf  (wchar_t * __restrict s,  size_t n,\r
+                           const wchar_t * __restrict format, ...);\r
+      int       swscanf   (const wchar_t * __restrict s,\r
+                           const wchar_t * __restrict format, ...);\r
+      int       vfwprintf (FILE * __restrict stream,\r
+                           const wchar_t * __restrict format,   va_list arg);\r
+      int       vfwscanf  (FILE * __restrict stream,\r
+                           const wchar_t * __restrict format,   va_list arg);\r
+      int       vswprintf (wchar_t * __restrict s,  size_t n,\r
+                           const wchar_t * __restrict format,   va_list arg);\r
+      int       vswscanf  (const wchar_t * __restrict s,\r
+                           const wchar_t * __restrict format,   va_list arg);\r
+      int       vwprintf  (const wchar_t * __restrict format,   va_list arg);\r
+      int       vwscanf   (const wchar_t * __restrict format,   va_list arg);\r
+      int       wprintf   (const wchar_t * __restrict format, ...);\r
+      int       wscanf    (const wchar_t * __restrict format, ...);\r
+\r
+      ###################  Input/Output Functions\r
+      wint_t    fgetwc    (FILE *stream);\r
+      wchar_t  *fgetws    (wchar_t * __restrict S,  int n,\r
+                           FILE * __restrict stream);\r
+      wint_t    fputwc    (wchar_t c, FILE *stream);\r
+      int       fputws    (const wchar_t * __restrict S,\r
+                           FILE * __restrict stream);\r
+      int       fwide     (FILE *stream, int mode);\r
+      wint_t    getwc     (FILE *stream);\r
+      wint_t    getwchar  (void);\r
+      wint_t    putwc     (wchar_t c, FILE *stream);\r
+      wint_t    putwchar  (wchar_t c);\r
+      wint_t    ungetwc   (wint_t c, FILE *stream);\r
+\r
+      ###################  Numeric Conversions\r
+      double                  wcstod    (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr);\r
+      float                   wcstof    (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr);\r
+      long double             wcstold   (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr);\r
+      long int                wcstol    (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr, int base);\r
+      long long int           wcstoll   (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr, int base);\r
+      unsigned long int       wcstoul   (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr, int base);\r
+      unsigned long long int  wcstoull  (const wchar_t * __restrict nptr,\r
+                                         wchar_t ** __restrict endptr, int base);\r
+\r
+      #######################  String Copying\r
+      wchar_t  *wcscpy    (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2);\r
+      wchar_t  *wcsncpy   (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2,   size_t n);\r
+      wchar_t  *wmemcpy   (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2,   size_t n);\r
+      wchar_t  *wmemmove  (wchar_t *s1, const wchar_t *s2,  size_t n);\r
+\r
+      ###################  String Concatenation\r
+      wchar_t  *wcscat    (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2);\r
+      wchar_t  *wcsncat   (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2,   size_t n);\r
+\r
+      #####################  String Comparison\r
+      int       wcscmp    (const wchar_t *s1, const wchar_t *s2);\r
+      int       wcscoll   (const wchar_t *s1, const wchar_t *s2);\r
+      int       wcsncmp   (const wchar_t *s1, const wchar_t *s2,  size_t n);\r
+      size_t    wcsxfrm   (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2,   size_t n);\r
+      int       wmemcmp   (const wchar_t *s1,  const wchar_t *s2,  size_t n);\r
+\r
+      #####################  String Searching\r
+      wchar_t  *wcschr    (const wchar_t *S, wchar_t c);\r
+      size_t    wcscspn   (const wchar_t *s1, const wchar_t *s2);\r
+      wchar_t  *wcspbrk   (const wchar_t *s1, const wchar_t *s2);\r
+      wchar_t  *wcsrchr   (const wchar_t *S, wchar_t c);\r
+      size_t    wcsspn    (const wchar_t *s1, const wchar_t *s2);\r
+      wchar_t  *wcsstr    (const wchar_t *s1, const wchar_t *s2);\r
+      wchar_t  *wcstok    (wchar_t * __restrict s1,\r
+                           const wchar_t * __restrict s2,\r
+                           wchar_t ** __restrict ptr);\r
+      wchar_t  *wmemchr   (const wchar_t *S,  wchar_t c,  size_t n);\r
+\r
+      ###################  String Manipulation\r
+      size_t    wcslen    (const wchar_t *S);\r
+      wchar_t  *wmemset   (wchar_t *S,  wchar_t c,  size_t n);\r
+\r
+      #################  Date and Time Conversion\r
+      size_t    wcsftime  (wchar_t * __restrict S,  size_t maxsize,\r
+                           const wchar_t * __restrict format,\r
+                           const struct tm * __restrict timeptr);\r
+\r
+      #############  Multibyte <--> Wide Character Conversion\r
+      wint_t    btowc     (int c);\r
+      int       wctob     (wint_t c);\r
+      int       mbsinit   (const mbstate_t *ps);\r
+\r
+      #######  Restartable Multibyte <--> Wide Character Conversion\r
+      size_t    mbrlen    (const char * __restrict S,   size_t n,\r
+                           mbstate_t * __restrict ps);\r
+      size_t    mbrtowc   (wchar_t * __restrict pwc,  const char * __restrict S,\r
+                           size_t n, mbstate_t * __restrict ps);\r
+      size_t    wcrtomb   (char * __restrict S,   wchar_t wc,\r
+                           mbstate_t * __restrict ps);\r
+      size_t    mbsrtowcs (wchar_t * __restrict dst,\r
+                           const char ** __restrict src,  size_t len,\r
+                           mbstate_t * __restrict ps);\r
+      size_t    wcsrtombs (char * __restrict dst,\r
+                           const wchar_t ** __restrict src,\r
+                           size_t len,  mbstate_t * __restrict ps);\r
+@endverbatim\r
+\r
+    @note   Properly constructed programs will take the following into consideration:\r
+              - wchar_t and wint_t may be the same integer type.\r
+              - WEOF might be a different value than that of EOF.\r
+              - WEOF might not be negative.\r
+              - mbstate_t objects are not intended to be inspected by programs.\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
 **/\r
 #ifndef _WCHAR_H\r
 #define _WCHAR_H\r
 #endif\r
 \r
 #ifdef _EFI_SIZE_T_\r
-  typedef _EFI_SIZE_T_  size_t;\r
+  typedef _EFI_SIZE_T_    size_t;   /**< Unsigned integer type of the result of the sizeof operator. */\r
   #undef _BSD_SIZE_T_\r
   #undef _EFI_SIZE_T_\r
 #endif\r
 \r
 #ifndef __cplusplus\r
   #ifdef _EFI_WCHAR_T\r
-    typedef _EFI_WCHAR_T wchar_t;\r
+    /** An integer type capable of representing all distinct codes in the\r
+        UCS-2 encoding supported by UEFI.\r
+    **/\r
+    typedef _EFI_WCHAR_T  wchar_t;\r
     #undef _BSD_WCHAR_T_\r
     #undef  _EFI_WCHAR_T\r
   #endif\r
 #endif\r
 \r
-/*  mbstate_t is an opaque object, that must not be an array type, used to keep\r
-    conversion state during multibyte stream conversions.\r
- */\r
 #ifdef _BSD_MBSTATE_T_\r
+  /** mbstate_t is an opaque object, that is not an array type, used to keep\r
+      conversion state during multibyte stream conversions.\r
+   */\r
   typedef _BSD_MBSTATE_T_ mbstate_t;\r
   #undef _BSD_MBSTATE_T_\r
 #endif\r
 \r
-/*  wint_t is an integer type unchanged by default argument promotions that can\r
-    hold any value corresponding to members of the extended character set, as\r
-    well as at least one value that does not correspond to any member of the\r
-    extended character set: WEOF.\r
-*/\r
 #ifdef _EFI_WINT_T\r
-  typedef _EFI_WINT_T  wint_t;\r
+  /** wint_t is an integer type unchanged by default argument promotions that can\r
+      hold any value corresponding to members of the extended character set, as\r
+      well as at least one value that does not correspond to any member of the\r
+      extended character set: WEOF.\r
+  */\r
+  typedef _EFI_WINT_T     wint_t;\r
   #undef _BSD_WINT_T_\r
   #undef _EFI_WINT_T\r
 #endif\r
 \r
-/*  Since wchar_t is an unsigned 16-bit value, it has a minimum value of 0, and\r
-    a maximum value defined by __USHRT_MAX (65535 on IA processors).\r
-*/\r
 #ifndef WCHAR_MIN\r
-  #define WCHAR_MIN 0\r
-  #define WCHAR_MAX __USHRT_MAX\r
-#endif\r
-\r
-/* limits of wint_t */\r
-#ifndef WINT_MIN\r
-  #define WINT_MIN  _EFI_WINT_MIN       /* wint_t   */\r
-  #define WINT_MAX  _EFI_WINT_MAX       /* wint_t   */\r
+  /** @{\r
+      Since wchar_t is an unsigned 16-bit value, it has a minimum value of 0, and\r
+      a maximum value defined by __USHRT_MAX (65535 on IA processors).\r
+  */\r
+  #define WCHAR_MIN       0\r
+  #define WCHAR_MAX       __USHRT_MAX\r
+  /*@}*/\r
 #endif\r
 \r
-/*  WEOF expands to a constant expression of type wint_t whose value does not\r
-    correspond to any member of the extended character set. It is accepted\r
-    (and returned) by several functions, declared in this file, to indicate\r
-    end-of-file, that is, no more input from a stream. It is also used as a\r
-    wide character value that does not correspond to any member of the\r
-    extended character set.\r
-*/\r
 #ifndef WEOF\r
+  /** WEOF expands to a constant expression of type wint_t whose value does not\r
+      correspond to any member of the extended character set. It is accepted\r
+      (and returned) by several functions, declared in this file, to indicate\r
+      end-of-file, that is, no more input from a stream. It is also used as a\r
+      wide character value that does not correspond to any member of the\r
+      extended character set.\r
+  */\r
   #define WEOF  ((wint_t)-1)\r
 #endif\r
 \r
-/*  tm is declared here as an incomplete structure type.  The full structure\r
-    declaration is in <time.h>.\r
+/* limits of wint_t -- These are NOT specified by ISO/IEC 9899 */\r
+#ifndef WINT_MIN\r
+  #define WINT_MIN        _EFI_WINT_MIN       /* wint_t   */\r
+  #define WINT_MAX        _EFI_WINT_MAX       /* wint_t   */\r
+#endif\r
+\r
+/** Type struct tm is declared here as an incomplete structure type for use as an argument\r
+    type by the wcsftime function.  The full structure declaration is in <time.h>.\r
 */\r
 struct  tm;\r
 \r
 /* ###############  Formatted Input/Output Functions  ##################### */\r
 \r
-/**\r
-The fwprintf function writes output to the stream pointed to by stream, under\r
-control of the wide string pointed to by format that specifies how subsequent arguments\r
-are converted for output. If there are insufficient arguments for the format, the behavior\r
-is undefined. If the format is exhausted while arguments remain, the excess arguments\r
-are evaluated (as always) but are otherwise ignored. The fwprintf function returns\r
-when the end of the format string is encountered.\r
-\r
-The fwprintf function returns the number of wide characters transmitted, or a negative\r
-value if an output or encoding error occurred.\r
+/** The fwprintf function writes output to the stream pointed to by stream,\r
+    under control of the wide string pointed to by format that specifies how\r
+    subsequent arguments are converted for output. If there are insufficient\r
+    arguments for the format, the behavior is undefined. If the format is\r
+    exhausted while arguments remain, the excess arguments are evaluated\r
+    (as always) but are otherwise ignored. The fwprintf function returns\r
+    when the end of the format string is encountered.\r
+\r
+    The format is composed of zero or more directives: ordinary wide characters\r
+    (not %), which are copied unchanged to the output stream; and conversion\r
+    specifications, each of which results in fetching zero or more subsequent\r
+    arguments, converting them, if applicable, according to the corresponding\r
+    conversion specifier, and then writing the result to the output stream.\r
+\r
+    Each conversion specification is introduced by the wide character %. After\r
+    the %, the following appear in sequence:\r
+      \97 Zero or more flags (in any order) that modify the meaning of the\r
+        conversion specification.\r
+      \97 An optional minimum field width. If the converted value has fewer wide\r
+        characters than the field width, it is padded with spaces (by default)\r
+        on the left (or right, if the left adjustment flag, described later,\r
+        has been given) to the field width. The field width takes the form of\r
+        an asterisk * (described later) or a nonnegative decimal integer.\r
+      \97 An optional precision that gives the minimum number of digits to appear\r
+        for the d, i, o, u, x, and X conversions, the number of digits to\r
+        appear after the decimal-point wide character for e, E, f, and F\r
+        conversions, the maximum number of significant digits for the g and G\r
+        conversions, or the maximum number of wide characters to be written\r
+        for s conversions. The precision takes the form of a period (.)\r
+        followed either by an asterisk * (described later) or by an optional\r
+        decimal integer; if only the period is specified, the precision is\r
+        taken as zero. If a precision appears with any other conversion\r
+        specifier, the behavior is undefined.\r
+      \97 An optional length modifier that specifies the size of the argument.\r
+      \97 A conversion specifier wide character that specifies the type of\r
+        conversion to be applied.\r
+\r
+    As noted above, a field width, or precision, or both, may be indicated by\r
+    an asterisk. In this case, an int argument supplies the field width or\r
+    precision. The arguments specifying field width, or precision, or both,\r
+    must appear (in that order) before the argument (if any) to be converted.\r
+    A negative field width argument is taken as a - flag followed by a positive\r
+    field width. A negative precision argument is taken as if the precision\r
+    were omitted.\r
+\r
+    The flag wide characters and their meanings are:<BR>\r
+    -     The result of the conversion is left-justified within the field.\r
+          (It is right-justified if this flag is not specified.)\r
+    +     The result of a signed conversion always begins with a plus or minus\r
+          sign. (It begins with a sign only when a negative value is converted\r
+          if this flag is not specified.)\r
+    space If the first wide character of a signed conversion is not a sign, or\r
+          if a signed conversion results in no wide characters, a space is\r
+          prefixed to the result. If the space and + flags both appear, the\r
+          space flag is ignored.\r
+    #     The result is converted to an \91\91alternative form\92\92. For o conversion,\r
+          it increases the precision, if and only if necessary, to force the\r
+          first digit of the result to be a zero (if the value and precision\r
+          are both 0, a single 0 is printed). For x (or X) conversion, a\r
+          nonzero result has 0x (or 0X) prefixed to it. For e, E, f, F, g,\r
+          and G conversions, the result of converting a floating-point number\r
+          always contains a decimal-point wide character, even if no digits\r
+          follow it. (Normally, a decimal-point wide character appears in the\r
+          result of these conversions only if a digit follows it.) For g and G\r
+          conversions, trailing zeros are not removed from the result. For\r
+          other conversions, the behavior is undefined.\r
+    0     For d, i, o, u, x, X, e, E, f, F, g, and G conversions, leading zeros\r
+          (following any indication of sign or base) are used to pad to the\r
+          field width rather than performing space padding, except when\r
+          converting an infinity or NaN. If the 0 and - flags both appear,\r
+          the 0 flag is ignored. For d, i, o, u, x, and X conversions, if a\r
+          precision is specified, the 0 flag is ignored. For other conversions,\r
+          the behavior is undefined.\r
+\r
+    The length modifiers and their meanings are:<BR>\r
+    hh    Specifies that a following d, i, o, u, x, or X conversion specifier\r
+          applies to a signed char or unsigned char argument (the argument\r
+          will have been promoted according to the integer promotions, but its\r
+          value shall be converted to signed char or unsigned char before\r
+          printing); or that a following n conversion specifier applies to a\r
+          pointer to a signed char argument.\r
+    h     Specifies that a following d, i, o, u, x, or X conversion specifier\r
+          applies to a short int or unsigned short int argument (the argument\r
+          will have been promoted according to the integer promotions, but its\r
+          value shall be converted to short int or unsigned short int before\r
+          printing); or that a following n conversion specifier applies to a\r
+          pointer to a short int argument.\r
+    l (ell)   Specifies that a following d, i, o, u, x, or X conversion\r
+              specifier applies to a long int or unsigned long int argument;\r
+              that a following n conversion specifier applies to a pointer to a\r
+              long int argument; that a following c conversion specifier\r
+              applies to a wint_t argument; that a following s conversion\r
+              specifier applies to a pointer to a wchar_t argument; or has no\r
+              effect on a following e, E, f, F, g, or G conversion specifier.\r
+    ll (ell-ell)  Specifies that a following d, i, o, u, x, or X conversion\r
+                  specifier applies to a long long int or unsigned long long int\r
+                  argument; or that a following n conversion specifier applies\r
+                  to a pointer to a long long int argument.\r
+    j     Specifies that a following d, i, o, u, x, or X conversion specifier\r
+          applies to an intmax_t or uintmax_t argument; or that a following\r
+          n conversion specifier applies to a pointer to an intmax_t argument.\r
+    z     Specifies that a following d, i, o, u, x, or X conversion specifier\r
+          applies to a size_t or the corresponding signed integer type\r
+          argument; or that a following n conversion specifier applies to a\r
+          pointer to a signed integer type corresponding to size_t argument.\r
+    t     Specifies that a following d, i, o, u, x, or X conversion specifier\r
+          applies to a ptrdiff_t or the corresponding unsigned integer type\r
+          argument; or that a following n conversion specifier applies to a\r
+          pointer to a ptrdiff_t argument.\r
+    L     Specifies that a following a, A, e, E, f, F, g, or G conversion\r
+          specifier applies to a long double argument.\r
+\r
+    If a length modifier appears with any conversion specifier other than as\r
+    specified above, the behavior is undefined.\r
+\r
+    The conversion specifiers and their meanings are:<BR>\r
+    d,i     The int argument is converted to signed decimal in the\r
+            style [-]dddd. The precision specifies the minimum number of digits\r
+            to appear; if the value being converted can be represented in fewer\r
+            digits, it is expanded with leading zeros. The default precision\r
+            is 1. The result of converting a zero value with a precision of\r
+            zero is no wide characters.\r
+    o,u,x,X The unsigned int argument is converted to unsigned octal (o),\r
+            unsigned decimal (u), or unsigned hexadecimal notation (x or X) in\r
+            the style dddd; the letters abcdef are used for x conversion and\r
+            the letters ABCDEF for X conversion. The precision specifies the\r
+            minimum number of digits to appear; if the value being converted\r
+            can be represented in fewer digits, it is expanded with leading\r
+            zeros. The default precision is 1. The result of converting a zero\r
+            value with a precision of zero is no wide characters.\r
+    f,F     A double argument representing a floating-point number is converted\r
+            to decimal notation in the style [-]ddd.ddd, where the number of\r
+            digits after the decimal-point wide character is equal to the\r
+            precision specification. If the precision is missing, it is taken\r
+            as 6; if the precision is zero and the # flag is not specified, no\r
+            decimal-point wide character appears. If a decimal-point wide\r
+            character appears, at least one digit appears before it. The value\r
+            is rounded to the appropriate number of digits.<BR>\r
+            A double argument representing an infinity is converted to [-]inf.\r
+            A double argument representing a NaN is converted to [-]nan.\r
+            The F conversion specifier produces INF or NAN instead\r
+            of inf or nan, respectively.\r
+    e,E     A double argument representing a floating-point number is converted\r
+            in the style [-]d.ddd e±dd, where there is one digit (which is\r
+            nonzero if the argument is nonzero) before the decimal-point wide\r
+            character and the number of digits after it is equal to the\r
+            precision; if the precision is missing, it is taken as 6; if the\r
+            precision is zero and the # flag is not specified, no decimal-point\r
+            wide character appears. The value is rounded to the appropriate\r
+            number of digits. The E conversion specifier produces a number with\r
+            E instead of e introducing the exponent. The exponent always\r
+            contains at least two digits, and only as many more digits as\r
+            necessary to represent the exponent. If the value is zero, the\r
+            exponent is zero. A double argument representing an infinity or NaN\r
+            is converted in the style of an f or F conversion specifier.\r
+    g,G     A double argument representing a floating-point number is converted\r
+            in style f or e (or in style F or E in the case of a G conversion\r
+            specifier), depending on the value converted and the precision.\r
+            Let P equal the precision if nonzero, 6 if the precision is\r
+            omitted, or 1 if the precision is zero. Then, if a conversion with\r
+            style E would have an exponent of X:\r
+              - if P > X = -4, the conversion is with style f (or F) and\r
+                precision P - (X + 1).\r
+              - otherwise, the conversion is with style e (or E) and\r
+                precision P - 1.\r
+            Finally, unless the # flag is used, any trailing zeros are removed\r
+            from the fractional portion of the result and the decimal-point\r
+            wide character is removed if there is no fractional portion\r
+            remaining.  A double argument representing an infinity or NaN is\r
+            converted in the style of an f or F conversion specifier.\r
+    c       If no l length modifier is present, the int argument is converted\r
+            to a wide character as if by calling btowc and the resulting wide\r
+            character is written.  If an l length modifier is present, the\r
+            wint_t argument is converted to wchar_t and written.\r
+    s       If no l length modifier is present, the argument shall be a pointer\r
+            to the initial element of a character array containing a multibyte\r
+            character sequence beginning in the initial shift state. Characters\r
+            from the array are converted as if by repeated calls to the mbrtowc\r
+            function, with the conversion state described by an mbstate_t\r
+            object initialized to zero before the first multibyte character is\r
+            converted, and written up to (but not including) the terminating\r
+            null wide character. If the precision is specified, no more than\r
+            that many wide characters are written. If the precision is not\r
+            specified or is greater than the size of the converted array, the\r
+            converted array shall contain a null wide character.<BR>\r
+            If an l length modifier is present, the argument shall be a pointer\r
+            to the initial element of an array of wchar_t type. Wide characters\r
+            from the array are written up to (but not including) a terminating\r
+            null wide character. If the precision is specified, no more than\r
+            that many wide characters are written. If the precision is not\r
+            specified or is greater than the size of the array, the array\r
+            shall contain a null wide character.\r
+    p       The argument shall be a pointer to void. The value of the pointer\r
+            is converted to a sequence of printing wide characters, in an\r
+            implementation-defined manner.\r
+    n       The argument shall be a pointer to signed integer into which is\r
+            written the number of wide characters written to the output stream\r
+            so far by this call to fwprintf. No argument is converted, but one\r
+            is consumed. If the conversion specification includes any flags, a\r
+            field width, or a precision, the behavior is undefined.\r
+    %       A % wide character is written. No argument is converted. The\r
+            complete conversion specification is %%.\r
+\r
+\r
+    @param[in]  stream    An open File specifier to which the output is sent.\r
+    @param[in]  format    A wide character sequence containing characters\r
+                          to be copied unchanged, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param      ...       Variable number of parameters as required by format.\r
+\r
+    @return   The fwprintf function returns the number of wide characters\r
+              transmitted, or a negative value if an output or encoding error\r
+              occurred.\r
 **/\r
 int fwprintf(FILE * __restrict stream, const wchar_t * __restrict format, ...);\r
 \r
-/**\r
-The fwscanf function reads input from the stream pointed to by stream, under\r
-control of the wide string pointed to by format that specifies the admissible input\r
-sequences and how they are to be converted for assignment, using subsequent arguments\r
-as pointers to the objects to receive the converted input. If there are insufficient\r
-arguments for the format, the behavior is undefined. If the format is exhausted while\r
-arguments remain, the excess arguments are evaluated (as always) but are otherwise\r
-ignored.\r
-\r
-The fwscanf function returns the value of the macro EOF if an input failure occurs\r
-before any conversion. Otherwise, the function returns the number of input items\r
-assigned, which can be fewer than provided for, or even zero, in the event of an early\r
-matching failure.\r
+/** The fwscanf function reads input from the stream pointed to by stream,\r
+    under control of the wide string pointed to by format that specifies\r
+    the admissible input sequences and how they are to be converted for\r
+    assignment, using subsequent arguments as pointers to the objects to\r
+    receive the converted input. If there are insufficient arguments for\r
+    the format, the behavior is undefined. If the format is exhausted while\r
+    arguments remain, the excess arguments are evaluated (as always) but are\r
+    otherwise ignored.\r
+\r
+    The format is composed of zero or more directives: one or more white-space\r
+    wide characters, an ordinary wide character (neither % nor a white-space\r
+    wide character), or a conversion specification. Each conversion\r
+    specification is introduced by the wide character %. After the %, the\r
+    following appear in sequence:\r
+      - An optional assignment-suppressing wide character *.\r
+      - An optional decimal integer greater than zero that specifies the\r
+        maximum field width (in wide characters).\r
+      - An optional length modifier that specifies the size of the receiving object.\r
+      - A conversion specifier wide character that specifies the type of\r
+        conversion to be applied.\r
+\r
+    The fwscanf function executes each directive of the format in turn. If a\r
+    directive fails, as detailed below, the function returns. Failures are\r
+    described as input failures (due to the occurrence of an encoding error\r
+    or the unavailability of input characters), or matching failures\r
+    (due to inappropriate input).\r
+\r
+    A directive composed of white-space wide character(s) is executed by\r
+    reading input up to the first non-white-space wide character (which remains\r
+    unread), or until no more wide characters can be read.\r
+\r
+    A directive that is an ordinary wide character is executed by reading the\r
+    next wide character of the stream. If that wide character differs from the\r
+    directive, the directive fails and the differing and subsequent wide\r
+    characters remain unread. Similarly, if end-of-file, an encoding error, or\r
+    a read error prevents a wide character from being read, the directive fails.\r
+\r
+    A directive that is a conversion specification defines a set of matching\r
+    input sequences, as described below for each specifier. A conversion\r
+    specification is executed in the following steps:\r
+      - Input white-space wide characters (as specified by the iswspace\r
+        function) are skipped, unless the specification includes\r
+        a [, c, or n specifier.\r
+      - An input item is read from the stream, unless the specification\r
+        includes an n specifier. An input item is defined as the longest\r
+        sequence of input wide characters which does not exceed any specified\r
+        field width and which is, or is a prefix of, a matching input sequence.\r
+        The first wide character, if any, after the input item remains unread.\r
+        If the length of the input item is zero, the execution of the directive\r
+        fails; this condition is a matching failure unless end-of-file, an\r
+        encoding error, or a read error prevented input from the stream, in\r
+        which case it is an input failure.\r
+      - Except in the case of a % specifier, the input item (or, in the case of\r
+        a %n directive, the count of input wide characters) is converted to a\r
+        type appropriate to the conversion specifier. If the input item is not\r
+        a matching sequence, the execution of the directive fails: this\r
+        condition is a matching failure. Unless assignment suppression was\r
+        indicated by a *, the result of the conversion is placed in the object\r
+        pointed to by the first argument following the format argument that has\r
+        not already received a conversion result. If this object does not have\r
+        an appropriate type, or if the result of the conversion cannot be\r
+        represented in the object, the behavior is undefined.\r
+\r
+    The length modifiers and their meanings are:<BR>\r
+    hh      Specifies that a following d, i, o, u, x, X, or n conversion\r
+            specifier applies to an argument with type pointer to signed char\r
+            or unsigned char.\r
+    h       Specifies that a following d, i, o, u, x, X, or n conversion\r
+            specifier applies to an argument with type pointer to short int\r
+            or unsigned short int.\r
+    l (ell) Specifies that a following d, i, o, u, x, X, or n conversion\r
+            specifier applies to an argument with type pointer to long int or\r
+            unsigned long int; that a following e, E, f, F, g, or G conversion\r
+            specifier applies to an argument with type pointer to double; or\r
+            that a following c, s, or [ conversion specifier applies to an\r
+            argument with type pointer to wchar_t.\r
+    ll (ell-ell)  Specifies that a following d, i, o, u, x, X, or n conversion\r
+                  specifier applies to an argument with type\r
+                  pointer to long long int or unsigned long long int.\r
+    j       Specifies that a following d, i, o, u, x, X, or n conversion\r
+            specifier applies to an argument with type pointer to intmax_t\r
+            or uintmax_t.\r
+    z       Specifies that a following d, i, o, u, x, X, or n conversion\r
+            specifier applies to an argument with type pointer to size_t or the\r
+            corresponding signed integer type.\r
+    t       Specifies that a following d, i, o, u, x, X, or n conversion\r
+            specifier applies to an argument with type pointer to ptrdiff_t or\r
+            the corresponding unsigned integer type.\r
+    L       Specifies that a following e, E, f, F, g, or G conversion specifier\r
+            applies to an argument with type pointer to long double.\r
+\r
+    If a length modifier appears with any conversion specifier other than as\r
+    specified above, the behavior is undefined.\r
+\r
+    The conversion specifiers and their meanings are:<BR>\r
+    d       Matches an optionally signed decimal integer, whose format is the\r
+            same as expected for the subject sequence of the wcstol function\r
+            with the value 10 for the base argument. The corresponding argument\r
+            shall be a pointer to signed integer.\r
+    i       Matches an optionally signed integer, whose format is the same as\r
+            expected for the subject sequence of the wcstol function with the\r
+            value 0 for the base argument. The corresponding argument shall be\r
+            a pointer to signed integer.\r
+    o       Matches an optionally signed octal integer, whose format is the\r
+            same as expected for the subject sequence of the wcstoul function\r
+            with the value 8 for the base argument. The corresponding argument\r
+            shall be a pointer to unsigned integer.\r
+    u       Matches an optionally signed decimal integer, whose format is the\r
+            same as expected for the subject sequence of the wcstoul function\r
+            with the value 10 for the base argument. The corresponding argument\r
+            shall be a pointer to unsigned integer.\r
+    x       Matches an optionally signed hexadecimal integer, whose format is\r
+            the same as expected for the subject sequence of the wcstoul\r
+            function with the value 16 for the base argument. The corresponding\r
+            argument shall be a pointer to unsigned integer.\r
+    e,f,g   Matches an optionally signed floating-point number, infinity, or\r
+            NaN, whose format is the same as expected for the subject sequence\r
+            of the wcstod function. The corresponding argument shall be a\r
+            pointer to float.\r
+    c       Matches a sequence of wide characters of exactly the number\r
+            specified by the field width (1 if no field width is present in the\r
+            directive).<BR>\r
+            If no l length modifier is present, characters from the input field\r
+            are converted as if by repeated calls to the wcrtomb function, with\r
+            the conversion state described by an mbstate_t object initialized\r
+            to zero before the first wide character is converted. The\r
+            corresponding argument shall be a pointer to the initial element of\r
+            a character array large enough to accept the sequence. No null\r
+            character is added.<BR>\r
+            If an l length modifier is present, the corresponding argument\r
+            shall be a pointer to the initial element of an array of\r
+            wchar_t large enough to accept the sequence.\r
+            No null wide character is added.\r
+    s       Matches a sequence of non-white-space wide characters.\r
+            If no l length modifier is present, characters from the input field\r
+            are converted as if by repeated calls to the wcrtomb function, with\r
+            the conversion state described by an mbstate_t object initialized\r
+            to zero before the first wide character is converted. The\r
+            corresponding argument shall be a pointer to the initial element of\r
+            a character array large enough to accept the sequence and a\r
+            terminating null character, which will be added automatically.<BR>\r
+            If an l length modifier is present, the corresponding argument\r
+            shall be a pointer to the initial element of an array of wchar_t\r
+            large enough to accept the sequence and the terminating null wide\r
+            character, which will be added automatically.\r
+    [       Matches a nonempty sequence of wide characters from a set of\r
+            expected characters (the scanset).<BR>\r
+            If no l length modifier is present, characters from the input field\r
+            are converted as if by repeated calls to the wcrtomb function, with\r
+            the conversion state described by an mbstate_t object initialized\r
+            to zero before the first wide character is converted. The\r
+            corresponding argument shall be a pointer to the initial element of\r
+            a character array large enough to accept the sequence and a\r
+            terminating null character, which will be added automatically.<BR>\r
+            If an l length modifier is present, the corresponding argument\r
+            shall be a pointer to the initial element of an array of wchar_t\r
+            large enough to accept the sequence and the terminating null wide\r
+            character, which will be added automatically.<BR>\r
+            The conversion specifier includes all subsequent wide characters\r
+            in the format string, up to and including the matching right\r
+            bracket (]). The wide characters between the brackets\r
+            (the scanlist) compose the scanset, unless the wide character after\r
+            the left bracket is a circumflex (^), in which case the scanset\r
+            contains all wide characters that do not appear in the scanlist\r
+            between the circumflex and the right bracket. If the conversion\r
+            specifier begins with [] or [^], the right bracket wide character\r
+            is in the scanlist and the next following right bracket wide\r
+            character is the matching right bracket that ends the specification;\r
+            otherwise the first following right bracket wide character is the\r
+            one that ends the specification. If a - wide character is in the\r
+            scanlist and is not the first, nor the second where the first wide\r
+            character is a ^, nor the last character,\r
+            the - is added to the scanset.\r
+    p       Matches the set of sequences produced by the %p conversion of the\r
+            fwprintf function. The corresponding argument is a pointer to a\r
+            pointer to void. The input item is converted to a pointer value. If\r
+            the input item is a value converted earlier during the same program\r
+            execution, the pointer that results will compare equal to that\r
+            value.\r
+    n       No input is consumed. The corresponding argument is a pointer to\r
+            signed integer into which is to be written the number of wide\r
+            characters read from the input stream so far by this call to the\r
+            fwscanf function. Execution of a %n directive does not increment\r
+            the assignment count returned at the completion of execution of the\r
+            fwscanf function. No argument is converted, but one is consumed.\r
+    %       Matches a single % wide character; no conversion or assignment\r
+            occurs. The complete conversion specification shall be %%.\r
+\r
+    The conversion specifiers E, F, G, and X are also valid and behave the same\r
+    as, respectively, e, f, g, and x.\r
+\r
+    Trailing white space (including new-line wide characters) is left unread\r
+    unless matched by a directive. The success of literal matches and\r
+    suppressed assignments is not directly determinable other than via\r
+    the %n directive.\r
+\r
+    @param[in]  stream    An open File specifier from which the input is read.\r
+    @param[in]  format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.  Converted\r
+                          items are stored according to their associated arguments.\r
+    @param      ...       Variable number of parameters, as required by format,\r
+                          specifying the objects to receive the converted input.\r
+\r
+    @return   The fwscanf function returns the value of the macro EOF if an\r
+              input failure occurs before any conversion. Otherwise, the\r
+              function returns the number of input items assigned, which can be\r
+              fewer than provided for, or even zero, in the event of an early\r
+              matching failure.\r
 **/\r
 int fwscanf(FILE * __restrict stream, const wchar_t * __restrict format, ...);\r
 \r
-/**\r
-The swprintf function is equivalent to fwprintf, except that the argument s\r
-specifies an array of wide characters into which the generated output is to be written,\r
-rather than written to a stream. No more than n wide characters are written, including a\r
-terminating null wide character, which is always added (unless n is zero).\r
-\r
-The swprintf function returns the number of wide characters written in the array, not\r
-counting the terminating null wide character, or a neg ative value if an encoding error\r
-occurred or if n or more wide characters were requested to be written.\r
+/** Formatted wide-character output to a buffer.\r
+\r
+    The swprintf function is equivalent to fwprintf, except that the argument s\r
+    specifies an array of wide characters into which the generated output is to\r
+    be written, rather than written to a stream. No more than n wide characters\r
+    are written, including a terminating null wide character, which is always\r
+    added (unless n is zero).\r
+\r
+    @param[out]   s         A pointer to the array to receive the formatted output.\r
+    @param[in]    n         Maximum number of characters to write into buffer s.\r
+    @param[in]    format    A wide character sequence containing characters\r
+                            to be copied unchanged, and conversion specifiers\r
+                            which convert their associated arguments.  Copied and\r
+                            converted characters are written to the array pointed\r
+                            to by s.\r
+    @param        ...       Variable number of parameters as required by format.\r
+\r
+    @return   The swprintf function returns the number of wide characters\r
+              written in the array, not counting the terminating null wide\r
+              character, or a negative value if an encoding error occurred or\r
+              if n or more wide characters were requested to be written.\r
 **/\r
 int swprintf(wchar_t * __restrict s, size_t n, const wchar_t * __restrict format, ...);\r
 \r
-/**\r
+/** Formatted wide input from a string.\r
+\r
+    The swscanf function is equivalent to fwscanf, except that the argument\r
+    Buff specifies a wide string from which the input is to be obtained, rather\r
+    than from a stream. Reaching the end of the wide string is equivalent to\r
+    encountering end-of-file for the fwscanf function.\r
+\r
+    @param[in]  Buff      Pointer to the string from which to obtain input.\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[out] ...       Variable number of parameters, as required by format,\r
+                          specifying the objects to receive the converted input.\r
+\r
+    @return   The swscanf function returns the value of the macro EOF if an\r
+              input failure occurs before any conversion. Otherwise, the\r
+              swscanf function returns the number of input items assigned,\r
+              which can be fewer than provided for, or even zero, in the event\r
+              of an early matching failure.\r
 **/\r
-int swscanf(const wchar_t * __restrict s, const wchar_t * __restrict format, ...);\r
-\r
-/**\r
+int swscanf(const wchar_t * __restrict Buff, const wchar_t * __restrict Format, ...);\r
+\r
+/** Print formatted values from an argument list.\r
+\r
+The vfwprintf function is equivalent to fwprintf, with the variable argument list\r
+replaced by Args, which shall have been initialized by the va_start macro (and\r
+possibly subsequent va_arg calls). The vfwprintf function does not invoke the\r
+va_end macro.\r
+\r
+    @param[in]  Stream    The output stream to receive the formatted output.\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[in]  Args      A list of arguments, initialized by the va_start macro\r
+                          and accessed using the va_arg macro, used to satisfy\r
+                          the directives in the Format string.\r
+\r
+    @return   The vfwprintf function returns the number of wide characters\r
+              transmitted, or a negative value if an output or encoding\r
+              error occurred.\r
 **/\r
-int vfwprintf(FILE * __restrict stream, const wchar_t * __restrict format, va_list arg);\r
-\r
-/**\r
+int vfwprintf(FILE * __restrict Stream, const wchar_t * __restrict Format, va_list Args);\r
+\r
+/** Formatted input from a stream.\r
+\r
+    The vfwscanf function is equivalent to fwscanf, with the variable argument\r
+    list replaced by Args, which must have been initialized by the va_start\r
+    macro (and possibly subsequent va_arg calls). The vfwscanf function does\r
+    not invoke the va_end macro.\r
+\r
+    @param[in]  Stream    The input stream.\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[in]  Args      A list of arguments, initialized by the va_start macro\r
+                          and accessed using the va_arg macro, used to satisfy\r
+                          the directives in the Format string.\r
+\r
+    @return   The vfwscanf function returns the value of the macro EOF if an\r
+              input failure occurs before any conversion. Otherwise, the\r
+              vfwscanf function returns the number of input items assigned,\r
+              which can be fewer than provided for, or even zero, in the event\r
+              of an early matching failure.\r
 **/\r
-int vfwscanf(FILE * __restrict stream, const wchar_t * __restrict format, va_list arg);\r
-\r
-/**\r
+int vfwscanf(FILE * __restrict Stream, const wchar_t * __restrict Format, va_list Args);\r
+\r
+/** Formatted print, to a buffer, from an argument list.\r
+\r
+    The vswprintf function is equivalent to swprintf, with the variable\r
+    argument list replaced by Args, which must have been initialized by the\r
+    va_start macro (and possibly subsequent va_arg calls). The vswprintf\r
+    function does not invoke the va_end macro.\r
+\r
+    @param[in]  S         A pointer to the array to receive the formatted output.\r
+    @param[in]  N         Maximum number of characters to write into array S.\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[in]  Args      A list of arguments, initialized by the va_start macro\r
+                          and accessed using the va_arg macro, used to satisfy\r
+                          the directives in the Format string.\r
+\r
+    @return   The vswprintf function returns the number of wide characters\r
+              written in the array, not counting the terminating null wide\r
+              character, or a neg ative value if an encoding error occurred or\r
+              if n or more wide characters were requested to be generated.\r
 **/\r
-int vswprintf(wchar_t * __restrict s, size_t n, const wchar_t * __restrict format, va_list arg);\r
-\r
-/**\r
+int vswprintf(wchar_t * __restrict S, size_t N, const wchar_t * __restrict Format, va_list Args);\r
+\r
+/** Formatted input from a string, using an argument list.\r
+\r
+    The vswscanf function is equivalent to swscanf, with the variable argument\r
+    list replaced by Args, which must have been initialized by the va_start\r
+    macro. The vswscanf function does not invoke the va_end macro.\r
+\r
+    @param[in]  S         Pointer to the string from which to obtain input.\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[out] Args      A list of arguments, initialized by the va_start macro\r
+                          and accessed using the va_arg macro, used to satisfy\r
+                          the directives in the Format string.\r
+\r
+    @return   The vswscanf function returns the value of the macro EOF if an\r
+              input failure occurs before any conversion. Otherwise, the\r
+              vswscanf function returns the number of input items assigned,\r
+              which can be fewer than provided for, or even zero, in the event\r
+              of an early matching failure.\r
 **/\r
-int vswscanf(const wchar_t * __restrict s, const wchar_t * __restrict format, va_list arg);\r
+int vswscanf(const wchar_t * __restrict S, const wchar_t * __restrict Format, va_list Args);\r
 \r
-/**\r
-**/\r
-int vwprintf(const wchar_t * __restrict format, va_list arg);\r
+/** Formatted print, to stdout, from an argument list.\r
 \r
-/**\r
+    The vwprintf function is equivalent to wprintf, with the variable argument\r
+    list replaced by Args, which must have been initialized by the va_start\r
+    macro. The vwprintf function does not invoke the va_end macro.\r
+\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[out] Args      A list of arguments, initialized by the va_start macro\r
+                          and accessed using the va_arg macro, used to satisfy\r
+                          the directives in the Format string.\r
+\r
+    @return   The vwprintf function returns the number of wide characters\r
+              transmitted, or a negative value if an output or encoding error\r
+              occurred.\r
+**/\r
+int vwprintf(const wchar_t * __restrict Format, va_list Args);\r
+\r
+/** Formatted input, from stdin, to an argument list.\r
+\r
+    The vwscanf function is equivalent to wscanf, with the variable argument\r
+    list replaced by arg, which shall have been initialized by the va_start\r
+    macro. The vwscanf function does not invoke the va_end macro.\r
+\r
+    @param[in]  Format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param[out] Args      A list of arguments, initialized by the va_start macro\r
+                          and accessed using the va_arg macro, used to satisfy\r
+                          the directives in the Format string.\r
+\r
+    @return   The vwscanf function returns the value of the macro EOF if an\r
+              input failure occurs before any conversion. Otherwise, the\r
+              vwscanf function returns the number of input items assigned,\r
+              which can be fewer than provided for, or even zero, in the event\r
+              of an early matching failure.\r
 **/\r
-int vwscanf(const wchar_t * __restrict format, va_list arg);\r
+int vwscanf(const wchar_t * __restrict Format, va_list Args);\r
 \r
-/**\r
+/** Formatted print to stdout.\r
+\r
+    The wprintf function is equivalent to fwprintf with the argument stdout\r
+    specifying the output stream.\r
+\r
+    @param[in]  format    A wide character sequence containing characters\r
+                          to be copied unchanged, and conversion specifiers\r
+                          which convert their associated arguments.\r
+    @param      ...       Variable number of parameters as required by format.\r
+\r
+    @return   The wprintf function returns the number of wide characters\r
+              transmitted, or a negative value if an output or encoding error\r
+              occurred.\r
 **/\r
-int wprintf(const wchar_t * __restrict format, ...);\r
+int wprintf(const wchar_t * __restrict Format, ...);\r
 \r
-/**\r
+/** Formatted input from stdin.\r
+\r
+    The wscanf function is equivalent to fwscanf with the argument stdin\r
+    specifying the input stream.\r
+\r
+    @param[in]  format    A wide character sequence containing characters\r
+                          to be matched against, and conversion specifiers\r
+                          which convert their associated arguments.  Converted\r
+                          items are stored according to their associated arguments.\r
+    @param      ...       Variable number of parameters, as required by format,\r
+                          specifying the objects to receive the converted input.\r
+\r
+    @return   The wscanf function returns the value of the macro EOF if an\r
+              input failure occurs before any conversion. Otherwise, the\r
+              wscanf function returns the number of input items assigned,\r
+              which can be fewer than provided for, or even zero, in the event\r
+              of an early matching failure.\r
 **/\r
 int wscanf(const wchar_t * __restrict format, ...);\r
 \r
 /* ###################  Input/Output Functions  ########################### */\r
 \r
 \r
-/**\r
-**/\r
-wint_t fgetwc(FILE *stream);\r
+/** Get a character from an input Stream.\r
 \r
-/**\r
+If the end-of-file indicator for the input stream pointed to by stream is not set and a\r
+next wide character is present, the fgetwc function obtains that wide character as a\r
+wchar_t converted to a wint_t and advances the associated file position indicator for\r
+the stream (if defined).\r
+\r
+    @param[in]  Stream    An input stream from which to obtain a character.\r
+\r
+    @return   If the end-of-file indicator for the stream is set, or if the stream is at end-of-file, the endof-\r
+file indicator for the stream is set and the fgetwc function returns WEOF. Otherwise,\r
+the fgetwc function returns the next wide character from the input stream pointed to by\r
+stream. If a read error occurs, the error indicator for the stream is set and the fgetwc\r
+function returns WEOF. If an encoding error occurs (including too few bytes), the value of\r
+the macro EILSEQ is stored in errno and the fgetwc function returns WEOF.\r
 **/\r
-wchar_t *fgetws(wchar_t * __restrict s, int n, FILE * __restrict stream);\r
+wint_t fgetwc(FILE *Stream);\r
+\r
+/** Read a string from an input stream into a buffer.\r
+\r
+    The fgetws function reads at most one less than the number of\r
+    wide characters specified by n from the stream pointed to by\r
+    stream into the array pointed to by s. No additional wide\r
+    characters are read after a new-line wide character (which is\r
+    retained) or after end-of-file. A null wide character is written\r
+    immediately after the last wide character read into the array.\r
+\r
+    @param[out] S         A pointer to the array to receive the input string.\r
+    @param[in]  Limit     The maximum number of characters to put into Buff,\r
+                          including the terminating null character.\r
+    @param[in]  Stream    An input stream from which to obtain a character.\r
+\r
+    @return   The fgetws function returns S if successful. If end-of-file is\r
+              encountered and no characters have been read into the array, the\r
+              contents of the array remain unchanged and a null pointer is\r
+              returned. If a read or encoding error occurs during the\r
+              operation, the array contents are indeterminate and a\r
+              null pointer is returned.\r
+**/\r
+wchar_t *fgetws(wchar_t * __restrict S, int Limit, FILE * __restrict Stream);\r
 \r
-/**\r
+/** Write a character to an output stream.\r
+\r
+The fputwc function writes the wide character specified by c to the output stream\r
+pointed to by stream, at the position indicated by the associated file position indicator\r
+for the stream (if defined), and advances the indicator appropriately. If the file cannot\r
+support positioning requests, or if the stream was opened with append mode, the\r
+character is appended to the output stream.\r
+\r
+    @param[in]  C       The character to be written to Stream.\r
+    @param[in]  Stream  The output stream that C is to be written to.\r
+\r
+    @return   The fputwc function returns the wide character written. If a write error occurs, the\r
+error indicator for the stream is set and fputwc returns WEOF. If an encoding error\r
+occurs, the value of the macro EILSEQ is stored in errno and fputwc returns WEOF.\r
 **/\r
-wint_t fputwc(wchar_t c, FILE *stream);\r
+wint_t fputwc(wchar_t C, FILE *Stream);\r
 \r
-/**\r
+/** Write a string to an output stream.\r
+\r
+The fputws function writes the wide string pointed to by S to the stream pointed to by\r
+Stream. The terminating null wide character is not written.\r
+\r
+    @param[in]  String  The character string to be written to Stream.\r
+    @param[in]  Stream  The output stream that String is to be written to.\r
+\r
+    @return   The fputws function returns EOF if a write or encoding error occurs; otherwise, it\r
+returns a nonnegative value.\r
 **/\r
-int fputws(const wchar_t * __restrict s, FILE * __restrict stream);\r
+int fputws(const wchar_t * __restrict S, FILE * __restrict Stream);\r
 \r
-/**\r
+/** Query or set a stream's orientation.\r
+\r
+The fwide function determines the orientation of the stream pointed to by stream. If\r
+Mode is greater than zero, the function first attempts to make the stream wide oriented. If\r
+Mode is less than zero, the function first attempts to make the stream byte oriented.\r
+Otherwise, Mode is zero and the function does not alter the orientation of the stream.\r
+\r
+    @param[in]  Stream    The stream to be queried.\r
+    @param[in]  Mode      Control value selecting between quering or setting\r
+                          the Stream's orientation.\r
+    @return   The fwide function returns a value greater than zero if, after the call, the stream has\r
+wide orientation, a value less than zero if the stream has byte orientation, or zero if the\r
+stream has no orientation.\r
 **/\r
-int fwide(FILE *stream, int mode);\r
+int fwide(FILE *Stream, int Mode);\r
 \r
-/**\r
+/** Get a character from an input stream.\r
+\r
+The getwc function is equivalent to fgetwc, except that if it is implemented as a\r
+macro, it may evaluate Stream more than once, so the argument should never be an\r
+expression with side effects.\r
+\r
+    @param[in]  Stream    The stream to be read.\r
+\r
+    @return   The getwc function returns the next wide character from the input stream pointed to by\r
+stream, or WEOF.\r
 **/\r
-wint_t getwc(FILE *stream);\r
+wint_t getwc(FILE *Stream);\r
 \r
-/**\r
+/** Get a character from stdin.\r
+\r
+    The getwchar function is equivalent to getwc with the argument stdin.\r
+\r
+    @return   The getwchar function returns the next wide character from the\r
+              input stream pointed to by stdin, or WEOF.\r
 **/\r
 wint_t getwchar(void);\r
 \r
-/**\r
-**/\r
-wint_t putwc(wchar_t c, FILE *stream);\r
+/** Write a character to an output stream.\r
 \r
-/**\r
-**/\r
-wint_t putwchar(wchar_t c);\r
+The putwc function is equivalent to fputwc, except that if it is implemented as a\r
+macro, it may evaluate Stream more than once, so the Stream argument should never be an\r
+expression with side effects.\r
 \r
-/**\r
+    @param[in]  C       The wide character to be written to Stream.\r
+    @param[in]  Stream  The output stream that C is to be written to.\r
+\r
+    @return   The putwc function returns the wide character written, or WEOF.\r
 **/\r
-wint_t ungetwc(wint_t c, FILE *stream);\r
+wint_t putwc(wchar_t C, FILE *Stream);\r
 \r
-/* ###################  Numeric Conversions     ########################### */\r
+/** Write a character to stdout.\r
 \r
-/**\r
-**/\r
-double wcstod(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr);\r
+The putwchar function is equivalent to putwc with the second argument stdout.\r
 \r
-/**\r
-**/\r
-float wcstof(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr);\r
+    @param[in]  C       The wide character to be written to stdout.\r
 \r
-/**\r
+    @return   The putwchar function returns the character written, or WEOF.\r
 **/\r
-long double wcstold(const wchar_t * __restrict nptr, wchar_t ** __restrict endptr);\r
-\r
-/**\r
+wint_t putwchar(wchar_t C);\r
+\r
+/** Return a character to the input Stream as if it had not been read.\r
+\r
+The ungetwc function pushes the wide character specified by C back onto the input\r
+stream pointed to by Stream. Pushed-back wide characters will be returned by\r
+subsequent reads on that stream in the reverse order of their pushing. A successful\r
+intervening call (with the stream pointed to by Stream) to a file positioning function\r
+(fseek, fsetpos, or rewind) discards any pushed-back wide characters for the\r
+stream. The external storage corresponding to the stream is unchanged.\r
+\r
+One wide character of pushback is guaranteed, even if the call to the ungetwc function\r
+follows just after a call to a formatted wide character input function fwscanf,\r
+vfwscanf, vwscanf, or wscanf. If the ungetwc function is called too many times\r
+on the same stream without an intervening read or file positioning operation on that\r
+stream, the operation may fail.\r
+\r
+If the value of C equals that of the macro WEOF, the operation fails and the input stream is\r
+unchanged.\r
+\r
+A successful call to the ungetwc function clears the end-of-file indicator for the stream.\r
+The value of the file position indicator for the stream after reading or discarding all\r
+pushed-back wide characters is the same as it was before the wide characters were pushed\r
+back. For a text or binary stream, the value of its file position indicator after a successful\r
+call to the ungetwc function is unspecified until all pushed-back wide characters are\r
+read or discarded.\r
+\r
+    @param[in]  C       The wide character to push back onto the Stream.\r
+    @param[in]  Stream  The output stream that C is to be pushed back onto.\r
+\r
+    @return   The ungetwc function returns the character pushed back,\r
+              or WEOF if the operation fails.\r
 **/\r
-long int wcstol( const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base);\r
+wint_t ungetwc(wint_t C, FILE *Stream);\r
 \r
-/**\r
-**/\r
-long long int wcstoll( const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base);\r
+/* ###################  Numeric Conversions     ########################### */\r
 \r
-/**\r
+/** @{\r
+The wcstod, wcstof, and wcstold functions convert the initial portion of the wide\r
+string pointed to by nptr to double, float, and long double representation,\r
+respectively. First, they decompose the input string into three parts: an initial, possibly\r
+empty, sequence of white-space wide characters (as specified by the iswspace\r
+function), a subject sequence resembling a floating-point constant or representing an\r
+infinity or NaN; and a final wide string of one or more unrecognized wide characters,\r
+including the terminating null wide character of the input wide string. Then, they attempt\r
+to convert the subject sequence to a floating-point number, and return the result.\r
+\r
+    @param[in]  Nptr    Pointer to the string to convert to a floating-point value.\r
+    @param[in]  EndPtr  Optional pointer to an object in which to store a pointer\r
+                        to the final wide string.\r
+\r
+The functions return the converted value, if any. If no conversion could be performed,\r
+zero is returned. If the correct value is outside the range of representable values, plus or\r
+minus HUGE_VAL, HUGE_VALF, or HUGE_VALL is returned (according to the return\r
+type and sign of the value), and the value of the macro ERANGE is stored in errno. If\r
+the result underflows (7.12.1), the functions return a value whose magnitude is no greater\r
+than the smallest normalized positive number in the return type. A pointer to the\r
+final wide string is stored in the object pointed to by endptr, provided that endptr is\r
+not a null pointer.\r
 **/\r
-unsigned long int wcstoul( const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base);\r
-\r
-/**\r
+double      wcstod  (const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr);\r
+float       wcstof  (const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr);\r
+long double wcstold (const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr);\r
+/*@}*/\r
+\r
+/** @{\r
+The wcstol, wcstoll, wcstoul, and wcstoull functions convert the initial\r
+portion of the wide string pointed to by nptr to long int, long long int,\r
+unsigned long int, and unsigned long long int representation,\r
+respectively. First, they decompose the input string into three parts: an initial, possibly\r
+empty, sequence of white-space wide characters (as specified by the iswspace\r
+function), a subject sequence resembling an integer represented in some radix determined\r
+by the value of base, and a final wide string of one or more unrecognized wide\r
+characters, including the terminating null wide character of the input wide string. Then,\r
+they attempt to convert the subject sequence to an integer, and return the result.\r
+\r
+    @param[in]  Nptr    Pointer to the string to convert to a floating-point value.\r
+    @param[in]  EndPtr  Optional pointer to an object in which to store a pointer\r
+                        to the final wide string.\r
+    @param[in]  Base    Base, 0 to 36, of the value represented by the string\r
+                        pointed to by Nptr.\r
+\r
+    @return   The wcstol, wcstoll, wcstoul, and wcstoull functions return the converted\r
+value, if any. If no conversion could be performed, zero is returned. If the correct value\r
+is outside the range of representable values, LONG_MIN, LONG_MAX, LLONG_MIN,\r
+LLONG_MAX, ULONG_MAX, or ULLONG_MAX is returned (according to the return type\r
+sign of the value, if any), and the value of the macro ERANGE is stored in errno.\r
 **/\r
-unsigned long long int wcstoull( const wchar_t * __restrict nptr, wchar_t ** __restrict endptr, int base);\r
+long int                wcstol  ( const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr, int Base);\r
+long long int           wcstoll ( const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr, int Base);\r
+unsigned long int       wcstoul ( const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr, int Base);\r
+unsigned long long int  wcstoull( const wchar_t * __restrict Nptr, wchar_t ** __restrict EndPtr, int Base);\r
+/*@}*/\r
 \r
 /* #######################  String Copying  ############################### */\r
 \r
-/** The wcscpy function copies the wide string pointed to by s2 (including the\r
-    terminating null wide character) into the array pointed to by s1.\r
+/** The wcscpy function copies the wide string pointed to by Src (including the\r
+    terminating null wide character) into the array pointed to by Dest.\r
 \r
-    @return   The wcscpy function returns the value of s1.\r
+    @return   The wcscpy function returns the value of Dest.\r
 **/\r
-wchar_t *wcscpy(wchar_t * __restrict s1, const wchar_t * __restrict s2);\r
+wchar_t *wcscpy(wchar_t * __restrict Dest, const wchar_t * __restrict Src);\r
 \r
 /** The wcsncpy function copies not more than n wide characters (those that\r
     follow a null wide character are not copied) from the array pointed to by\r
-    s2 to the array pointed to by s1.\r
+    Src to the array pointed to by Dest.\r
 \r
-    If the array pointed to by s2 is a wide string that is shorter than n wide\r
+    If the array pointed to by Src is a wide string that is shorter than n wide\r
     characters, null wide characters are appended to the copy in the array\r
-    pointed to by s1, until n wide characters in all have been written.\r
+    pointed to by Dest, until n wide characters in all have been written.\r
 \r
-    @return   The wcsncpy function returns the value of s1.\r
+    @return   The wcsncpy function returns the value of Dest.\r
 **/\r
-wchar_t *wcsncpy(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n);\r
+wchar_t *wcsncpy(wchar_t * __restrict Dest, const wchar_t * __restrict Src, size_t n);\r
 \r
 /** The wmemcpy function copies n wide characters from the object pointed to by\r
-    s2 to the object pointed to by s1.\r
+    Src to the object pointed to by Dest.\r
 \r
-    Use this function if you know that s1 and s2 DO NOT Overlap.  Otherwise,\r
+    Use this function if you know that Dest and Src DO NOT Overlap.  Otherwise,\r
     use wmemmove.\r
 \r
-    @return   The wmemcpy function returns the value of s1.\r
+    @return   The wmemcpy function returns the value of Dest.\r
 **/\r
-wchar_t *wmemcpy(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n);\r
+wchar_t *wmemcpy(wchar_t * __restrict Dest, const wchar_t * __restrict Src, size_t n);\r
 \r
 /** The wmemmove function copies n wide characters from the object pointed to by\r
-    s2 to the object pointed to by s1. The objects pointed to by s1 and s2 are\r
+    Src to the object pointed to by Dest. The objects pointed to by Dest and Src are\r
     allowed to overlap.\r
 \r
     Because the UEFI BaseMemoryLib function CopyMem explicitly handles\r
@@ -286,33 +1147,33 @@ wchar_t *wmemcpy(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t
     implemented identically.\r
 \r
     For programming clarity, it is recommended that you use wmemcpy if you know\r
-    that s1 and s2 DO NOT Overlap.  If s1 and s2 might possibly overlap, then\r
+    that Dest and Src DO NOT Overlap.  If Dest and Src might possibly overlap, then\r
     use wmemmove.\r
 \r
-    @return   The wmemmove function returns the value of s1.\r
+    @return   The wmemmove function returns the value of Dest.\r
 **/\r
-wchar_t *wmemmove(wchar_t *s1, const wchar_t *s2, size_t n);\r
+wchar_t *wmemmove(wchar_t *Dest, const wchar_t *Src, size_t n);\r
 \r
 /* ###################  String Concatenation     ########################## */\r
 \r
-/** The wcscat function appends a copy of the wide string pointed to by s2\r
+/** The wcscat function appends a copy of the wide string pointed to by Src\r
     (including the terminating null wide character) to the end of the wide\r
-    string pointed to by s1. The initial wide character of s2 overwrites the\r
-    null wide character at the end of s1.\r
+    string pointed to by Dest. The initial wide character of Src overwrites the\r
+    null wide character at the end of Dest.\r
 \r
-    @return   The wcscat function returns the value of s1.\r
+    @return   The wcscat function returns the value of Dest.\r
 **/\r
-wchar_t *wcscat(wchar_t * __restrict s1, const wchar_t * __restrict s2);\r
+wchar_t *wcscat(wchar_t * __restrict Dest, const wchar_t * __restrict Src);\r
 \r
 /** The wcsncat function appends not more than n wide characters (a null wide\r
     character and those that follow it are not appended) from the array pointed\r
-    to by s2 to the end of the wide string pointed to by s1. The initial wide\r
-    character of s2 overwrites the null wide character at the end of s1.\r
+    to by Src to the end of the wide string pointed to by Dest. The initial wide\r
+    character of Src overwrites the null wide character at the end of Dest.\r
     A terminating null wide character is always appended to the result.\r
 \r
-    @return   The wcsncat function returns the value of s1.\r
+    @return   The wcsncat function returns the value of Dest.\r
 **/\r
-wchar_t *wcsncat(wchar_t * __restrict s1, const wchar_t * __restrict s2, size_t n);\r
+wchar_t *wcsncat(wchar_t * __restrict Dest, const wchar_t * __restrict Src, size_t n);\r
 \r
 /* #####################  String Comparison   ############################# */\r
 \r
@@ -377,15 +1238,15 @@ int wmemcmp(const wchar_t *s1, const wchar_t *s2, size_t n);
 \r
 /* #####################  String Searching   ############################## */\r
 \r
-/** The wcschr function locates the first occurrence of c in the wide string\r
-    pointed to by s.  The terminating null wide character is considered to be\r
+/** The wcschr function locates the first occurrence of C in the wide string\r
+    pointed to by S.  The terminating null wide character is considered to be\r
     part of the wide string.\r
 \r
     @return   The wcschr function returns a pointer to the located wide\r
               character, or a null pointer if the wide character does not occur\r
               in the wide string.\r
 **/\r
-wchar_t *wcschr(const wchar_t *s, wchar_t c);\r
+wchar_t *wcschr(const wchar_t *S, wchar_t C);\r
 \r
 /** The wcscspn function computes the length of the maximum initial segment of\r
     the wide string pointed to by s1 which consists entirely of wide characters\r
@@ -405,14 +1266,14 @@ size_t wcscspn(const wchar_t *s1, const wchar_t *s2);
 **/\r
 wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2);\r
 \r
-/** The wcsrchr function locates the last occurrence of c in the wide string\r
-    pointed to by s. The terminating null wide character is considered to be\r
+/** The wcsrchr function locates the last occurrence of C in the wide string\r
+    pointed to by S. The terminating null wide character is considered to be\r
     part of the wide string.\r
 \r
     @return   The wcsrchr function returns a pointer to the wide character,\r
-              or a null pointer if c does not occur in the wide string.\r
+              or a null pointer if C does not occur in the wide string.\r
 **/\r
-wchar_t *wcsrchr(const wchar_t *s, wchar_t c);\r
+wchar_t *wcsrchr(const wchar_t *S, wchar_t C);\r
 \r
 /** The wcsspn function computes the length of the maximum initial segment of\r
     the wide string pointed to by s1 which consists entirely of wide characters\r
@@ -469,53 +1330,72 @@ wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2);
 **/\r
 wchar_t *wcstok(wchar_t * __restrict s1, const wchar_t * __restrict s2, wchar_t ** __restrict ptr);\r
 \r
-/** The wmemchr function locates the first occurrence of c in the initial n\r
-    wide characters of the object pointed to by s.\r
+/** The wmemchr function locates the first occurrence of C in the initial n\r
+    wide characters of the object pointed to by S.\r
 \r
     @return   The wmemchr function returns a pointer to the located wide\r
               character, or a null pointer if the wide character does not occur\r
               in the object.\r
 **/\r
-wchar_t *wmemchr(const wchar_t *s, wchar_t c, size_t n);\r
+wchar_t *wmemchr(const wchar_t *S, wchar_t C, size_t n);\r
 \r
 /* ###################  String Manipulation   ############################# */\r
 \r
-/** The wcslen function computes the length of the wide string pointed to by s.\r
+/** The wcslen function computes the length of the wide string pointed to by S.\r
 \r
     @return   The wcslen function returns the number of wide characters that\r
               precede the terminating null wide character.\r
 **/\r
-size_t wcslen(const wchar_t *s);\r
+size_t wcslen(const wchar_t *S);\r
 \r
-/** The wmemset function copies the value of c into each of the first n wide\r
-    characters of the object pointed to by s.\r
+/** The wmemset function copies the value of C into each of the first n wide\r
+    characters of the object pointed to by S.\r
 \r
-    @return   The wmemset function returns the value of s.\r
+    @return   The wmemset function returns the value of S.\r
 **/\r
-wchar_t *wmemset(wchar_t *s, wchar_t c, size_t n);\r
+wchar_t *wmemset(wchar_t *S, wchar_t C, size_t n);\r
 \r
 /* #################  Date and Time Conversion  ########################### */\r
 \r
 /**\r
+The wcsftime function is equivalent to the strftime function, except that:\r
+  - The argument s points to the initial element of an array of wide characters into which\r
+the generated output is to be placed.\r
+  - The argument maxsize indicates the limiting number of wide characters.\r
+  - The argument format is a wide string and the conversion specifiers are replaced by\r
+corresponding sequences of wide characters.\r
+  - The return value indicates the number of wide characters.\r
+\r
+If the total number of resulting wide characters including the terminating null wide\r
+character is not more than maxsize, the wcsftime function returns the number of\r
+wide characters placed into the array pointed to by s not including the terminating null\r
+wide character. Otherwise, zero is returned and the contents of the array are\r
+indeterminate.\r
 **/\r
-size_t wcsftime(wchar_t * __restrict s, size_t maxsize, const wchar_t * __restrict format, const struct tm * __restrict timeptr);\r
+size_t wcsftime(wchar_t * __restrict S, size_t maxsize, const wchar_t * __restrict format, const struct tm * __restrict timeptr);\r
 \r
 /* #############  Multibyte <--> Wide Character Conversion  ############### */\r
 \r
-/**\r
+/** The btowc function determines whether C constitutes a valid single-byte\r
+    character in the initial shift state.\r
+\r
+    @return   The btowc function returns WEOF if c has the value EOF or if\r
+              (unsigned char)C does not constitute a valid single-byte\r
+              character in the initial shift state. Otherwise, it returns the\r
+              wide character representation of that character.\r
 **/\r
-wint_t btowc(int c);\r
+wint_t btowc(int C);\r
 \r
-/** The wctob function determines whether c corresponds to a member of the extended\r
+/** The wctob function determines whether C corresponds to a member of the extended\r
     character set whose multibyte character representation is a single byte when in the initial\r
     shift state.\r
 \r
-    @return     The wctob function returns EOF if c does not correspond to a multibyte\r
+    @return     The wctob function returns EOF if C does not correspond to a multibyte\r
                 character with length one in the initial shift state. Otherwise, it\r
                 returns the single-byte representation of that character as an\r
                 unsigned char converted to an int.\r
 **/\r
-int wctob(wint_t c);\r
+int wctob(wint_t C);\r
 \r
 /** If ps is not a null pointer, the mbsinit function determines whether the\r
     pointed-to mbstate_t object describes an initial conversion state.\r
@@ -528,19 +1408,98 @@ int mbsinit(const mbstate_t *ps);
 \r
 /* #######  Restartable Multibyte <--> Wide Character Conversion  ######### */\r
 \r
-/**\r
+/** The mbrlen function is equivalent to the call:<BR>\r
+@verbatim\r
+    mbrtowc(NULL, s, n, ps != NULL ? ps : &internal)\r
+@endverbatim\r
+    where internal is the mbstate_t object for the mbrlen function, except that\r
+    the expression designated by ps is evaluated only once.\r
+\r
+    @return   The mbrlen function returns a value between zero and n,\r
+              inclusive, (size_t)(-2), or (size_t)(-1).\r
 **/\r
-size_t mbrlen(const char * __restrict s, size_t n, mbstate_t * __restrict ps);\r
+size_t mbrlen(const char * __restrict S, size_t n, mbstate_t * __restrict ps);\r
 \r
 /**\r
+If S is a null pointer, the mbrtowc function is equivalent to the call:<BR>\r
+@verbatim\r
+        mbrtowc(NULL, "", 1, ps)\r
+@endverbatim\r
+\r
+In this case, the values of the parameters pwc and n are ignored.\r
+\r
+If S is not a null pointer, the mbrtowc function inspects at most n bytes beginning with\r
+the byte pointed to by S to determine the number of bytes needed to complete the next\r
+multibyte character (including any shift sequences). If the function determines that the\r
+next multibyte character is complete and valid, it determines the value of the\r
+corresponding wide character and then, if pwc is not a null pointer, stores that value in\r
+the object pointed to by pwc. If the corresponding wide character is the null wide\r
+character, the resulting state described is the initial conversion state.\r
+\r
+    @retval   0             if the next n or fewer bytes complete the multibyte\r
+                            character that corresponds to the null wide\r
+                            character (which is the value stored).\r
+    @retval   between_1_and_n_inclusive   if the next n or fewer bytes complete\r
+                            a valid multibyte character (which is the value\r
+                            stored); the value returned is the number of bytes\r
+                            that complete the multibyte character.\r
+    @retval   (size_t)(-2)  if the next n bytes contribute to an incomplete\r
+                            (but potentially valid) multibyte character, and\r
+                            all n bytes have been processed (no value is stored).\r
+    @retval   (size_t)(-1)  if an encoding error occurs, in which case the next\r
+                            n or fewer bytes do not contribute to a complete and\r
+                            valid multibyte character (no value is stored); the\r
+                            value of the macro EILSEQ is stored in errno, and\r
+                            the conversion state is unspecified.\r
 **/\r
-size_t mbrtowc(wchar_t * __restrict pwc, const char * __restrict s, size_t n, mbstate_t * __restrict ps);\r
+size_t mbrtowc(wchar_t * __restrict pwc, const char * __restrict S, size_t n, mbstate_t * __restrict ps);\r
 \r
 /**\r
+If S is a null pointer, the wcrtomb function is equivalent to the call:<BR>\r
+@verbatim\r
+        wcrtomb(buf, L'\0', ps)\r
+@endverbatim\r
+where buf is an internal buffer.\r
+\r
+If S is not a null pointer, the wcrtomb function determines the number of bytes needed\r
+to represent the multibyte character that corresponds to the wide character given by wc\r
+(including any shift sequences), and stores the multibyte character representation in the\r
+array whose first element is pointed to by S. At most MB_CUR_MAX bytes are stored. If\r
+wc is a null wide character, a null byte is stored, preceded by any shift sequence needed\r
+to restore the initial shift state; the resulting state described is the initial conversion state.\r
+\r
+    @return   The wcrtomb function returns the number of bytes stored in the\r
+              array object (including any shift sequences). When wc is not a\r
+              valid wide character, an encoding error occurs: the function\r
+              stores the value of the macro EILSEQ in errno and\r
+              returns (size_t)(-1); the conversion state is unspecified.\r
 **/\r
-size_t wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps);\r
+size_t wcrtomb(char * __restrict S, wchar_t wc, mbstate_t * __restrict ps);\r
 \r
 /**\r
+The mbsrtowcs function converts a sequence of multibyte characters that begins in the\r
+conversion state described by the object pointed to by ps, from the array indirectly\r
+pointed to by src into a sequence of corresponding wide characters. If dst is not a null\r
+pointer, the converted characters are stored into the array pointed to by dst. Conversion\r
+continues up to and including a terminating null character, which is also stored.\r
+Conversion stops earlier in two cases: when a sequence of bytes is encountered that does\r
+not form a valid multibyte character, or (if dst is not a null pointer) when len wide\r
+characters have been stored into the array pointed to by dst. Each conversion takes\r
+place as if by a call to the mbrtowc function.\r
+\r
+If dst is not a null pointer, the pointer object pointed to by src is assigned either a null\r
+pointer (if conversion stopped due to reaching a terminating null character) or the address\r
+just past the last multibyte character converted (if any). If conversion stopped due to\r
+reaching a terminating null character and if dst is not a null pointer, the resulting state\r
+described is the initial conversion state.\r
+\r
+    @return   If the input conversion encounters a sequence of bytes that do\r
+              not form a valid multibyte character, an encoding error occurs:\r
+              the mbsrtowcs function stores the value of the macro EILSEQ in\r
+              errno and returns (size_t)(-1); the conversion state is\r
+              unspecified. Otherwise, it returns the number of multibyte\r
+              characters successfully converted, not including the terminating\r
+              null character (if any).\r
 **/\r
 size_t mbsrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t len, mbstate_t * __restrict ps);\r
 \r
index 3df726a353dec6e09a4f5efc8e30e06e33b18ce6..eac084cbc3ce09df0483043f19587aa0bc5d6ad2 100644 (file)
@@ -1,5 +1,46 @@
 /** @file\r
-    Wide character classification functions and macros.\r
+    Wide character classification and mapping utilities.\r
+\r
+    The following macros are defined in this file:<BR>\r
+@verbatim\r
+      WEOF        Wide char version of end-of-file.\r
+@endverbatim\r
+\r
+    The following types are defined in this file:<BR>\r
+@verbatim\r
+      wint_t      Type capable of holding all wchar_t values and WEOF.\r
+      wctrans_t   A type for holding locale-specific character mappings.\r
+      wctype_t    Type for holding locale-specific character classifications.\r
+@endverbatim\r
+\r
+    The following functions are declared in this file:<BR>\r
+@verbatim\r
+      ###############  Wide Character Classification Functions\r
+      int           iswalnum  (wint_t);\r
+      int           iswalpha  (wint_t);\r
+      int           iswcntrl  (wint_t);\r
+      int           iswdigit  (wint_t);\r
+      int           iswgraph  (wint_t);\r
+      int           iswlower  (wint_t);\r
+      int           iswprint  (wint_t);\r
+      int           iswpunct  (wint_t);\r
+      int           iswblank  (wint_t);\r
+      int           iswspace  (wint_t);\r
+      int           iswupper  (wint_t);\r
+      int           iswxdigit (wint_t);\r
+\r
+      ###############  Extensible Wide Character Classification Functions\r
+      wctype_t      wctype    (const char *);\r
+      int           iswctype  (wint_t, wctype_t);\r
+\r
+      ###############  Wide Character Case Mapping Utilities\r
+      wint_t        towlower  (wint_t);\r
+      wint_t        towupper  (wint_t);\r
+\r
+      ###############  Extensible Wide Character Case Mapping Utilities\r
+      wctrans_t     wctrans   (const char *);\r
+      wint_t        towctrans (wint_t, wctrans_t);\r
+@endverbatim\r
 \r
     Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made available under\r
 #include  <machine/ansi.h>\r
 \r
 #ifdef _EFI_WINT_T\r
+  /** wint_t is an integer type unchanged by default argument promotions that can\r
+      hold any value corresponding to members of the extended character set, as\r
+      well as at least one value that does not correspond to any member of the\r
+      extended character set: WEOF.\r
+  */\r
   typedef _EFI_WINT_T  wint_t;\r
   #undef _BSD_WINT_T_\r
   #undef _EFI_WINT_T\r
 #endif\r
 \r
 #ifdef  _BSD_WCTRANS_T_\r
-typedef wint_t (*wctrans_t)(wint_t);\r
-#undef  _BSD_WCTRANS_T_\r
+  /** A scalar type for holding locale-specific character mappings. */\r
+  typedef wint_t (*wctrans_t)(wint_t);\r
+  #undef  _BSD_WCTRANS_T_\r
 #endif\r
 \r
 #ifdef  _BSD_WCTYPE_T_\r
-typedef _BSD_WCTYPE_T_  wctype_t;\r
-#undef  _BSD_WCTYPE_T_\r
+  /** A scalar type capable of holding values representing locale-specific\r
+      character classifications. */\r
+  typedef _BSD_WCTYPE_T_  wctype_t;\r
+  #undef  _BSD_WCTYPE_T_\r
 #endif\r
 \r
 #ifndef WEOF\r
-#define WEOF  ((wint_t)-1)\r
+  /** WEOF expands to a constant expression of type wint_t whose value does not\r
+      correspond to any member of the extended character set. It is accepted\r
+      (and returned) by several functions, declared in this file, to indicate\r
+      end-of-file, that is, no more input from a stream. It is also used as a\r
+      wide character value that does not correspond to any member of the\r
+      extended character set.\r
+  */\r
+  #define WEOF  ((wint_t)-1)\r
 #endif\r
 \r
 __BEGIN_DECLS\r
-int       /*EFIAPI*/ iswalnum(wint_t);\r
-int       /*EFIAPI*/ iswalpha(wint_t);\r
-int       /*EFIAPI*/ iswcntrl(wint_t);\r
-int       /*EFIAPI*/ iswctype(wint_t, wctype_t);\r
-int       /*EFIAPI*/ iswdigit(wint_t);\r
-int       /*EFIAPI*/ iswgraph(wint_t);\r
-int       /*EFIAPI*/ iswlower(wint_t);\r
-int       /*EFIAPI*/ iswprint(wint_t);\r
-int       /*EFIAPI*/ iswpunct(wint_t);\r
-int       /*EFIAPI*/ iswblank(wint_t);\r
-int       /*EFIAPI*/ iswspace(wint_t);\r
-int       /*EFIAPI*/ iswupper(wint_t);\r
-int       /*EFIAPI*/ iswxdigit(wint_t);\r
-wint_t    /*EFIAPI*/ towctrans(wint_t, wctrans_t);\r
-wint_t    /*EFIAPI*/ towlower(wint_t);\r
-wint_t    /*EFIAPI*/ towupper(wint_t);\r
-wctrans_t /*EFIAPI*/ wctrans(const char *);\r
-wctype_t  /*EFIAPI*/ wctype(const char *);\r
+  /** Test for any wide character for which iswalpha or iswdigit is TRUE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswalnum  (wint_t WC);\r
+\r
+  /** Test for any wide character for which iswupper or iswlower is TRUE,\r
+      OR, a locale-specific character where none of iswcntrl, iswdigit,\r
+      iswpunct, or iswspace is TRUE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswalpha  (wint_t WC);\r
+\r
+  /** Test for any wide control character.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswcntrl  (wint_t WC);\r
+\r
+  /** Test if the value of WC is a wide character that corresponds to a decimal digit.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswdigit  (wint_t WC);\r
+\r
+  /** Test for wide characters for which iswprint is TRUE and iswspace is FALSE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswgraph  (wint_t WC);\r
+\r
+  /** The iswlower function tests for any wide character that corresponds to a\r
+      lowercase letter or is one of a locale-specific set of wide characters\r
+      for which none of iswcntrl, iswdigit, iswpunct, or iswspace is TRUE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswlower  (wint_t WC);\r
+\r
+  /** Test for any printing wide character.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswprint  (wint_t WC);\r
+\r
+  /** The iswpunct function tests for any printing wide character that is one\r
+      of a locale-specific set of punctuation wide characters for which\r
+      neither iswspace nor iswalnum is TRUE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswpunct  (wint_t WC);\r
+\r
+  /** Test for standard blank characters or locale-specific characters\r
+      for which iswspace is TRUE and are used to separate words within a line\r
+      of text.  In the "C" locale, iswblank only returns TRUE for the standard\r
+      blank characters space (L' ') and horizontal tab (L'\t').\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswblank  (wint_t WC);\r
+\r
+  /** The iswspace function tests for any wide character that corresponds to a\r
+      locale-specific set of white-space wide characters for which none of\r
+      iswalnum, iswgraph, or iswpunct is TRUE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswspace  (wint_t WC);\r
+\r
+  /** Tests for any wide character that corresponds to an uppercase letter or\r
+      is one of a locale-specific set of wide characters for which none of\r
+      iswcntrl, iswdigit, iswpunct, or iswspace is TRUE.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswupper  (wint_t WC);\r
+\r
+  /** The iswxdigit function tests for any wide character that corresponds to a\r
+      hexadecimal-digit character.\r
+\r
+    @param[in]  WC    The wide character to be classified.\r
+\r
+    @return   Returns non-zero (TRUE) if and only if the value of WC conforms\r
+              to the classification described for this function.\r
+  */\r
+  int           iswxdigit (wint_t WC);\r
+\r
+  /** Construct a value that describes a class of wide characters, identified\r
+      by the string pointed to by Desc.  The constructed value is suitable for\r
+      use as the second argument to the iswctype function.\r
+\r
+      The following strings name classes of wide characters that the iswctype\r
+      function is able to test against.  These strings are valid in all locales\r
+      as Desc arguments to wctype().\r
+        - "alnum"\r
+        - "alpha"\r
+        - "blank"\r
+        - "cntrl"\r
+        - "digit"\r
+        - "graph"\r
+        - "lower"\r
+        - "print"\r
+        - "punct"\r
+        - "space"\r
+        - "upper"\r
+        - "xdigit\r
+\r
+    @param[in]  Desc    A pointer to a multibyte character string naming a\r
+                        class of wide characters.\r
+\r
+    @return   If Desc identifies a valid class of wide characters in the\r
+              current locale, the wctype function returns a nonzero value that\r
+              is valid as the second argument to the iswctype function;\r
+              otherwise, it returns zero.\r
+  */\r
+  wctype_t      wctype    (const char *Desc);\r
+\r
+  /** Determine whether the wide character WC has the property described by Wct.\r
+\r
+    @param[in]  WC      The wide character to be classified.\r
+    @param[in]  Wct     A value describing a class of wide characters.\r
+\r
+    @return   The iswctype function returns nonzero (TRUE) if and only if the\r
+              value of the wide character WC has the property described by Wct.\r
+  */\r
+  int           iswctype  (wint_t WC, wctype_t Wct);\r
+\r
+  /** Convert an uppercase letter to a corresponding lowercase letter.\r
+\r
+    @param[in]  WC    The wide character to be converted.\r
+\r
+    @return   If the argument is a wide character for which iswupper is TRUE\r
+              and there are one or more corresponding wide characters, as\r
+              specified by the current locale, for which iswlower is TRUE, the\r
+              towlower function returns one of the corresponding wide\r
+              characters (always the same one for any given locale); otherwise,\r
+              the argument is returned unchanged.\r
+  */\r
+  wint_t        towlower  (wint_t WC);\r
+\r
+  /** Convert a lowercase letter to a corresponding uppercase letter.\r
+\r
+    @param[in]  WC    The wide character to be converted.\r
+\r
+    @return   If the argument is a wide character for which iswlower is TRUE\r
+              and there are one or more corresponding wide characters, as\r
+              specified by the current locale, for which iswupper is TRUE, the\r
+              towupper function returns one of the corresponding wide\r
+              characters (always the same one for any given locale); otherwise,\r
+              the argument is returned unchanged.\r
+  */\r
+  wint_t        towupper  (wint_t WC);\r
+\r
+  /** Construct a value that describes a mapping between wide characters\r
+      identified by the string argument, S.\r
+\r
+      The strings listed below are valid in all locales as the S argument to\r
+      the wctrans function.\r
+        - "tolower"\r
+        - "toupper"\r
+\r
+    @param[in]  S   A pointer to a multibyte character string naming a\r
+                    mapping between wide characters.\r
+\r
+    @return   If S identifies a valid mapping of wide characters in the current\r
+              locale, the wctrans function returns a nonzero value that is\r
+              valid as the second argument to the towctrans function;\r
+              otherwise, it returns zero.\r
+  */\r
+  wctrans_t     wctrans   (const char *S);\r
+\r
+  /** Map the wide character WC using the mapping described by WTr. The current\r
+      locale will be the same as during the call to wctrans that returned\r
+      the value WTr.\r
+\r
+    @param[in]  WC    The wide character to be converted.\r
+    @param[in]  WTr   A value describing a mapping of wide characters in the\r
+                      current locale.\r
+\r
+    @return   Returns the mapped value of WC using the mapping selected by WTr.\r
+  */\r
+  wint_t        towctrans (wint_t WC, wctrans_t WTr);\r
 __END_DECLS\r
 \r
 #endif    /* _WCTYPE_H_ */\r