• Main Page
  • Related Pages
  • Data Structures
  • Files
  • File List
  • Globals

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 }

Generated on Thu Dec 9 2010 20:46:04 for GRASS Programmer's Manual by  doxygen 1.7.2