OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [libc/] [ctype/] [tolower.c] - Blame information for rev 1773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1005 ivang
/*
2
FUNCTION
3
        <<tolower>>---translate characters to lower case
4
 
5
INDEX
6
        tolower
7
INDEX
8
        _tolower
9
 
10
ANSI_SYNOPSIS
11
        #include <ctype.h>
12
        int tolower(int <[c]>);
13
        int _tolower(int <[c]>);
14
 
15
TRAD_SYNOPSIS
16
        #include <ctype.h>
17
        int tolower(<[c]>);
18
        int _tolower(<[c]>);
19
 
20
 
21
DESCRIPTION
22
<<tolower>> is a macro which converts upper-case characters to lower
23
case, leaving all other characters unchanged.  It is only defined when
24
<[c]> is an integer in the range <<EOF>> to <<255>>.
25
 
26
You can use a compiled subroutine instead of the macro definition by
27
undefining this macro using `<<#undef tolower>>'.
28
 
29
<<_tolower>> performs the same conversion as <<tolower>>, but should
30
only be used when <[c]> is known to be an uppercase character (<<A>>--<<Z>>).
31
 
32
RETURNS
33
<<tolower>> returns the lower-case equivalent of <[c]> when it is a
34
character between <<A>> and <<Z>>, and <[c]> otherwise.
35
 
36
<<_tolower>> returns the lower-case equivalent of <[c]> when it is a
37
character between <<A>> and <<Z>>.  If <[c]> is not one of these
38
characters, the behaviour of <<_tolower>> is undefined.
39
 
40
PORTABILITY
41
<<tolower>> is ANSI C.  <<_tolower>> is not recommended for portable
42
programs.
43
 
44
No supporting OS subroutines are required.
45
*/
46
 
47
#include <_ansi.h>
48
#include <ctype.h>
49
 
50
#undef tolower
51
int
52
_DEFUN(tolower,(c),int c)
53
{
54
        return isupper(c) ? (c) - 'A' + 'a' : c;
55
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.