mapcase.c

Go to the documentation of this file.
00001 #include "gis.h"
00002 /*
00003  * Map uppercase A-Z to lower case a-z
00004  *
00005  */
00006 static int toupper(char);
00007 static int tolower(char);
00008 
00009 
00021 char *
00022 G_tolcase (string)
00023     char *string;
00024 {
00025     register char *p;
00026 
00027     for (p = string; *p; p++)
00028         *p = tolower (*p);
00029 
00030     return (string);
00031 }
00032 
00033 static int tolower(char c)
00034 {
00035     if (c >= 'A' && c <= 'Z')
00036         c -= 'A' - 'a';
00037     return c;
00038 }
00039 
00040 /*
00041  * Map lowercase a-z to uppercase A-Z
00042  *
00043  */
00044 
00045 
00056 char *
00057 G_toucase (string)
00058     char *string;
00059 {
00060     register char *p;
00061 
00062     for (p = string; *p; p++)
00063         *p = toupper (*p);
00064 
00065     return (string);
00066 }
00067 
00068 static int toupper(char c)
00069 {
00070     if (c >= 'a' && c <= 'z')
00071         c += 'A' - 'a';
00072     return c;
00073 }

Generated on Wed Aug 23 17:49:22 2006 for GRASS by  doxygen 1.4.7