[GRASS-SVN] r33793 - in grass/trunk: general/g.findfile lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Oct 9 15:12:42 EDT 2008
Author: martinl
Date: 2008-10-09 15:12:42 -0400 (Thu, 09 Oct 2008)
New Revision: 33793
Modified:
grass/trunk/general/g.findfile/main.c
grass/trunk/lib/gis/file_name.c
grass/trunk/lib/gis/find_file.c
Log:
i18n update (g.findfile)
(merge from devbr6, r33792)
Modified: grass/trunk/general/g.findfile/main.c
===================================================================
--- grass/trunk/general/g.findfile/main.c 2008-10-09 19:09:40 UTC (rev 33792)
+++ grass/trunk/general/g.findfile/main.c 2008-10-09 19:12:42 UTC (rev 33793)
@@ -6,9 +6,9 @@
* Markus Neteler <neteler itc.it>,
* Bernhard Reiter <bernhard intevation.de>,
* Glynn Clements <glynn gclements.plus.com>,
- * Jan-Oliver Wagner <jan intevation.de>
+ * Jan-Oliver Wagner <jan intevation.de>
* PURPOSE:
- * COPYRIGHT: (C) 1999-2006 by the GRASS Development Team
+ * COPYRIGHT: (C) 1999-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
@@ -33,8 +33,8 @@
module = G_define_module();
module->keywords = _("general");
module->description =
- "Searches for GRASS data base files "
- "and sets variables for the shell.";
+ _("Searches for GRASS data base files "
+ "and sets variables for the shell.");
G_gisinit(argv[0]);
@@ -44,20 +44,20 @@
opt1->key = "element";
opt1->type = TYPE_STRING;
opt1->required = YES;
- opt1->description = "Name of an element";
+ opt1->description = _("Name of an element");
opt2 = G_define_option();
opt2->key = "mapset";
opt2->type = TYPE_STRING;
opt2->required = NO;
- opt2->description = "Name of a mapset";
+ opt2->description = _("Name of a mapset");
opt2->answer = "";
opt3 = G_define_option();
opt3->key = "file";
opt3->type = TYPE_STRING;
opt3->required = YES;
- opt3->description = "Name of an existing map";
+ opt3->description = _("Name of an existing map");
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -65,13 +65,14 @@
search_mapset = opt2->answer;
if (strcmp(".", search_mapset) == 0)
search_mapset = G_mapset();
-
+
if (opt2->answer && strlen(opt2->answer) > 0) {
char **map_mapset = G_tokenize(opt3->answer, "@");
if (G_number_of_tokens(map_mapset) > 1) {
if (strcmp(map_mapset[1], opt2->answer))
- G_fatal_error(_("Parameter 'file' contains reference to <%s> mapset, but mapset parameter <%s> does not correspond"),
+ G_fatal_error(_("Parameter 'file' contains reference to <%s> mapset, "
+ "but mapset parameter <%s> does not correspond"),
map_mapset[1], opt2->answer);
else
strcpy(name, opt3->answer);
@@ -98,5 +99,6 @@
fprintf(stdout, "fullname=\n");
fprintf(stdout, "file=\n");
}
+
exit(mapset == NULL);
}
Modified: grass/trunk/lib/gis/file_name.c
===================================================================
--- grass/trunk/lib/gis/file_name.c 2008-10-09 19:09:40 UTC (rev 33792)
+++ grass/trunk/lib/gis/file_name.c 2008-10-09 19:12:42 UTC (rev 33793)
@@ -1,26 +1,35 @@
+/*!
+ \file file_name.c
-/**********************************************************************
- * char *
- * G__file_name (path, element, name, maps)
- * char path[] buffer to hold resultant full path to file.
- * const char *element database element (eg, "cell", "cellhd", etc)
- * const char *name name of file to build path to
- * const char *mapset mapset name
- *
- * builds full path names to GIS data files
- *
- * returns:
- * pointer to 'path'
- *
- * note:
- * if name is of the form nnn at ppp then path is set
- * as if name had been nnn and mapset had been ppp
- * (mapset parameter itself is ignored in this case)
- *********************************************************************/
+ \brief GIS library - Determice GRASS data base file name
+ (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.
+
+ \author Original author CERL
+ */
+
#include <string.h>
#include <grass/gis.h>
+/*!
+ \brief Builds full path names to GIS data files
+
+ If name is of the form nnn at ppp then path is set
+ as if name had been nnn and mapset had been ppp
+ (mapset parameter itself is ignored in this case)
+
+ \param[out] path buffer to hold resultant full path to file
+ \param element database element (eg, "cell", "cellhd", etc)
+ \param name name of file to build path to (fully qualified names allowed)
+ \param mapset mapset name
+
+ \return pointer to <i>path</i>
+*/
char *G__file_name(char *path,
const char *element, const char *name, const char *mapset)
{
Modified: grass/trunk/lib/gis/find_file.c
===================================================================
--- grass/trunk/lib/gis/find_file.c 2008-10-09 19:09:40 UTC (rev 33792)
+++ grass/trunk/lib/gis/find_file.c 2008-10-09 19:12:42 UTC (rev 33793)
@@ -1,6 +1,22 @@
+/*!
+ \file find_file.c
+
+ \brief GIS library - find GRASS data base files
+
+ (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.
+
+ \author Original author CERL
+ */
+
#include <string.h>
#include <unistd.h>
#include <grass/gis.h>
+#include <grass/glocale.h>
static char *find_file(int misc,
const char *dir,
@@ -55,16 +71,17 @@
if (!pselmapset)
pselmapset = pmapset;
else
- G_warning
- ("'%s/%s' was found in more mapsets (also found in %s).",
- element, pname, pmapset);
+ G_warning(_("'%s/%s' was found in more mapsets (also found in <%s>)"),
+ element, pname, pmapset);
cnt++;
}
}
if (cnt > 0) {
/* If the same name exists in more mapsets and print a warning */
if (cnt > 1)
- G_warning("using '%s@%s'.", pname, pselmapset);
+ G_warning(_("Using <%s@%s>"),
+ pname, pselmapset);
+
return (char *)pselmapset;
}
}
@@ -79,9 +96,11 @@
G__file_name_misc(path, dir, element, pname, pmapset);
else
G__file_name(path, element, pname, pmapset);
+
if (access(path, 0) == 0)
return G_store(pmapset);
}
+
return NULL;
}
More information about the grass-commit
mailing list