]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/wchar.h
MdeModulePkg: Fix the build fail issue on VS2008\VS2010\GCC
[mirror_edk2.git] / StdLib / Include / wchar.h
index 7a064ee0b49bcdae7eadb24583212edfe643684f..3acc2a4b8d99e9b268d4697edfc85e89bfa7f555 100644 (file)
               - 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
+    Copyright (c) 2010 - 2014, 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
@@ -257,14 +257,14 @@ struct  tm;
 \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
+      * 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
+      * 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
+      * 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
@@ -274,8 +274,8 @@ struct  tm;
         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
+      * An optional length modifier that specifies the size of the argument.\r
+      * 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
@@ -296,7 +296,7 @@ struct  tm;
           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
+    #     The result is converted to an "alternative form". 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
@@ -384,7 +384,7 @@ struct  tm;
             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
+            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
@@ -913,7 +913,7 @@ wint_t fgetwc(FILE *Stream);
     @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
+    @param[in]  Stream    An input stream from which to obtain the string.\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
@@ -1089,7 +1089,7 @@ by the value of base, and a final wide string of one or more unrecognized wide
 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]  Nptr    Pointer to the string to convert.\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
@@ -1415,12 +1415,18 @@ int mbsinit(const mbstate_t *ps);
     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
+    @param[in]  s     Pointer to a multibyte character sequence.\r
+    @param[in]  n     Maximum number of bytes to examine.\r
+    @param[in]  pS    Pointer to the conversion state object.\r
+\r
+    @retval   0       The next n or fewer characters complete a NUL.\r
+    @retval   1..n    The number of bytes that complete the multibyte character.\r
+    @retval   -2      The next n bytes contribute to an incomplete (but potentially valid) multibyte character.\r
+    @retval   -1      An encoding error occurred.\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
+/** Restartable Multibyte to Wide character conversion.\r
 If S is a null pointer, the mbrtowc function is equivalent to the call:<BR>\r
 @verbatim\r
         mbrtowc(NULL, "", 1, ps)\r
@@ -1476,22 +1482,27 @@ to restore the initial shift state; the resulting state described is the initial
 **/\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
+/** Convert a sequence of multibyte characters into a sequence of wide characters.\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
+    @param[in]    dst   Destination for the Wide character sequence.\r
+    @param[in]    src   Pointer to Pointer to MBCS char. sequence to convert.\r
+    @param[in]    len   Length of dest, in WIDE characters.\r
+    @param[in]    ps    Pointer to the conversion state object to be used for this conversion.\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
@@ -1523,6 +1534,11 @@ size_t mbsrtowcs(wchar_t * __restrict dst, const char ** __restrict src, size_t
     terminating null wide character, the resulting state described is the\r
     initial conversion state.\r
 \r
+    @param[in]    dst   Destination for the MBCS sequence.\r
+    @param[in]    src   Pointer to Pointer to wide char. sequence to convert.\r
+    @param[in]    len   Length of dest, in bytes.\r
+    @param[in]    ps    Pointer to the conversion state object to be used for this conversion.\r
+\r
     @return     If conversion stops because a wide character is reached that\r
                 does not correspond to a valid multibyte character, an\r
                 encoding error occurs: the wcsrtombs function stores the\r