GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
gis/index.c
Go to the documentation of this file.
1 /* TODO: should this go into strings.c ? */
2 
3 #include <grass/gis.h>
4 
5 
16 char *G_index(const char *str, int delim)
17 {
18  while (*str && *str != delim)
19  str++;
20  if (delim == 0)
21  return (char *)str;
22  return *str ? (char *)str : NULL;
23 }
24 
25 
36 char *G_rindex(const char *str, int delim)
37 {
38  const char *p;
39 
40  p = NULL;
41  while (*str) {
42  if (*str == delim)
43  p = str;
44  str++;
45  }
46  if (delim == 0)
47  return (char *)str;
48  return (char *)p;
49 }
char * G_index(const char *str, int delim)
delimiter
Definition: gis/index.c:16
char * G_rindex(const char *str, int delim)
???
Definition: gis/index.c:36
return NULL
Definition: dbfopen.c:1394