From 9bd627ab6964dffe3730a537e7c50afc45d6765b Mon Sep 17 00:00:00 2001 From: Vern Paxson Date: Fri, 19 May 1989 14:07:39 +0000 Subject: [PATCH] added all_lower() and all_upper() --- misc.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/misc.c b/misc.c index 53220a4..74934e4 100644 --- a/misc.c +++ b/misc.c @@ -68,6 +68,52 @@ int size, element_size; } +/* all_lower - true if a string is all lower-case + * + * synopsis: + * char *str; + * int all_lower(); + * true/false = all_lower( str ); + */ + +int all_lower( str ) +register char *str; + + { + while ( *str ) + { + if ( ! islower( *str ) ) + return ( 0 ); + ++str; + } + + return ( 1 ); + } + + +/* all_upper - true if a string is all upper-case + * + * synopsis: + * char *str; + * int all_upper(); + * true/false = all_upper( str ); + */ + +int all_upper( str ) +register char *str; + + { + while ( *str ) + { + if ( ! isupper( *str ) ) + return ( 0 ); + ++str; + } + + return ( 1 ); + } + + /* bubble - bubble sort an integer array in increasing order * * synopsis -- 2.50.1