index.c

Go to the documentation of this file.
00001 /* TODO: should this go into strings.c ? */
00002 
00003 #include <grass/gis.h>
00004 
00005 
00016 char *
00017 G_index  (char *str, int delim)
00018 
00019 {
00020     while (*str && *str != delim)
00021         str++;
00022     if (delim == 0)
00023         return str;
00024     return (*str ? str : NULL);
00025 }
00026 
00027 
00038 char *
00039 G_rindex  (char *str, int delim)
00040 
00041 {
00042     char *p;
00043 
00044     p = NULL;
00045     while (*str)
00046     {
00047         if (*str == delim)
00048             p = str;
00049         str ++;
00050     }
00051     if (delim == 0)
00052         return str;
00053     return (p);
00054 }

Generated on Fri Nov 21 11:02:18 2008 for GRASS by  doxygen 1.5.1