source: trunk/libs/newlib/src/newlib/libc/string/strlwr.c @ 577

Last change on this file since 577 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 580 bytes
Line 
1/*
2FUNCTION
3        <<strlwr>>---force string to lowercase
4       
5INDEX
6        strlwr
7
8SYNOPSIS
9        #include <string.h>
10        char *strlwr(char *<[a]>);
11
12DESCRIPTION
13        <<strlwr>> converts each character in the string at <[a]> to
14        lowercase.
15
16RETURNS
17        <<strlwr>> returns its argument, <[a]>.
18
19PORTABILITY
20<<strlwr>> is not widely portable.
21
22<<strlwr>> requires no supporting OS subroutines.
23
24QUICKREF
25        strlwr
26*/
27
28#include <string.h>
29#include <ctype.h>
30
31char *
32strlwr (char *s)
33{
34  unsigned char *ucs = (unsigned char *) s;
35  for ( ; *ucs != '\0'; ucs++)
36    {
37      *ucs = tolower(*ucs);
38    }
39  return s;
40}
Note: See TracBrowser for help on using the repository browser.