GRASS Programmer's Manual  6.4.2(2012)
basename.c
Go to the documentation of this file.
00001 
00017 #include <grass/gis.h>
00018 
00019 #include <ctype.h>
00020 #include <string.h>
00021 
00022 
00037 char *G_basename(char *filename, const char *desired_ext)
00038 {
00039     /* Find the last . in the filename */
00040     char *dot = strrchr(filename, '.');
00041 
00042     if (dot && G_strcasecmp(dot + 1, desired_ext) == 0)
00043         *dot = '\0';
00044 
00045     return filename;
00046 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines