blob: 793de6bb3d31bb2aae44ba1eac6b106de240843f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#include <ctype.h>
#include "limits.h"
#include "nonstd/assert.h"
#include "nonstd/ctype.h"
/** convert an uppercase letter to lowercase **/
int tolower(int c)
{
unsigned char *map = __libc(TOLOWER);
ASSERT_REPRESENTABLE(c, 0, UCHAR_MAX, unsigned char, EOF);
/*
RETURN_SUCCESS(ARGUMENT(c) converted to lowercase);
RETURN_FAILURE(ARGUMENT(c), ARGUMENT(c) was not an uppercase letter or it has no equivalent lowercase letter);
*/
return map[c];
}
/***
converts an uppercase letter to its equivalent lowercase letter in the current
locale.
***/
/*
LC_CTYPE
STDC(1)
*/
|