case.c

Go to the documentation of this file.
00001 #include <grass/dbmi.h>
00002 
00009 void
00010 db_char_to_lowercase (char *s)
00011 {
00012     if (*s >= 'A' && *s <= 'Z')
00013         *s -= 'A' - 'a' ;
00014 }
00015 
00022 void
00023 db_char_to_uppercase (char *s)
00024 {
00025     if (*s >= 'a' && *s <= 'z')
00026         *s += 'A' - 'a' ;
00027 }
00028 
00035 void
00036 db_Cstring_to_lowercase (char *s)
00037 {
00038     while (*s)
00039         db_char_to_lowercase (s++);
00040 }
00041 
00048 void
00049 db_Cstring_to_uppercase (char *s)
00050 {
00051     while (*s)
00052         db_char_to_uppercase (s++);
00053 }
00054 
00061 int
00062 db_nocase_compare (char *a, char *b)
00063 {
00064     char s, t;
00065 
00066     while (*a && *b)
00067     {
00068         s = *a++;
00069         t = *b++;
00070         db_char_to_uppercase (&s);
00071         db_char_to_uppercase (&t);
00072         if (s != t)
00073             return 0;
00074     }
00075     return (*a == 0 && *b == 0);
00076 }

Generated on Sun Apr 6 17:31:38 2008 for GRASS by  doxygen 1.5.5