home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / UUPC11XS.ZIP / LIB / STRLWR.C < prev    next >
C/C++ Source or Header  |  1992-11-29  |  2KB  |  70 lines

  1. /*--------------------------------------------------------------------*/
  2. /*       UUPC/extended string lower function                          */
  3. /*                                                                    */
  4. /*       Copyright 1992, Andrew H. Derbyshire                         */
  5. /*                                                                    */
  6. /*       Why this function doesn't exist in GCC is beyond me          */
  7. /*--------------------------------------------------------------------*/
  8.  
  9.  
  10.  
  11. /*--------------------------------------------------------------------*/
  12. /*                          RCS Information                           */
  13. /*--------------------------------------------------------------------*/
  14.  
  15. /*
  16.  *    $Header: E:\src\uupc\lib\RCS\STRLWR.C 1.3 1992/11/30 03:26:20 ahd Exp $
  17.  *
  18.  *    Revision history:
  19.  *    $Log: STRLWR.C $
  20.  * Revision 1.3  1992/11/30  03:26:20  ahd
  21.  * Much better if strlwr makes the string LOWER case
  22.  *
  23.  * Revision 1.2  1992/11/19  02:58:39  ahd
  24.  * drop rcsid
  25.  *
  26.  * Revision 1.1  1992/11/16  05:00:26  ahd
  27.  * Initial revision
  28.  *
  29.  */
  30.  
  31.  
  32. /*--------------------------------------------------------------------*/
  33. /*                       Standard include files                       */
  34. /*--------------------------------------------------------------------*/
  35.  
  36. #include <stdio.h>
  37. #include <string.h>
  38. #include <stdlib.h>
  39. #include <ctype.h>
  40.  
  41. /*--------------------------------------------------------------------*/
  42. /*                    UUPC/extended include files                     */
  43. /*--------------------------------------------------------------------*/
  44.  
  45. #include "lib.h"
  46.  
  47. /*--------------------------------------------------------------------*/
  48. /*       s t r l w r                                                  */
  49. /*                                                                    */
  50. /*       Convert a string to lower case                               */
  51. /*--------------------------------------------------------------------*/
  52.  
  53. char *strlwr( char *s )
  54. {
  55.    char *save = s;
  56.  
  57.    if ( s == NULL )
  58.       return s;
  59.  
  60.    while ( *s != '\0' )
  61.    {
  62.       if ( isupper( *s ))
  63.          *s = tolower( *s );
  64.       *s++;
  65.    } /* while */
  66.  
  67.    return save;
  68.  
  69. } /* strlwr */
  70.