]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/ctype.h
StdLib: The formatting for double float values, within the gdtoa library, is improper.
[mirror_edk2.git] / StdLib / Include / ctype.h
index 1796b81db7eaef64d49b312062dfcc6d0b112de0..d35367f52055b57eb8d5d04cb5242617029e0493 100644 (file)
@@ -1,5 +1,5 @@
 /** @file\r
-  Single-byte character classification and case conversion macros and\r
+  Single-byte character classification, case conversion macros, and\r
   function declarations.\r
 \r
   The header <ctype.h> declares several functions useful for testing and mapping\r
   default is the "C" locale.\r
 \r
   The term "printing character" refers to a member of a locale-specific\r
-  set of characters, each of which occupies one printing position on a display\r
+  set of characters, each of which occupies at least one printing position on an output\r
   device; the term control character refers to a member of a locale-specific\r
   set of characters that are not printing characters.\r
 \r
-  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials are licensed and made available under\r
   the terms and conditions of the BSD License that accompanies this distribution.\r
   The full text of the license may be found at\r
-  http://opensource.org/licenses/bsd-license.php.\r
+  http://opensource.org/licenses/bsd-license.\r
 \r
   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
 **/\r
 #ifndef _CTYPE_H\r
 #define _CTYPE_H\r
@@ -36,8 +35,10 @@ __BEGIN_DECLS
 /** The isalnum function tests for any character for which isalpha or isdigit\r
     is true.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isalnum(int c);\r
 \r
@@ -47,29 +48,48 @@ int isalnum(int c);
     isspace is true. In the "C" locale, isalpha returns true only for the\r
     characters for which isupper or islower is true.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isalpha(int c);\r
 \r
+/** The isblank function tests that a character is a white-space character that results\r
+    in a number of space (' ') characters being sent to the output device.  In the C locale\r
+    this is either ' ' or '\t'.\r
+\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
+**/\r
+int isblank(int);\r
+\r
 /** The iscntrl function tests for any control character.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int iscntrl(int c);\r
 \r
 /** The isdigit function tests for any decimal-digit character.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isdigit(int c);\r
 \r
 /** The isgraph function tests for any printing character except space (' ').\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isgraph(int c);\r
 \r
@@ -78,15 +98,19 @@ int isgraph(int c);
     isdigit, ispunct, or isspace is true.  In the "C" locale, islower returns\r
     true only for the lowercase letters.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int islower(int c);\r
 \r
 /** The isprint function tests for any printing character including space (' ').\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isprint(int c);\r
 \r
@@ -95,8 +119,10 @@ int isprint(int c);
     isalnum is true. In the "C" locale, ispunct returns true for every printing\r
     character for which neither isspace nor isalnum is true.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int ispunct(int c);\r
 \r
@@ -107,8 +133,10 @@ int ispunct(int c);
     horizontal tab ('\t'), and vertical tab ('\v'). In the "C" locale, isspace\r
     returns true only for the standard white-space characters.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isspace(int c);\r
 \r
@@ -117,29 +145,51 @@ int isspace(int c);
     isdigit, ispunct, or isspace is true. In the "C" locale, isupper returns\r
     true only for the uppercase letters.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isupper(int c);\r
 \r
 /** The isxdigit function tests for any hexadecimal-digit character.\r
 \r
-    @return   Returns nonzero (true) if and only if the value of the argument c\r
-              conforms to that in the description of the function.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isxdigit(int c);\r
 \r
-/** The isascii function tests that a character is one of the 128 ASCII characters.\r
+/** The isascii function tests that a character is one of the 128 7-bit ASCII characters.\r
+    This function is not part of the C standard, but is commonly used.\r
 \r
-  @param[in]  c   The character to test.\r
-  @return     Returns nonzero (true) if c is a valid ASCII character.  Otherwize,\r
-              zero (false) is returned.\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
 **/\r
 int isascii(int c);\r
 \r
+/** Test whether a character is one of the characters used as a separator\r
+    between directory elements in a path.\r
+\r
+    Characters are '/', '\\'\r
+\r
+    This non-standard function is unique to this implementation.\r
+\r
+    @param[in]    c   The character to be tested.\r
+\r
+    @return   Returns nonzero (true) if and only if the value of the parameter c\r
+              can be classified as specified in the description of the function.\r
+**/\r
+int isDirSep(int c);\r
+\r
 /** The tolower function converts an uppercase letter to a corresponding\r
     lowercase letter.\r
 \r
+    @param[in]    c   The character to be converted.\r
+\r
     @return   If the argument is a character for which isupper is true and\r
               there are one or more corresponding characters, as specified by\r
               the current locale, for which islower is true, the tolower\r
@@ -152,6 +202,8 @@ int tolower(int c);
 /** The toupper function converts a lowercase letter to a corresponding\r
     uppercase letter.\r
 \r
+    @param[in]    c   The character to be converted.\r
+\r
     @return   If the argument is a character for which islower is true and\r
               there are one or more corresponding characters, as specified by\r
               the current locale, for which isupper is true, the toupper\r
@@ -161,13 +213,13 @@ int tolower(int c);
 **/\r
 int toupper(int c);\r
 \r
-int isblank(int);\r
-\r
 __END_DECLS\r
 \r
-// Character Classification Macros\r
-// Undefine individually or define NO_CTYPE_MACROS, before including <ctype.h>,\r
-// in order to use the Function version of the character classification macros.\r
+/** Character Classification Macros.\r
+    Undefine individually or define NO_CTYPE_MACROS, before including <ctype.h>,\r
+    in order to use the Function version of the character classification macros.\r
+@{\r
+**/\r
 #ifndef NO_CTYPE_MACROS\r
   #define isalnum(c)    (__isCClass( (int)c, (_CD | _CU | _CL | _XA)))\r
   #define isalpha(c)    (__isCClass( (int)c, (_CU | _CL | _XA)))\r
@@ -180,8 +232,10 @@ __END_DECLS
   #define isspace(c)    (__isCClass( (int)c, (_CW)))\r
   #define isupper(c)    (__isCClass( (int)c, (_CU)))\r
   #define isxdigit(c)   (__isCClass( (int)c, (_CD | _CX)))\r
+  #define isDirSep(c)   (__isCClass( (int)c, (_C0)))\r
   #define tolower(c)    (__toLower((int)c))\r
   #define toupper(c)    (__toUpper((int)c))\r
 #endif  /* NO_CTYPE_MACROS */\r
+///@}\r
 \r
 #endif  /* _CTYPE_H */\r