1/* $NetBSD$ */ 2 3/*++ 4/* NAME 5/* lowercase 3 6/* SUMMARY 7/* map uppercase characters to lowercase 8/* SYNOPSIS 9/* #include <stringops.h> 10/* 11/* char *lowercase(buf) 12/* char *buf; 13/* DESCRIPTION 14/* lowercase() replaces uppercase characters in its null-terminated 15/* input by their lowercase equivalent. 16/* LICENSE 17/* .ad 18/* .fi 19/* The Secure Mailer license must be distributed with this software. 20/* AUTHOR(S) 21/* Wietse Venema 22/* IBM T.J. Watson Research 23/* P.O. Box 704 24/* Yorktown Heights, NY 10598, USA 25/*--*/ 26 27/* System library. */ 28 29#include "sys_defs.h" 30#include <ctype.h> 31 32/* Utility library. */ 33 34#include "stringops.h" 35 36char *lowercase(char *string) 37{ 38 char *cp; 39 int ch; 40 41 for (cp = string; (ch = *cp) != 0; cp++) 42 if (ISUPPER(ch)) 43 *cp = TOLOWER(ch); 44 return (string); 45} 46