[GRASS-SVN] r29753 - grass/trunk/lib/gis
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Jan 20 16:40:55 EST 2008
Author: martinl
Date: 2008-01-20 16:40:55 -0500 (Sun, 20 Jan 2008)
New Revision: 29753
Modified:
grass/trunk/lib/gis/get_cellhd.c
Log:
Doxygen strings updated for get_cellhd.c, message standardization.
Modified: grass/trunk/lib/gis/get_cellhd.c
===================================================================
--- grass/trunk/lib/gis/get_cellhd.c 2008-01-20 21:28:19 UTC (rev 29752)
+++ grass/trunk/lib/gis/get_cellhd.c 2008-01-20 21:40:55 UTC (rev 29753)
@@ -1,46 +1,47 @@
-/**********************************************************************
- *
- * G_get_cellhd (name, mapset, cellhd)
- * char *name name of map
- * char *mapset mapset that map belongs to
- * struct Cell_head *cellhd structure to hold cell header info
- *
- * Reads the cell file header information associated with map layer "map"
- * in mapset "mapset" into the structure "cellhd".
- *
- * returns: 0 if successful
- * -1 on fail
- *
- * note: a warning message for errors encountered.
- *
- * Cell header files may contain either grid cell header
- * information or reclass information. If it is a reclass
- * file, it will specify the map and mapset names of the actual
- * grid cell file being reclassed. G_get_cellhd(), upon
- * reading reclass information will go read the cell header
- * information for the referenced file. Only one reference is
- * allowed.
- **********************************************************************/
+/*!
+ \file get_cellhd.c
+
+ \brief GIS library - Read raster header
+
+ (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 <stdlib.h>
#include <grass/gis.h>
#include <grass/glocale.h>
-
/*!
- * \brief read the raster header
+ * \brief Read the raster header
*
- * The raster header for the raster map
- * <b>name</b> in the specified <b>mapset</b> is read into the
- * <b>cellhd</b> structure.
- * If there is an error reading the raster header file, a diagnostic message is
+ * The raster header for the raster map <b>name</b> in the specified
+ * <b>mapset</b> is read into the <b>cellhd</b> structure. If there
+ * is an error reading the raster header file, a diagnostic message is
* printed and -1 is returned. Otherwise, 0 is returned.
*
- * \param name
- * \param mapset
- * \param cellhd
- * \return int
+ * <b>Note</b>:a warning message for errors encountered.
+ *
+ * Cell header files may contain either grid cell header
+ * information or reclass information. If it is a reclass
+ * file, it will specify the map and mapset names of the actual
+ * grid cell file being reclassed. G_get_cellhd(), upon
+ * reading reclass information will go read the cell header
+ * information for the referenced file. Only one reference is
+ * allowed.
+ *
+ * \param name name of map
+ * \param mapset mapset that map belongs to
+ * \param cellhd structure to hold cell header info
+ *
+ * \return 0 on success
+ * \return -1 on error
*/
int G_get_cellhd (const char *name, const char *mapset, struct Cell_head *cellhd)
@@ -70,14 +71,14 @@
fd = G_fopen_old ("cellhd", real_name, real_mapset);
if (fd == NULL)
{
- sprintf (buf,_("Can't read header file for [%s in %s]\n"), name, mapset);
+ sprintf (buf,_("Unable to read header file for raster map <%s@%s>."), name, mapset);
tail = buf + strlen(buf);
- sprintf (tail, _("It is a reclass of [%s in %s] "), real_name, real_mapset);
+ sprintf (tail, _(" It is a reclass of raster map <%s@%s> "), real_name, real_mapset);
tail = buf + strlen(buf);
if (!G_find_cell (real_name, real_mapset))
- sprintf (tail, _("which is missing"));
+ sprintf (tail, _("which is missing."));
else
- sprintf (tail, _("whose header file can't be opened"));
+ sprintf (tail, _("whose header file can't be opened."));
G_warning (buf);
return -1;
}
@@ -87,7 +88,7 @@
fd = G_fopen_old ("cellhd", name, mapset);
if (fd == NULL)
{
- sprintf (buf, _("Can't open header file for [%s in %s]"), name, mapset);
+ sprintf (buf, _("Unable to open header file for raster map <%s@%s>"), name, mapset);
G_warning (buf);
return -1;
}
@@ -99,18 +100,20 @@
if (err == NULL)
return 0;
- sprintf (buf, _("Can't read header file for [%s in %s]\n"), name, mapset);
+ sprintf (buf, _("Unable to read header file for raster map <%s@%s>."), name, mapset);
tail = buf + strlen(buf);
if (is_reclass)
{
- sprintf (tail, _("It is a reclass of [%s in %s] whose header file is invalid\n"),
+ sprintf (tail, _(" It is a reclass of raster map <%s@%s> whose header file is invalid."),
real_name, real_mapset);
}
else
- sprintf (tail, _("Invalid format\n"));
+ sprintf (tail, _(" Invalid format."));
tail = buf + strlen(buf);
strcpy (tail, err);
+
G_free (err);
+
G_warning (buf);
return -1;
}
More information about the grass-commit
mailing list