]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Ctype/CConv.c
IntelFspWrapperPkg: Fix typos in comments
[mirror_edk2.git] / StdLib / LibC / Ctype / CConv.c
CommitLineData
2aa62f2b 1/** @file\r
681cc25c 2 Case conversion function implementations for <ctype.h>\r
2aa62f2b 3\r
4 The tolower function converts an uppercase letter to a corresponding\r
5 lowercase letter. If the argument is a character for which isupper\r
6 is true and there are one or more corresponding characters, as\r
7 specified by the current locale, for which islower is true, the tolower\r
8 function returns one of the corresponding characters (always the same one\r
9 for any given locale); otherwise, the argument is returned unchanged.\r
10\r
11 The toupper function converts a lowercase letter to a corresponding\r
12 uppercase letter. If the argument is a character for which islower is true\r
13 and there are one or more corresponding characters, as specified by the\r
14 current locale, for which isupper is true, the toupper function returns one\r
15 of the corresponding characters (always the same one for any given locale);\r
16 otherwise, the argument is returned unchanged.\r
17\r
681cc25c 18 Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
2aa62f2b 19 This program and the accompanying materials are licensed and made available under\r
20 the terms and conditions of the BSD License that accompanies this distribution.\r
21 The full text of the license may be found at\r
681cc25c 22 http://opensource.org/licenses/bsd-license.\r
2aa62f2b 23\r
24 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
25 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
2aa62f2b 26**/\r
27#include <LibConfig.h>\r
28\r
29#define NO_CTYPE_MACROS // So that we don't define the classification macros\r
30#include <ctype.h>\r
31\r
681cc25c 32/** The tolower function converts an uppercase letter to a corresponding\r
33 lowercase letter.\r
34\r
35 @param[in] c The character to be converted.\r
36\r
37 @return If the argument is a character for which isupper is true and\r
38 there are one or more corresponding characters, as specified by\r
39 the current locale, for which islower is true, the tolower\r
40 function returns one of the corresponding characters (always the\r
41 same one for any given locale); otherwise, the argument is\r
42 returned unchanged.\r
43**/\r
2aa62f2b 44int\r
45tolower(\r
681cc25c 46 IN int _c\r
2aa62f2b 47 )\r
48{\r
2aa62f2b 49 return (isupper(_c) ? _lConvT[_c] : _c);\r
50}\r
51\r
681cc25c 52/** The toupper function converts a lowercase letter to a corresponding\r
53 uppercase letter.\r
54\r
55 @param[in] c The character to be converted.\r
56\r
57 @return If the argument is a character for which islower is true and\r
58 there are one or more corresponding characters, as specified by\r
59 the current locale, for which isupper is true, the toupper\r
60 function returns one of the corresponding characters (always the\r
61 same one for any given locale); otherwise, the argument is\r
62 returned unchanged.\r
63**/\r
64int\r
65toupper(\r
66 IN int _c\r
2aa62f2b 67 )\r
68{\r
2aa62f2b 69 return (islower(_c) ? _uConvT[_c] : _c);\r
70}\r