home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / EXTRAS / UUCODE / UUPC / TEST / UPC12ES1.ZIP / LIB / strlwr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-11  |  2.5 KB  |  79 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.  *    $Id: strlwr.c 1.5 1993/07/22 23:19:50 ahd Exp $
  17.  *
  18.  *    Revision history:
  19.  *    $Log: strlwr.c $
  20.  *     Revision 1.5  1993/07/22  23:19:50  ahd
  21.  *     First pass for Robert Denny's Windows 3.x support changes
  22.  *
  23.  *     Revision 1.5  1993/07/22  23:19:50  ahd
  24.  *     First pass for Robert Denny's Windows 3.x support changes
  25.  *
  26.  *     Revision 1.4  1993/04/11  00:32:05  ahd
  27.  *     Global edits for year, TEXT, etc.
  28.  *
  29.  * Revision 1.3  1992/11/30  03:26:20  ahd
  30.  * Much better if strlwr makes the string LOWER case
  31.  *
  32.  * Revision 1.2  1992/11/19  02:58:39  ahd
  33.  * drop rcsid
  34.  *
  35.  * Revision 1.1  1992/11/16  05:00:26  ahd
  36.  * Initial revision
  37.  *
  38.  */
  39.  
  40.  
  41. /*--------------------------------------------------------------------*/
  42. /*                       Standard include files                       */
  43. /*--------------------------------------------------------------------*/
  44.  
  45. #include <stdio.h>
  46. #include <string.h>
  47. #include <stdlib.h>
  48. #include <ctype.h>
  49.  
  50. /*--------------------------------------------------------------------*/
  51. /*                    UUPC/extended include files                     */
  52. /*--------------------------------------------------------------------*/
  53.  
  54. #include "lib.h"
  55.  
  56. /*--------------------------------------------------------------------*/
  57. /*       s t r l w r                                                  */
  58. /*                                                                    */
  59. /*       Convert a string to lower case                               */
  60. /*--------------------------------------------------------------------*/
  61.  
  62. char *strlwr( char *s )
  63. {
  64.    char *save = s;
  65.  
  66.    if ( s == NULL )
  67.       return s;
  68.  
  69.    while ( *s != '\0' )
  70.    {
  71.       if ( isupper( *s ))
  72.          *s = tolower( *s );
  73.       s += 1;
  74.    } /* while */
  75.  
  76.    return save;
  77.  
  78. } /* strlwr */
  79.