]> git.proxmox.com Git - mirror_edk2.git/blame - StdLib/LibC/Ctype/CConv.c
Standard Libraries for EDK II.
[mirror_edk2.git] / StdLib / LibC / Ctype / CConv.c
CommitLineData
2aa62f2b 1/** @file\r
2 Case conversion functions for <ctype.h>\r
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
18 Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
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
22 http://opensource.org/licenses/bsd-license.php.\r
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
26\r
27**/\r
28#include <LibConfig.h>\r
29\r
30#define NO_CTYPE_MACROS // So that we don't define the classification macros\r
31#include <ctype.h>\r
32\r
33int\r
34tolower(\r
35 int _c\r
36 )\r
37{\r
38// return ((_c < 0 || _c > 127) ? _c : _lConvT[_c]);\r
39 return (isupper(_c) ? _lConvT[_c] : _c);\r
40}\r
41\r
42int toupper(\r
43 int _c\r
44 )\r
45{\r
46// return ((_c < 0 || _c > 127) ? _c : _uConvT[_c]);\r
47 return (islower(_c) ? _uConvT[_c] : _c);\r
48}\r