[GRASS-SVN] r38401 - in grass/trunk/doc: raster/r.example
vector/v.example
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 13 13:26:11 EDT 2009
Author: martinl
Date: 2009-07-13 13:26:11 -0400 (Mon, 13 Jul 2009)
New Revision: 38401
Modified:
grass/trunk/doc/raster/r.example/
grass/trunk/doc/raster/r.example/Makefile
grass/trunk/doc/raster/r.example/main.c
grass/trunk/doc/vector/v.example/
grass/trunk/doc/vector/v.example/main.c
Log:
fix example modules (rasterlib)
Property changes on: grass/trunk/doc/raster/r.example
___________________________________________________________________
Added: svn:ignore
+ OBJ.*
Modified: grass/trunk/doc/raster/r.example/Makefile
===================================================================
--- grass/trunk/doc/raster/r.example/Makefile 2009-07-13 17:04:09 UTC (rev 38400)
+++ grass/trunk/doc/raster/r.example/Makefile 2009-07-13 17:26:11 UTC (rev 38401)
@@ -4,8 +4,8 @@
PGM = r.example
-LIBES = $(GISLIB)
-DEPENDENCIES = $(GISDEP)
+LIBES = $(GISLIB) $(RASTERLIB)
+DEPENDENCIES = $(GISDEP) $(RASTERDEP)
include $(MODULE_TOPDIR)/include/Make/Module.make
Modified: grass/trunk/doc/raster/r.example/main.c
===================================================================
--- grass/trunk/doc/raster/r.example/main.c 2009-07-13 17:04:09 UTC (rev 38400)
+++ grass/trunk/doc/raster/r.example/main.c 2009-07-13 17:26:11 UTC (rev 38401)
@@ -7,7 +7,7 @@
* PURPOSE: Just copies a raster map, preserving the raster map type
* Intended to explain GRASS raster programming
*
- * COPYRIGHT: (C) 2002,2005 by the GRASS Development Team
+ * COPYRIGHT: (C) 2002, 2005-2009 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
@@ -15,11 +15,11 @@
*
*****************************************************************************/
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
+#include <grass/raster.h>
#include <grass/glocale.h>
/*
@@ -68,14 +68,12 @@
int nrows, ncols;
int row, col;
int infd, outfd; /* file descriptor */
- int verbose;
RASTER_MAP_TYPE data_type; /* type of the map (CELL/DCELL/...) */
struct History history; /* holds meta-data (title, comments,..) */
struct GModule *module; /* GRASS module for parsing arguments */
struct Option *input, *output; /* options */
- struct Flag *flag1; /* flags */
/* initialize GIS environment */
G_gisinit(argv[0]); /* reads grass env, stores program name to G_program_name() */
@@ -92,11 +90,6 @@
output = G_define_standard_option(G_OPT_R_OUTPUT);
- /* Define the different flags */
- flag1 = G_define_flag();
- flag1->key = 'q';
- flag1->description = _("Quiet");
-
/* options and flags parser */
if (G_parser(argc, argv))
exit(EXIT_FAILURE);
@@ -104,11 +97,10 @@
/* stores options and flags to variables */
name = input->answer;
result = output->answer;
- verbose = (!flag1->answer);
/* returns NULL if the map was not found in any mapset,
* mapset name otherwise */
- mapset = G_find_cell2(name, "");
+ mapset = (char *) G_find_cell2(name, "");
if (mapset == NULL)
G_fatal_error(_("Raster map <%s> not found"), name);
@@ -144,8 +136,7 @@
FCELL f;
DCELL d;
- if (verbose)
- G_percent(row, nrows, 2);
+ G_percent(row, nrows, 2);
/* read input map */
if (Rast_get_row(infd, inrast, row, data_type) < 0)
Property changes on: grass/trunk/doc/vector/v.example
___________________________________________________________________
Added: svn:ignore
+ OBJ.*
Modified: grass/trunk/doc/vector/v.example/main.c
===================================================================
--- grass/trunk/doc/vector/v.example/main.c 2009-07-13 17:04:09 UTC (rev 38400)
+++ grass/trunk/doc/vector/v.example/main.c 2009-07-13 17:26:11 UTC (rev 38401)
@@ -8,7 +8,7 @@
* PURPOSE: copies vector data from source map to destination map
* prints out all point coordinates and atributes
*
- * COPYRIGHT: (C) 2002-2008 by the GRASS Development Team
+ * COPYRIGHT: (C) 2002-2009 by the GRASS Development Team
*
* This program is free software under the
* GNU General Public License (>=v2).
@@ -71,7 +71,7 @@
*/
Vect_check_input_output_name(old->answer, new->answer, GV_FATAL_EXIT);
- if ((mapset = G_find_vector2(old->answer, "")) == NULL)
+ if ((mapset = (char *)G_find_vector2(old->answer, "")) == NULL)
G_fatal_error(_("Vector map <%s> not found"), old->answer);
/* Predetermine level at which a map will be opened for reading
More information about the grass-commit
mailing list