1 /*
2 Copyright (c) 1994 Cygnus Support.
3 All rights reserved.
4
5 Redistribution and use in source and binary forms are permitted
6 provided that the above copyright notice and this paragraph are
7 duplicated in all such forms and that any documentation,
8 and/or other materials related to such
9 distribution and use acknowledge that the software was developed
10 at Cygnus Support, Inc. Cygnus Support, Inc. may not be used to
11 endorse or promote products derived from this software without
12 specific prior written permission.
13 THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16 */
17 /*
18 FUNCTION
19 <<strlwr>>---force string to lowercase
20
21 INDEX
22 strlwr
23
24 SYNOPSIS
25 #include <string.h>
26 char *strlwr(char *<[a]>);
27
28 DESCRIPTION
29 <<strlwr>> converts each character in the string at <[a]> to
30 lowercase.
31
32 RETURNS
33 <<strlwr>> returns its argument, <[a]>.
34
35 PORTABILITY
36 <<strlwr>> is not widely portable.
37
38 <<strlwr>> requires no supporting OS subroutines.
39
40 QUICKREF
41 strlwr
42 */
43
44 #include <string.h>
45 #include <ctype.h>
46
47 char *
strlwr(char * s)48 strlwr (char *s)
49 {
50 unsigned char *ucs = (unsigned char *) s;
51 for ( ; *ucs != '\0'; ucs++)
52 {
53 *ucs = tolower(*ucs);
54 }
55 return s;
56 }
57