| GRASS Programmer's Manual
    6.5.svn(2014)-r66266
    | 
GIS Library - Program basename routines. More...
#include <grass/gis.h>#include <ctype.h>#include <string.h>
Go to the source code of this file.
| Functions | |
| char * | G_basename (char *filename, const char *desired_ext) | 
| Truncates filename to the base part (before the last '.') if it matches the extension, otherwise leaves it unchanged.  More... | |
GIS Library - Program basename routines.
(C) 2001-2008 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file basename.c.
| char* G_basename | ( | char * | filename, | 
| const char * | desired_ext | ||
| ) | 
Truncates filename to the base part (before the last '.') if it matches the extension, otherwise leaves it unchanged.
Checks if a filename matches a certain file extension (case insensitive) and if so, truncates the string to the base file name (cf. basename Unix command)
| [in] | filename | string containing filename | 
| [in] | desired_ext | string containing extension to look for (case insensitive) | 
Definition at line 37 of file basename.c.
References G_strcasecmp().
Referenced by G_parser(), and G_set_program_name().