BOOTSTRAP (kutils) functions
LIBRARY ROUTINE
kstring_lower - convert a string to lower case.
LIBRARY CALL
char *kstring_lower(
const char *istr,
char *ostr)
INPUT
- istr - The string to convert to lowercase.
OUTPUT
- ostr - The string that holds the converted string.
If it's NULL, it allocates the necessary memory
with kmalloc().
RETURN VALUE
The converted string, 'ostr' if that variable is not
NULL, or a pointer to the resulting allocated string.
NULL is returned on an allocation error or if 'istr' is NULL.
DESCRIPTION
This routine performs a character by character
scan for uppercase characters. When an uppercase
character is found, it calls the function tolower()
to get the lowercase equivalent, and replaces it.
Note that if 'ostr' is non-NULL, the calling routine
must ensure that 'ostr' points to a memory buffer
large enough to hold the converted string plus a
null character. If the buffer is not large enough,
memory will be overwritten resulting in unpredicable
program failure.
ADDITIONAL INFORMATION
none
EXAMPLES
none
SIDE EFFECTS
Allocates the space for the output if ostr is NULL
RESTRICTIONS
none
MODIFICATION
none
FILES
$BOOTSTRAP/objects/library/kutils/src/strings.c
SEE ALSO
kutils(3)
COPYRIGHT
Copyright (C) 1993 - 1997, Khoral Research, Inc. ("KRI") All rights reserved.