[GRASS-SVN] r33177 - in grass/trunk/vector: v.in.dxf v.kcv v.kernel v.label v.label.sa v.neighbors v.net v.net.alloc v.net.iso v.net.path v.net.salesman v.net.steiner v.net.visibility v.normal v.out.dxf v.out.ogr v.out.pov v.out.svg v.overlay v.patch v.perturb v.qcount v.reclass v.sample v.segment v.select v.support v.surf.rst v.to.db v.to.points v.to.rast v.transform v.type v.univar v.voronoi v.what v.what.rast

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 31 17:30:54 EDT 2008


Author: glynn
Date: 2008-08-31 17:30:54 -0400 (Sun, 31 Aug 2008)
New Revision: 33177

Modified:
   grass/trunk/vector/v.in.dxf/main.c
   grass/trunk/vector/v.kcv/main.c
   grass/trunk/vector/v.kernel/main.c
   grass/trunk/vector/v.label.sa/labels.c
   grass/trunk/vector/v.label/main.c
   grass/trunk/vector/v.neighbors/main.c
   grass/trunk/vector/v.net.alloc/main.c
   grass/trunk/vector/v.net.iso/main.c
   grass/trunk/vector/v.net.path/main.c
   grass/trunk/vector/v.net.salesman/main.c
   grass/trunk/vector/v.net.steiner/main.c
   grass/trunk/vector/v.net.visibility/main.c
   grass/trunk/vector/v.net/main.c
   grass/trunk/vector/v.normal/main.c
   grass/trunk/vector/v.out.dxf/main.c
   grass/trunk/vector/v.out.ogr/main.c
   grass/trunk/vector/v.out.pov/main.c
   grass/trunk/vector/v.out.svg/main.c
   grass/trunk/vector/v.overlay/main.c
   grass/trunk/vector/v.patch/main.c
   grass/trunk/vector/v.perturb/main.c
   grass/trunk/vector/v.qcount/main.c
   grass/trunk/vector/v.reclass/main.c
   grass/trunk/vector/v.sample/main.c
   grass/trunk/vector/v.segment/main.c
   grass/trunk/vector/v.select/main.c
   grass/trunk/vector/v.support/main.c
   grass/trunk/vector/v.surf.rst/main.c
   grass/trunk/vector/v.surf.rst/surf.h
   grass/trunk/vector/v.to.db/global.h
   grass/trunk/vector/v.to.db/main.c
   grass/trunk/vector/v.to.db/parse.c
   grass/trunk/vector/v.to.points/main.c
   grass/trunk/vector/v.to.rast/local.h
   grass/trunk/vector/v.to.rast/support.c
   grass/trunk/vector/v.to.rast/vect2rast.c
   grass/trunk/vector/v.transform/main.c
   grass/trunk/vector/v.type/main.c
   grass/trunk/vector/v.univar/main.c
   grass/trunk/vector/v.voronoi/dt_main.c
   grass/trunk/vector/v.voronoi/vo_main.c
   grass/trunk/vector/v.what.rast/main.c
   grass/trunk/vector/v.what/main.c
   grass/trunk/vector/v.what/what.c
   grass/trunk/vector/v.what/what.h
Log:
Remove explicit mapset references and G_find_* calls


Modified: grass/trunk/vector/v.in.dxf/main.c
===================================================================
--- grass/trunk/vector/v.in.dxf/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.in.dxf/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -105,7 +105,7 @@
     opt.input->description = _("Name of input DXF file");
 
     opt.output = G_define_standard_option(G_OPT_V_OUTPUT);
-    opt.output->required = NO;
+    opt.output->required = YES;
 
     opt.layers = G_define_option();
     opt.layers->key = "layers";
@@ -136,41 +136,10 @@
 	G_verbose_message(_("Layer number: layer name / GRASS compliant name"));
     }
     else {
-	/* make vector map name SQL compliant */
-	if (opt.output->answer) {
-	    output = G_store(opt.output->answer);
-	}
-	else {
-	    char *p, *p2;
+	output = G_store(opt.output->answer);
 
-	    if ((p = G_rindex(dxf->name, '/')))
-		p++;
-	    else
-		p = dxf->name;
-	    output = G_store(p);
-	    if ((p2 = G_rindex(p, '.')))
-		output[p2 - p] = 0;
-	}
-	{
-	    char *p;
-
-	    for (p = output; *p; p++)
-		if (*p == '.')
-		    *p = '_';
-	}
-
 	layers = opt.layers->answers;
 
-	if (!G_check_overwrite(argc, argv) &&
-	    G_find_vector2(output, G_mapset())) {
-	    G_fatal_error(_("Option <%s>: <%s> exists."), opt.output->key,
-			  output);
-	}
-
-	if (Vect_legal_filename(output) < 0)
-	    G_fatal_error(_("Use '%s' option to change vector map name"),
-			  opt.output->key);
-
 	/* create vector map */
 	Map = (struct Map_info *)G_malloc(sizeof(struct Map_info));
 	if (Vect_open_new(Map, output, 1) < 0)

Modified: grass/trunk/vector/v.kcv/main.c
===================================================================
--- grass/trunk/vector/v.kcv/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.kcv/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -59,7 +59,6 @@
     struct Map_info In, Out;
     static struct line_pnts *Points;
     struct line_cats *Cats;
-    char *mapset;
     struct GModule *module;
     struct Option *in_opt, *out_opt, *col_opt, *npart_opt;
     struct Flag *drand48_flag, *q_flag;
@@ -128,12 +127,8 @@
     Cats = Vect_new_cats_struct();
 
     /* open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    if (Vect_open_old(&In, in_opt->answer, mapset) < 2) {
+    if (Vect_open_old(&In, in_opt->answer, "") < 2) {
 	G_fatal_error(_("Unable to open vector map <%s> at topological level %d"),
 		      in_opt->answer, 2);
     }

Modified: grass/trunk/vector/v.kernel/main.c
===================================================================
--- grass/trunk/vector/v.kernel/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.kernel/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -82,8 +82,6 @@
     struct Option *stddev_opt, *dsize_opt, *segmax_opt, *netmax_opt,
 	*multip_opt;
     struct Flag *flag_o, *flag_q;
-
-    char *mapset;
     struct Map_info In, Net, Out;
     int fdout = 0, maskfd = 0;
     int row, col;
@@ -197,11 +195,8 @@
 	      sigma, window.ew_res, window.rows, window.cols);
 
     /* Open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
 
     if (net_opt->answer) {
@@ -213,12 +208,8 @@
 	net = 1;
 	dimension = 1.;
 	/* Open input network */
-	if ((mapset = G_find_vector2(net_opt->answer, "")) == NULL)
-	    G_fatal_error(_("Network input map <%s> not found"),
-			  net_opt->answer);
-
 	Vect_set_open_level(2);
-	Vect_open_old(&Net, net_opt->answer, mapset);
+	Vect_open_old(&Net, net_opt->answer, "");
 	Vect_net_build_graph(&Net, GV_LINES, 0, 0, NULL, NULL, NULL, 0, 0);
 
 	if (!flag_q->answer) {

Modified: grass/trunk/vector/v.label/main.c
===================================================================
--- grass/trunk/vector/v.label/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.label/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -37,7 +37,6 @@
     int cat, direction;
     double x, y, linlength, lablength, size, space, ldist;
     double rotate, rot;
-    char *mapset;
     char *txt, buf[2000];
     struct line_pnts *Points;
     struct line_cats *Cats;
@@ -265,12 +264,8 @@
     }
 
     /* open vector */
-    mapset = G_find_vector2(Vectfile->answer, NULL);
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), Vectfile->answer);
+    Vect_open_old(&Map, Vectfile->answer, "");
 
-    Vect_open_old(&Map, Vectfile->answer, mapset);
-
     /* open database */
     field = atoi(Fieldopt->answer);
     fi = Vect_get_field(&Map, field);

Modified: grass/trunk/vector/v.label.sa/labels.c
===================================================================
--- grass/trunk/vector/v.label.sa/labels.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.label.sa/labels.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -42,7 +42,6 @@
 label_t *labels_init(struct params *p, int *n_labels)
 {
     label_t *labels;
-    char *mapset;
     int legal_types, layer, i = 0, error, sql_len;
     size_t label_sz;
     struct field_info *fi;
@@ -54,13 +53,8 @@
     fprintf(stderr, "Initialising labels...");
     legal_types = Vect_option_to_types(p->type);
 
-    /* open vector */
-    mapset = G_find_vector2(p->map->answer, NULL);
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), p->map->answer);
-
     /* open vector for read only */
-    Vect_open_old(&Map, p->map->answer, mapset);
+    Vect_open_old(&Map, p->map->answer, "");
 
     label_sz = Vect_get_num_primitives(&Map, legal_types);
 

Modified: grass/trunk/vector/v.neighbors/main.c
===================================================================
--- grass/trunk/vector/v.neighbors/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.neighbors/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -33,7 +33,6 @@
     struct GModule *module;
     struct Option *in_opt, *out_opt;
     struct Option *method_opt, *size_opt;
-    char *mapset;
     struct Map_info In;
     double radius;
     struct ilist *List;
@@ -73,13 +72,8 @@
     radius = atof(size_opt->answer) / 2;
 
     /* open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found in the current mapset"),
-		      in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     G_get_set_window(&region);
     nrows = G_window_rows();

Modified: grass/trunk/vector/v.net/main.c
===================================================================
--- grass/trunk/vector/v.net/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -35,7 +35,6 @@
     struct Flag *cats_flag;
     struct Map_info In, Out, Points;
 
-    char *mapset;
     int afield, nfield;
     int act;
     double thresh;
@@ -136,12 +135,8 @@
     }
 
     /* open input map */
-    mapset = G_find_vector2(input->answer, "");
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), input->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, input->answer, mapset);
+    Vect_open_old(&In, input->answer, "");
 
     if (act == TOOL_NODES || act == TOOL_CONNECT) {	/* nodes */
 	int is3d;
@@ -151,13 +146,9 @@
 
 	if (act == TOOL_CONNECT) {
 	    /* open points map */
-	    mapset = G_find_vector2(points->answer, "");
-	    if (mapset == NULL)
-		G_fatal_error(_("Vector map <%s> not found"), points->answer);
-
 	    Vect_set_open_level(1);
 	    Vect_set_fatal_error(GV_FATAL_PRINT);
-	    if (Vect_open_old(&Points, points->answer, mapset) == -1) {
+	    if (Vect_open_old(&Points, points->answer, "") == -1) {
 		Vect_close(&In);
 		G_fatal_error(_("Unable to open vector map <%s>"),
 			      points->answer);

Modified: grass/trunk/vector/v.net.alloc/main.c
===================================================================
--- grass/trunk/vector/v.net.alloc/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net.alloc/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -46,7 +46,6 @@
 	*term_opt;
     struct Flag *geo_f;
     struct GModule *module;
-    char *mapset;
     struct Map_info Map, Out;
     struct cat_list *catlist;
     CENTER *Centers = NULL;
@@ -137,13 +136,8 @@
     else
 	geo = 0;
 
-    mapset = G_find_vector2(map->answer, NULL);
-
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), map->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&Map, map->answer, mapset);
+    Vect_open_old(&Map, map->answer, "");
 
     /* Build graph */
     Vect_net_build_graph(&Map, type, afield, nfield, afcol->answer,

Modified: grass/trunk/vector/v.net.iso/main.c
===================================================================
--- grass/trunk/vector/v.net.iso/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net.iso/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -52,7 +52,6 @@
 	*term_opt, *cost_opt;
     struct Flag *geo_f;
     struct GModule *module;
-    char *mapset;
     struct Map_info Map, Out;
     struct cat_list *catlist;
     CENTER *Centers = NULL;
@@ -181,13 +180,8 @@
     else
 	geo = 0;
 
-    mapset = G_find_vector2(map->answer, NULL);
-
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), map->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&Map, map->answer, mapset);
+    Vect_open_old(&Map, map->answer, "");
 
     /* Build graph */
     Vect_net_build_graph(&Map, type, afield, nfield, afcol->answer,

Modified: grass/trunk/vector/v.net.path/main.c
===================================================================
--- grass/trunk/vector/v.net.path/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net.path/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -29,7 +29,6 @@
     struct Option *max_dist, *file_opt;
     struct Flag *geo_f, *segments_f;
     struct GModule *module;
-    char *mapset;
     struct Map_info In, Out;
     int type, afield, nfield, geo;
     double maxdist;
@@ -125,13 +124,8 @@
     Vect_check_input_output_name(input_opt->answer, output_opt->answer,
 				 GV_FATAL_EXIT);
 
-    mapset = G_find_vector2(input_opt->answer, NULL);
-
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), input_opt->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, input_opt->answer, mapset);
+    Vect_open_old(&In, input_opt->answer, "");
 
     Vect_set_fatal_error(GV_FATAL_PRINT);
     if (1 > Vect_open_new(&Out, output_opt->answer, Vect_is_3d(&In))) {

Modified: grass/trunk/vector/v.net.salesman/main.c
===================================================================
--- grass/trunk/vector/v.net.salesman/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net.salesman/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -79,7 +79,6 @@
 	*term_opt;
     struct Flag *geo_f;
     struct GModule *module;
-    char *mapset;
     struct Map_info Map, Out;
     struct ilist *TList;	/* list of terminal nodes */
     struct ilist *List;
@@ -165,13 +164,8 @@
 
     Vect_check_input_output_name(map->answer, output->answer, GV_FATAL_EXIT);
 
-    mapset = G_find_vector2(map->answer, NULL);
-
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), map->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&Map, map->answer, mapset);
+    Vect_open_old(&Map, map->answer, "");
     nnodes = Vect_get_num_nodes(&Map);
 
     /* Create list of terminals based on list of categories */

Modified: grass/trunk/vector/v.net.steiner/main.c
===================================================================
--- grass/trunk/vector/v.net.steiner/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net.steiner/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -326,7 +326,6 @@
 	*term_opt, *nsp_opt;
     struct Flag *geo_f;
     struct GModule *module;
-    char *mapset;
     struct Map_info Map, Out;
     int *testnode;		/* array all nodes: 1 - should be tested as Steiner, 
 				 * 0 - no need to test (unreachable or terminal) */
@@ -422,13 +421,8 @@
 
     Vect_check_input_output_name(map->answer, output->answer, GV_FATAL_EXIT);
 
-    mapset = G_find_vector2(map->answer, NULL);
-
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), map->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&Map, map->answer, mapset);
+    Vect_open_old(&Map, map->answer, "");
     nnodes = Vect_get_num_nodes(&Map);
 
     /* Create list of terminals based on list of categories */

Modified: grass/trunk/vector/v.net.visibility/main.c
===================================================================
--- grass/trunk/vector/v.net.visibility/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.net.visibility/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -29,7 +29,6 @@
     struct GModule *module;	/* GRASS module for parsing arguments */
     struct Option *input, *output;	/* The input map */
     struct Option *coor, *ovis;
-    char *mapset;
 
     struct Point *points;
     struct Line *lines;
@@ -73,33 +72,23 @@
 
     Vect_set_open_level(2);
 
-    mapset = G_find_vector2(input->answer, NULL);	/* finds the map */
+    if (Vect_open_old(&in, input->answer, "") < 1)	/* opens the map */
+	G_fatal_error(_("Unable to open vector map <%s>"), input->answer);
 
-    if (mapset == NULL)
-	G_fatal_error("Vector map <%s> not found", input->answer);
-
-    if (Vect_open_old(&in, input->answer, mapset) < 1)	/* opens the map */
-	G_fatal_error(_("Unable to open vector map <%s>"),
-		      G_fully_qualified_name(input->answer, mapset));
-
     if (Vect_open_new(&out, output->answer, WITHOUT_Z) < 0) {
 	Vect_close(&in);
 	G_fatal_error(_("Unable to create vector map <%s>"), output->answer);
     }
 
     if (ovis->answer != NULL) {
-	mapset = G_find_vector2(ovis->answer, NULL);
+	if (Vect_open_old(&vis, ovis->answer, "") < 1)
+	    G_fatal_error(_("Unable to open vector map <%s>"), ovis->answer);
 
-	if (Vect_open_old(&vis, ovis->answer, mapset) < 1)
-	    G_fatal_error(_("Unable to open vector map <%s>"),
-			  G_fully_qualified_name(ovis->answer, mapset));
-
 	if (Vect_copy_map_lines(&vis, &out) > 0)
 	    G_fatal_error(_("Unable to copy elements from vector map <%s>"),
-			  G_fully_qualified_name(ovis->answer, mapset));
+			  ovis->answer);
     }
 
-
     if (G_projection() == PROJECTION_LL)
 	G_warning(_("Lat-long projection"));
 

Modified: grass/trunk/vector/v.normal/main.c
===================================================================
--- grass/trunk/vector/v.normal/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.normal/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -44,7 +44,6 @@
 
 int main(int argc, char **argv)
 {
-    char *mapset;
     int i, nsites, verbose, warn_once = 0;
     int all;
     long x, y;
@@ -124,11 +123,8 @@
     verbose = (flag.q->answer == (char)NULL) ? 1 : 0;
 
     /* Open input */
-    if ((mapset = G_find_vector2(parm.input->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), parm.input->answer);
-    }
     Vect_set_open_level(2);
-    Vect_open_old(&Map, parm.input->answer, mapset);
+    Vect_open_old(&Map, parm.input->answer, "");
 
     /* Read attributes */
     Fi = Vect_get_field(&Map, 1);

Modified: grass/trunk/vector/v.out.dxf/main.c
===================================================================
--- grass/trunk/vector/v.out.dxf/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.out.dxf/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -38,7 +38,7 @@
 {
     int nlines;
     double textsize;
-    char *mapset, *dxf_file;
+    char *dxf_file;
     struct Map_info In;
     struct GModule *module;
     struct Option *input, *output;
@@ -56,7 +56,7 @@
     output = G_define_option();
     output->key = "output";
     output->type = TYPE_STRING;
-    output->required = NO;
+    output->required = YES;
     output->multiple = NO;
     output->gisprompt = "new_file,file,output";
     output->description = _("DXF output file");
@@ -67,24 +67,10 @@
     overwrite = module->overwrite;
 
     /* open input vector */
-    if ((mapset = G_find_vector2(input->answer, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), input->answer);
+    dxf_file = G_store(output->answer);
 
-    if (output->answer)
-	dxf_file = G_store(output->answer);
-    else {
-	char fname[GNAME_MAX];
-	char fmapset[GMAPSET_MAX];
-
-	dxf_file = G_malloc(strlen(input->answer) + 5);
-	if (G__name_is_fully_qualified(input->answer, fname, fmapset))
-	    sprintf(dxf_file, "%s.dxf", fname);
-	else
-	    sprintf(dxf_file, "%s.dxf", input->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, input->answer, mapset);
+    Vect_open_old(&In, input->answer, "");
 
     dxf_open(dxf_file);		/* open output */
 

Modified: grass/trunk/vector/v.out.ogr/main.c
===================================================================
--- grass/trunk/vector/v.out.ogr/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.out.ogr/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -39,7 +39,6 @@
 int main(int argc, char *argv[])
 {
     int i, j, k, centroid, otype, donocat;
-    char *mapset;
     int field;
     struct GModule *module;
     struct Option *in_opt, *dsn_opt, *layer_opt, *type_opt, *frmt_opt,
@@ -207,12 +206,8 @@
     Cats = Vect_new_cats_struct();
 
     /* open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     /* fetch PROJ info */
     G_get_default_window(&cellhd);

Modified: grass/trunk/vector/v.out.pov/main.c
===================================================================
--- grass/trunk/vector/v.out.pov/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.out.pov/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -23,7 +23,6 @@
 int main(int argc, char *argv[])
 {
     int i, j, centroid, otype, count;
-    char *mapset;
     int field = 1;
     struct GModule *module;
     struct Option *in_opt, *out_opt, *type_opt;
@@ -92,12 +91,8 @@
     Cats = Vect_new_cats_struct();
 
     /* open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     /* Open output file */
     if ((fd = fopen(out_opt->answer, "w")) == NULL) {

Modified: grass/trunk/vector/v.out.svg/main.c
===================================================================
--- grass/trunk/vector/v.out.svg/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.out.svg/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -46,7 +46,6 @@
     int do_attr = 0, attr_cols[8], attr_size = 0, db_open = 0, cnt = 0;
 
     double width, radius;
-    char *mapset;
     struct Option *in_opt, *out_opt, *prec_opt, *type_opt, *attr_opt,
 	*field_opt;
     struct GModule *module;
@@ -123,12 +122,8 @@
     field = atoi(field_opt->answer);
 
     /* open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     /* open db-driver to attribs */
     db_init_string(&dbstring);

Modified: grass/trunk/vector/v.overlay/main.c
===================================================================
--- grass/trunk/vector/v.overlay/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.overlay/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -29,7 +29,6 @@
 {
     int i, input, line, nlines, operator;
     int type[2], field[2], ofield[3];
-    char *mapset[2];
     char *pre[2];
     struct GModule *module;
     struct Option *in_opt[2], *out_opt, *type_opt[2], *field_opt[2],
@@ -193,14 +192,8 @@
 	G_message(_("Copying vector objects from vector map <%s>..."),
 		  in_opt[input]->answer);
 
-	if ((mapset[input] =
-	     G_find_vector2(in_opt[input]->answer, NULL)) == NULL) {
-	    G_fatal_error(_("Vector map <%s> not found"),
-			  in_opt[input]->answer);
-	}
-
 	Vect_set_open_level(2);
-	Vect_open_old(&(In[input]), in_opt[input]->answer, mapset[input]);
+	Vect_open_old(&(In[input]), in_opt[input]->answer, "");
 
 	nlines = Vect_get_num_lines(&(In[input]));
 

Modified: grass/trunk/vector/v.patch/main.c
===================================================================
--- grass/trunk/vector/v.patch/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.patch/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -295,8 +295,7 @@
 	int add_cat;
 
 	in_name = old->answers[i++];
-	G_important_message(_("Patching vector map <%s@%s>..."), in_name,
-			    G_find_vector2(in_name, ""));
+	G_important_message(_("Patching vector map <%s>..."), in_name);
 	if (bbox_name)
 	    Vect_set_open_level(2);	/* needed for Vect_map_box() */
 	else

Modified: grass/trunk/vector/v.perturb/main.c
===================================================================
--- grass/trunk/vector/v.perturb/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.perturb/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -42,7 +42,6 @@
 
 int main(int argc, char **argv)
 {
-    char *mapset;
     double p1, p2, numbers[1000], numbers2[1000];
     int (*rng) ();
     int i, verbose;
@@ -150,11 +149,8 @@
     G_get_window(&window);
 
     /* Open input */
-    if ((mapset = G_find_vector2(parm.in->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), parm.in->answer);
-    }
     Vect_set_open_level(2);
-    Vect_open_old(&In, parm.in->answer, mapset);
+    Vect_open_old(&In, parm.in->answer, "");
 
     /* Open output */
     Vect_open_new(&Out, parm.out->answer, 0);	/* TODO add z support ? */

Modified: grass/trunk/vector/v.qcount/main.c
===================================================================
--- grass/trunk/vector/v.qcount/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.qcount/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -43,7 +43,6 @@
 
 int main(int argc, char **argv)
 {
-    char *mapset;
     double radius;
     double fisher, david, douglas, lloyd, lloydip, morisita;
     int i, nquads, *counts;
@@ -110,11 +109,8 @@
     G_get_window(&window);
 
     /* Open input */
-    if ((mapset = G_find_vector2(parm.input->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), parm.input->answer);
-    }
     Vect_set_open_level(2);
-    Vect_open_old(&Map, parm.input->answer, mapset);
+    Vect_open_old(&Map, parm.input->answer, "");
 
     /* Get the quadrats */
     G_message(_("Finding quadrats..."));

Modified: grass/trunk/vector/v.reclass/main.c
===================================================================
--- grass/trunk/vector/v.reclass/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.reclass/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -48,7 +48,7 @@
     /*    struct Flag *d_flag; */
     struct Option *in_opt, *out_opt, *type_opt, *field_opt, *rules_opt,
 	*col_opt;
-    char *mapset, *key, *data, buf[1024];
+    char *key, *data, buf[1024];
     int rclelem, type, field;
     struct Map_info In, Out;
 
@@ -102,11 +102,8 @@
     Vect_check_input_output_name(in_opt->answer, out_opt->answer,
 				 GV_FATAL_EXIT);
 
-    mapset = G_find_vector2(in_opt->answer, NULL);
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     Vect_open_new(&Out, out_opt->answer, Vect_is_3d(&In));
     Vect_copy_head_data(&In, &Out);

Modified: grass/trunk/vector/v.sample/main.c
===================================================================
--- grass/trunk/vector/v.sample/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.sample/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -50,7 +50,6 @@
 
 int main(int argc, char **argv)
 {
-    char *mapset;
     double scale, predicted, actual;
     INTERP_TYPE method = UNKNOWN;
     int fdrast;			/* file descriptor for raster map is int */
@@ -143,16 +142,10 @@
     G_get_window(&window);
 
     /* Open input */
-    if ((mapset = G_find_vector2(parm.input->answer, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), parm.input->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, parm.input->answer, mapset);
+    Vect_open_old(&In, parm.input->answer, "");
 
-    if ((mapset = G_find_cell2(parm.rast->answer, "")) == NULL)
-	G_fatal_error(_("Raster map <%s> not found"), parm.rast->answer);
-
-    if ((fdrast = G_open_cell_old(parm.rast->answer, mapset)) < 0)
+    if ((fdrast = G_open_cell_old(parm.rast->answer, "")) < 0)
 	G_fatal_error(_("Unable to open raster map <%s>"), parm.rast->answer);
 
     /* Read attributes */

Modified: grass/trunk/vector/v.segment/main.c
===================================================================
--- grass/trunk/vector/v.segment/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.segment/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -41,7 +41,7 @@
     struct Option *in_opt, *out_opt;
     struct Option *lfield_opt, *file_opt;
     struct GModule *module;
-    char *mapset, buf[2000];
+    char buf[2000];
     struct Map_info In, Out;
     struct line_cats *LCats, *SCats;
     struct line_pnts *LPoints, *SPoints, *PlPoints;
@@ -94,11 +94,8 @@
     }
 
     /* Open input lines */
-    mapset = G_find_vector2(in_opt->answer, NULL);
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     /* Open output segments */
     Vect_open_new(&Out, out_opt->answer, Vect_is_3d(&In));

Modified: grass/trunk/vector/v.select/main.c
===================================================================
--- grass/trunk/vector/v.select/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.select/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -111,7 +111,7 @@
     int aline, nalines;
     int type[2], field[2];
     int **cats, *ncats, nfields, *fields;
-    char *mapset[2], *pre[2];
+    char *pre[2];
     struct GModule *module;
     struct Option *in_opt[2], *out_opt, *type_opt[2], *field_opt[2],
 	*operator_opt;
@@ -183,14 +183,8 @@
 	Vect_check_input_output_name(in_opt[input]->answer, out_opt->answer,
 				     GV_FATAL_EXIT);
 
-	if ((mapset[input] =
-	     G_find_vector2(in_opt[input]->answer, NULL)) == NULL) {
-	    G_fatal_error(_("Vector map <%s> not found"),
-			  in_opt[input]->answer);
-	}
-
 	Vect_set_open_level(2);
-	Vect_open_old(&(In[input]), in_opt[input]->answer, mapset[input]);
+	Vect_open_old(&(In[input]), in_opt[input]->answer, "");
     }
 
     /* Read field info */

Modified: grass/trunk/vector/v.support/main.c
===================================================================
--- grass/trunk/vector/v.support/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.support/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -26,7 +26,6 @@
 int main(int argc, char *argv[])
 {
     struct Map_info Map;
-    char *mapset;
     struct GModule *module;
     struct Option *map, *organization, *date, *person, *map_name, *map_date,
 	*scale, *comment, *zone, *thresh, *cmdhist;
@@ -125,13 +124,8 @@
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    if ((mapset = G_find_vector2(map->answer, G_mapset())) == NULL)
-	G_fatal_error(_("Vector map <%s> not found in the current mapset"),
-		      map->answer);
-
     Vect_set_open_level(2);
-
-    if (1 > Vect_open_old(&Map, map->answer, mapset))
+    if (Vect_open_old(&Map, map->answer, "") < 1)
 	G_fatal_error(_("Unable to open vector map <%s>"), map->answer);
 
     /* modify 'head' file */

Modified: grass/trunk/vector/v.surf.rst/main.c
===================================================================
--- grass/trunk/vector/v.surf.rst/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.surf.rst/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -50,86 +50,73 @@
 #define SCIK2 1			/*100000 */
 #define SCIK3 1			/*100000 */
 
-double /* pargr */ ns_res, ew_res;
-double dmin, dmax, ertre;
-int KMAX2, KMIN, KMAX, totsegm, deriv, dtens, cv;
-struct Map_info Map;
-struct Map_info TreeMap, OverMap;
-struct Categories cats;
+static double /* pargr */ ns_res, ew_res;
+static double dmin, dmax, ertre;
+static int KMAX2, KMIN, KMAX, totsegm, deriv, dtens, cv;
+static struct Map_info Map;
+static struct Map_info TreeMap, OverMap;
 
-struct interp_params params;
-struct tree_info *info;
+static struct interp_params params;
+static struct tree_info *info;
 
-void clean_fatal_error();
+static void create_temp_files(void);
+static void clean(void);
 
-double *az = NULL, *adx = NULL, *ady = NULL, *adxx = NULL, *adyy = NULL,
+static double *az = NULL, *adx = NULL, *ady = NULL, *adxx = NULL, *adyy = NULL,
     *adxy = NULL;
-double /* error */ ertot, ertre, zminac, zmaxac, zmult;
+static double /* error */ ertot, ertre, zminac, zmaxac, zmult;
 struct multtree *root;
 
-int total = 0;
-int NPOINT = 0;
-int OUTRANGE = 0;
-int NPT = 0;
+static int NPOINT = 0;
 
-double DETERM;
-int NERROR, cond1, cond2;
-char fncdsm[32];
-char filnam[10];
+static int cond1, cond2;
 
-char *treefile = NULL;
-char *overfile = NULL;
+static char *treefile = NULL;
+static char *overfile = NULL;
 
-FILE *fdinp, *fdredinp, *fdzout, *fddxout, *fddyout, *fdxxout, *fdyyout,
-    *fd4, *fxyout, *fddevi = NULL, *fdcvdev = NULL;
+static FCELL *zero_array_cell;
 
-FCELL *zero_array_cell;
+static char *input;
+static int field;
+static char *zcol;
+static char *scol;
+static char *wheresql;
+static char *elev = NULL;
+static char *slope = NULL;
+static char *aspect = NULL;
+static char *pcurv = NULL;
+static char *tcurv = NULL;
+static char *mcurv = NULL;
+static char *maskmap = NULL;
+static char *devi = NULL;
+static char *cvdev = NULL;
+static int sdisk, disk, ddisk, sddisk;
+static FILE *Tmp_fd_z = NULL;
+static char *Tmp_file_z = NULL;
+static FILE *Tmp_fd_dx = NULL;
+static char *Tmp_file_dx = NULL;
+static FILE *Tmp_fd_dy = NULL;
+static char *Tmp_file_dy = NULL;
+static FILE *Tmp_fd_xx = NULL;
+static char *Tmp_file_xx = NULL;
+static FILE *Tmp_fd_yy = NULL;
+static char *Tmp_file_yy = NULL;
+static FILE *Tmp_fd_xy = NULL;
+static char *Tmp_file_xy = NULL;
 
-char *input;
-int field;
-char *zcol;
-char *scol;
-char *wheresql;
-char *mapset = NULL;
-char *mapset1 = NULL;
-char *elev = NULL;
-char *slope = NULL;
-char *aspect = NULL;
-char *pcurv = NULL;
-char *tcurv = NULL;
-char *mcurv = NULL;
-char *maskmap = NULL;
-char *redinp = NULL;
-char *devi = NULL;
-char *cvdev = NULL;
-int sdisk, disk, ddisk, sddisk;
-FILE *Tmp_fd_z = NULL;
-char *Tmp_file_z = NULL;
-FILE *Tmp_fd_dx = NULL;
-char *Tmp_file_dx = NULL;
-FILE *Tmp_fd_dy = NULL;
-char *Tmp_file_dy = NULL;
-FILE *Tmp_fd_xx = NULL;
-char *Tmp_file_xx = NULL;
-FILE *Tmp_fd_yy = NULL;
-char *Tmp_file_yy = NULL;
-FILE *Tmp_fd_xy = NULL;
-char *Tmp_file_xy = NULL;
+static double gmin, gmax, c1min, c1max, c2min, c2max, fi, rsm;
+static double xmin, xmax, ymin, ymax, zmin, zmax;
+static double theta, scalex;
 
-double gmin, gmax, c1min, c1max, c2min, c2max, fi, rsm;
-double xmin, xmax, ymin, ymax, zmin, zmax;
-double theta, scalex;
+static struct BM *bitmask;
+static struct Cell_head cellhd;
 
-struct BM *bitmask;
-struct Cell_head cellhd;
+static int n_rows, n_cols;
 
-char msg[1024];
-
-
 int main(int argc, char *argv[])
 {
     int per, npmin;
-    int ii, i, n_rows, n_cols;
+    int ii;
     double x_orig, y_orig, dnorm, deltx, delty, xm, ym;
     char dmaxchar[200];
     char dminchar[200];
@@ -514,10 +501,7 @@
     if ((info = MT_tree_info_new(root, functions, dmin, KMAX)) == NULL)
 	G_fatal_error(_("Cannot create tree info"));
 
-    if ((mapset = G_find_vector2(input, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), input);
-
-    open_check = Vect_open_old(&Map, input, mapset);
+    open_check = Vect_open_old(&Map, input, "");
     if (open_check < 1)
 	G_fatal_error(_("Unable to open vector map <%s>"), input);
     /*    if (open_check < 2)
@@ -572,83 +556,9 @@
     ertot = 0.;
     if (per)
 	G_message(_("Percent complete: "));
-    if (elev != NULL)
-	Tmp_file_z = G_tempfile();
-    if (slope != NULL)
-	Tmp_file_dx = G_tempfile();
-    if (aspect != NULL)
-	Tmp_file_dy = G_tempfile();
-    if (pcurv != NULL)
-	Tmp_file_xx = G_tempfile();
-    if (tcurv != NULL)
-	Tmp_file_yy = G_tempfile();
-    if (mcurv != NULL)
-	Tmp_file_xy = G_tempfile();
 
-    zero_array_cell = (FCELL *) G_malloc(sizeof(FCELL) * n_cols);
-    if (!zero_array_cell)
-	G_fatal_error(_("Not enough memory for zero_array_cell"));
+    create_temp_files();
 
-    for (i = 0; i < n_cols; i++) {
-	zero_array_cell[i] = (FCELL) 0;
-    }
-
-    if (Tmp_file_z != NULL) {
-	if (NULL == (Tmp_fd_z = fopen(Tmp_file_z, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"),
-			  Tmp_file_z);
-	for (i = 0; i < n_rows; i++) {
-	    if (!(fwrite(zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_z)))
-		G_fatal_error(_("Not enough disk space -- cannot write files"));
-	}
-    }
-    if (Tmp_file_dx != NULL) {
-	if (NULL == (Tmp_fd_dx = fopen(Tmp_file_dx, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"),
-			  Tmp_file_dx);
-	for (i = 0; i < n_rows; i++) {
-	    if (!(fwrite(zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_dx)))
-		G_fatal_error(_("Not enough disk space -- cannot write files"));
-	}
-    }
-    if (Tmp_file_dy != NULL) {
-	if (NULL == (Tmp_fd_dy = fopen(Tmp_file_dy, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"),
-			  Tmp_file_dy);
-	for (i = 0; i < n_rows; i++) {
-	    if (!(fwrite(zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_dy)))
-		G_fatal_error(_("Not enough disk space -- cannot write files"));
-	}
-    }
-
-    if (Tmp_file_xx != NULL) {
-	if (NULL == (Tmp_fd_xx = fopen(Tmp_file_xx, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"),
-			  Tmp_file_xx);
-	for (i = 0; i < n_rows; i++) {
-	    if (!(fwrite(zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_xx)))
-		G_fatal_error(_("Not enough disk space -- cannot write files"));
-	}
-    }
-    if (Tmp_file_yy != NULL) {
-	if (NULL == (Tmp_fd_yy = fopen(Tmp_file_yy, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"),
-			  Tmp_file_yy);
-	for (i = 0; i < n_rows; i++) {
-	    if (!(fwrite(zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_yy)))
-		G_fatal_error(_("Not enough disk space -- cannot write files"));
-	}
-    }
-    if (Tmp_file_xy != NULL) {
-	if (NULL == (Tmp_fd_xy = fopen(Tmp_file_xy, "w+")))
-	    G_fatal_error(_("Unable to open temporary file <%s>"),
-			  Tmp_file_xy);
-	for (i = 0; i < n_rows; i++) {
-	    if (!(fwrite(zero_array_cell, sizeof(FCELL), n_cols, Tmp_fd_xy)))
-		G_fatal_error(_("Not enough disk space -- cannot write files"));
-	}
-    }
-
     IL_init_params_2d(&params, NULL, 1, 1, zmult, KMIN, KMAX, maskmap, n_rows,
 		      n_cols, az, adx, ady, adxx, adyy, adxy, fi, KMAX2,
 		      SCIK1, SCIK2, SCIK3, rsm, elev, slope, aspect, pcurv,
@@ -665,16 +575,18 @@
 	IL_vector_input_data_2d(&params, &Map, field, zcol, scol,
 				info, &xmin, &xmax,
 				&ymin, &ymax, &zmin, &zmax, &NPOINT, &dmax);
-    if (totsegm <= 0)
-	clean_fatal_error(_("Input failed"));
+    if (totsegm <= 0) {
+	clean();
+	G_fatal_error(_("Input failed"));
+    }
 
     /*Vect_set_release_support(&Map); */
     Vect_close(&Map);
 
     if (treefile != NULL) {
 	if (0 > Vect_open_new(&TreeMap, treefile, 0)) {
-	    sprintf(msg, _("Unable to open vector map <%s>"), treefile);
-	    clean_fatal_error(msg);
+	    clean();
+	    G_fatal_error(_("Unable to open vector map <%s>"), treefile);
 	}
 	Vect_hist_command(&TreeMap);
 
@@ -717,8 +629,10 @@
     }
 
     bitmask = IL_create_bitmask(&params);
-    if (totsegm <= 0)
-	clean_fatal_error(_("Input failed"));
+    if (totsegm <= 0) {
+	clean();
+	G_fatal_error(_("Input failed"));
+    }
 
     ertot = 0.;
     if (per)
@@ -726,10 +640,11 @@
     if (IL_interp_segments_2d(&params, info, info->root, bitmask,
 			      zmin, zmax, &zminac, &zmaxac, &gmin, &gmax,
 			      &c1min, &c1max, &c2min, &c2max, &ertot, totsegm,
-			      n_cols, dnorm) < 0)
+			      n_cols, dnorm) < 0) {
+	clean();
+	G_fatal_error(_("Interp_segmets failed"));
+    }
 
-	clean_fatal_error(_("Interp_segmets failed"));
-
     G_free_vector(az);
     if (cond1) {
 	G_free_vector(adx);
@@ -743,9 +658,11 @@
     ii = IL_output_2d(&params, &cellhd, zmin, zmax, zminac, zmaxac, c1min,
 		      c1max, c2min, c2max, gmin, gmax, ertot, input, dnorm,
 		      dtens, 1, NPOINT);
-    if (ii < 0)
-	clean_fatal_error
-	    (_("Cannot write raster maps -- try to increase resolution"));
+    if (ii < 0) {
+	clean();
+	G_fatal_error(_("Cannot write raster maps -- try to increase resolution"));
+    }
+
     G_free(zero_array_cell);
     if (elev != NULL)
 	fclose(Tmp_fd_z);
@@ -762,8 +679,8 @@
 
     if (overfile != NULL) {
 	if (0 > Vect_open_new(&OverMap, overfile, 0)) {
-	    sprintf(msg, _("Unable to open vector map <%s>"), overfile);
-	    clean_fatal_error(msg);
+	    clean();
+	    G_fatal_error(_("Unable to open vector map <%s>"), overfile);
 	}
 	Vect_hist_command(&OverMap);
 
@@ -835,8 +752,10 @@
 	xarray[2] = xarray[3];
 	yarray[4] = yarray[0];
 	xarray[4] = xarray[0];
-	if (0 > Vect_copy_xyz_to_pnts(Points, xarray, yarray, zarray, 5))
-	    clean_fatal_error(_("Out of memory"));
+	if (Vect_copy_xyz_to_pnts(Points, xarray, yarray, zarray, 5) < 0) {
+	    clean();
+	    G_fatal_error(_("Out of memory"));
+	}
 	Vect_write_line(Map, (unsigned int)type, Points, Cats);
 
 	G_free(Points);
@@ -844,33 +763,55 @@
     return 1;
 }
 
+static FILE *create_temp_file(const char *name, char **tmpname)
+{
+    FILE *fp;
+    char *tmp;
+    int i;
 
+    if (!name)
+	return NULL;
 
-void clean_fatal_error(char *str)
-{
-    if (Tmp_fd_z) {
-	fclose(Tmp_fd_z);
-	unlink(Tmp_file_z);
+    *tmpname = tmp = G_tempfile();
+    fp = fopen(tmp, "w+");
+    if (!fp)
+	G_fatal_error(_("Unable to open temporary file <%s>"), tmpname);
+
+    for (i = 0; i < n_rows; i++) {
+	if (fwrite(zero_array_cell, sizeof(FCELL), n_cols, fp) != n_cols) {
+	    clean();
+	    G_fatal_error(_("Error writing temporary file <%s>"), tmpname);
+	}
     }
-    if (Tmp_fd_dx) {
-	fclose(Tmp_fd_dx);
-	unlink(Tmp_file_dx);
-    }
-    if (Tmp_fd_dy) {
-	fclose(Tmp_fd_dy);
-	unlink(Tmp_file_dy);
-    }
-    if (Tmp_fd_xx) {
-	fclose(Tmp_fd_xx);
-	unlink(Tmp_file_xx);
-    }
-    if (Tmp_fd_yy) {
-	fclose(Tmp_fd_yy);
-	unlink(Tmp_file_yy);
-    }
-    if (Tmp_fd_xy) {
-	fclose(Tmp_fd_xy);
-	unlink(Tmp_file_xy);
-    }
-    G_fatal_error(str);
+
+    return fp;
 }
+
+static void create_temp_files(void)
+{
+    zero_array_cell = (FCELL *) G_calloc(n_cols, sizeof(FCELL));
+
+    Tmp_fd_z  = create_temp_file(elev,   &Tmp_file_z );
+    Tmp_fd_dx = create_temp_file(slope,  &Tmp_file_dx);
+    Tmp_fd_dy = create_temp_file(aspect, &Tmp_file_dy);
+    Tmp_fd_xx = create_temp_file(pcurv,  &Tmp_file_xx);
+    Tmp_fd_yy = create_temp_file(tcurv,  &Tmp_file_yy);
+    Tmp_fd_xy = create_temp_file(mcurv,  &Tmp_file_xy);
+}
+
+static void clean(void)
+{
+    if (Tmp_fd_z)	fclose(Tmp_fd_z);
+    if (Tmp_fd_dx)	fclose(Tmp_fd_dx);
+    if (Tmp_fd_dy)	fclose(Tmp_fd_dy);
+    if (Tmp_fd_xx)	fclose(Tmp_fd_xx);
+    if (Tmp_fd_yy)	fclose(Tmp_fd_yy);
+    if (Tmp_fd_xy)	fclose(Tmp_fd_xy);
+
+    if (Tmp_file_z)	unlink(Tmp_file_z);
+    if (Tmp_file_dx)	unlink(Tmp_file_dx);
+    if (Tmp_file_dy)	unlink(Tmp_file_dy);
+    if (Tmp_file_xx)	unlink(Tmp_file_xx);
+    if (Tmp_file_yy)	unlink(Tmp_file_yy);
+    if (Tmp_file_xy)	unlink(Tmp_file_xy);
+}

Modified: grass/trunk/vector/v.surf.rst/surf.h
===================================================================
--- grass/trunk/vector/v.surf.rst/surf.h	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.surf.rst/surf.h	2008-08-31 21:30:54 UTC (rev 33177)
@@ -33,4 +33,3 @@
 #define ZMULT   "1.0"
 
 int print_tree(struct multtree *, double, double, struct Map_info *);
-void clean_fatal_error(char *);

Modified: grass/trunk/vector/v.to.db/global.h
===================================================================
--- grass/trunk/vector/v.to.db/global.h	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.db/global.h	2008-08-31 21:30:54 UTC (rev 33177)
@@ -21,7 +21,6 @@
 struct options
 {
     char *name;
-    char *mapset;
     int field;
     char *col[3];
     char *qcol;

Modified: grass/trunk/vector/v.to.db/main.c
===================================================================
--- grass/trunk/vector/v.to.db/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.db/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -43,7 +43,7 @@
 
     /* open map */
     Vect_set_open_level(2);
-    Vect_open_old(&Map, options.name, options.mapset);
+    Vect_open_old(&Map, options.name, "");
 
     Fi = Vect_get_field(&Map, options.field);
 

Modified: grass/trunk/vector/v.to.db/parse.c
===================================================================
--- grass/trunk/vector/v.to.db/parse.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.db/parse.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -114,11 +114,7 @@
     options.total = flags.t->answer;
 
     options.name = parms.vect->answer;
-    options.mapset = G_find_vector2(options.name, NULL);
 
-    if (options.mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), options.name);
-
     options.type = Vect_option_to_types(parms.type);
     options.field = atoi(parms.field->answer);
     options.qfield = atoi(parms.qfield->answer);

Modified: grass/trunk/vector/v.to.points/main.c
===================================================================
--- grass/trunk/vector/v.to.points/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.points/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -161,7 +161,6 @@
     struct Option *in_opt, *out_opt, *type_opt, *dmax_opt, *lfield_opt;
     struct Flag *inter_flag, *vertex_flag, *table_flag, *node_flag;
     struct GModule *module;
-    char *mapset;
     struct Map_info In, Out;
     struct line_cats *LCats;
     struct line_pnts *LPoints;
@@ -239,12 +238,8 @@
 				 GV_FATAL_EXIT);
 
     /* Open input lines */
-    mapset = G_find_vector2(in_opt->answer, NULL);
-    if (mapset == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     /* Open output segments */
     Vect_open_new(&Out, out_opt->answer, Vect_is_3d(&In));

Modified: grass/trunk/vector/v.to.rast/local.h
===================================================================
--- grass/trunk/vector/v.to.rast/local.h	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.rast/local.h	2008-08-31 21:30:54 UTC (rev 33177)
@@ -44,15 +44,15 @@
 int set_dcat(DCELL);
 
 /* support.c */
-int update_hist(char *, char *, char *, long);
-int update_colors(char *);
-int update_dbcolors(char *, char *, int, char *, int, char *);
-int update_labels(char *, char *, int, char *, int, int, char *);
-int update_cats(char *);
-int update_fcolors(char *raster_name);
+int update_hist(const char *, const char *, long);
+int update_colors(const char *);
+int update_dbcolors(const char *, const char *, int, const char *, int, const char *);
+int update_labels(const char *, const char *, int, const char *, int, int, const char *);
+int update_cats(const char *);
+int update_fcolors(const char *);
 
 /* vect2rast.c */
-int vect_to_rast(char *, char *, int, char *, int, int, double, int, char *,
-		 char *, int);
+int vect_to_rast(const char *, const char *, int, const char *, int, int,
+		 double, int, const char *, const char *, int);
 
 #endif

Modified: grass/trunk/vector/v.to.rast/support.c
===================================================================
--- grass/trunk/vector/v.to.rast/support.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.rast/support.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -14,8 +14,7 @@
 #include "local.h"
 
 
-int update_hist(char *raster_name, char *vector_name,
-		char *vector_mapset, long scale)
+int update_hist(const char *raster_name, const char *vector_name, long scale)
 {
     struct History hist;
 
@@ -28,8 +27,7 @@
     strcpy(hist.title, raster_name);
 
     /* store information from digit file into history */
-    sprintf(hist.datsrc_1, "Vector Map: %s in mapset %s", vector_name,
-	    vector_mapset);
+    sprintf(hist.datsrc_1, "Vector Map: %s", vector_name);
     sprintf(hist.datsrc_2, "Original scale from vector map: 1:%ld", scale);	/* 4.0 */
 
     /* store command line options */
@@ -39,7 +37,7 @@
 }
 
 
-int update_colors(char *raster_name)
+int update_colors(const char *raster_name)
 {
     struct Range range;
     struct Colors colors;
@@ -54,7 +52,7 @@
 }
 
 
-int update_fcolors(char *raster_name)
+int update_fcolors(const char *raster_name)
 {
     struct FPRange range;
     struct Colors colors;
@@ -69,22 +67,21 @@
 }
 
 
-int update_cats(char *raster_name)
+int update_cats(const char *raster_name)
 {
     /* TODO: maybe attribute transfer from vector map? 
        Use G_set_raster_cat() somewhere */
 
     struct Categories cats;
 
-    G_strip(raster_name);
     G_init_cats((CELL) 0, raster_name, &cats);
     G_write_cats(raster_name, &cats);
 
     return 0;
 }
 
-int update_dbcolors(char *rast_name, char *vector_map, int field,
-		    char *rgb_column, int is_fp, char *attr_column)
+int update_dbcolors(const char *rast_name, const char *vector_map, int field,
+		    const char *rgb_column, int is_fp, const char *attr_column)
 {
     int i;
 
@@ -119,7 +116,7 @@
     G_init_colors(&colors);
 
     /* open vector map and database driver */
-    Vect_open_old(&Map, vector_map, G_find_vector2(vector_map, ""));
+    Vect_open_old(&Map, vector_map, "");
 
     db_CatValArray_init(&cvarr);
     if ((Fi = Vect_get_field(&Map, field)) == NULL)
@@ -231,8 +228,9 @@
 
 
 /* add labels to raster cells */
-int update_labels(char *rast_name, char *vector_map, int field,
-		  char *label_column, int use, int val, char *attr_column)
+int update_labels(const char *rast_name, const char *vector_map, int field,
+		  const char *label_column, int use, int val,
+		  const char *attr_column)
 {
     int i;
     int fd;
@@ -414,15 +412,12 @@
 	    struct Cell_stats stats;
 	    CELL n;
 	    RASTER_MAP_TYPE map_type;
-	    char *mapset;
 	    long count;
 
-	    mapset = G_mapset();
-
-	    if (!(fd = G_open_cell_old(rast_name, mapset)))
+	    if (!(fd = G_open_cell_old(rast_name, G_mapset())))
 		G_fatal_error(_("Unable to open raster map <%s>"), rast_name);
 
-	    map_type = G_raster_map_type(rast_name, mapset);
+	    map_type = G_raster_map_type(rast_name, G_mapset());
 
 	    if (!(rowbuf = G_allocate_raster_buf(map_type)))
 		G_fatal_error(_("Cannot allocate memory for row buffer"));
@@ -456,12 +451,10 @@
 	{
 	    DCELL fmin, fmax;
 	    RASTER_MAP_TYPE map_type;
-	    char *mapset;
 	    int i;
 	    char msg[64];
 
-	    mapset = G_mapset();
-	    map_type = G_raster_map_type(rast_name, mapset);
+	    map_type = G_raster_map_type(rast_name, G_mapset());
 	    G_set_raster_cats_title("Degrees", &rast_cats);
 
 	    for (i = 1; i <= 360; i++) {

Modified: grass/trunk/vector/v.to.rast/vect2rast.c
===================================================================
--- grass/trunk/vector/v.to.rast/vect2rast.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.to.rast/vect2rast.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -6,14 +6,14 @@
 #include "local.h"
 
 
-int vect_to_rast(char *vector_map, char *raster_map, int field, char *column,
-		 int nrows, int use, double value, int value_type,
-		 char *rgbcolumn, char *labelcolumn, int ftype)
+int vect_to_rast(const char *vector_map, const char *raster_map, int field,
+		 const char *column, int nrows, int use, double value,
+		 int value_type, const char *rgbcolumn, const char *labelcolumn,
+		 int ftype)
 {
 #ifdef DEBUG
     int i;
 #endif
-    char *vector_mapset;
     struct Map_info Map;
     struct line_pnts *Points;
     int fd;			/* for raster map */
@@ -33,12 +33,9 @@
 
     nareas = 0;
 
-    if ((vector_mapset = G_find_vector2(vector_map, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), vector_map);
-
     G_debug(1, "Loading vector information...");
     Vect_set_open_level(2);
-    Vect_open_old(&Map, vector_map, vector_mapset);
+    Vect_open_old(&Map, vector_map, "");
 
     if ((use == USE_Z) && !(Vect_is_3d(&Map)))
 	G_fatal_error(_("Vector map <%s> is not 3D"),
@@ -201,7 +198,7 @@
 
     G_debug(1, "Creating support files for raster map...");
     G_close_cell(fd);
-    update_hist(raster_map, vector_map, vector_mapset, Map.head.orig_scale);
+    update_hist(raster_map, vector_map, Map.head.orig_scale);
 
     /* colors */
     if (rgbcolumn) {

Modified: grass/trunk/vector/v.transform/main.c
===================================================================
--- grass/trunk/vector/v.transform/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.transform/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -63,7 +63,7 @@
 	*xscale, *yscale, *zscale, *zrot, *columns, *table, *field;
     struct Flag *quiet_flag, *tozero_flag, *shift_flag, *print_mat_flag;
 
-    char *mapset, mon[4], date[40], buf[1000];
+    char mon[4], date[40], buf[1000];
     struct Map_info Old, New;
     int day, yr;
     BOUND_BOX box;
@@ -244,11 +244,8 @@
     }
 
     /* open vector maps */
-    if ((mapset = G_find_vector2(vold->answer, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), vold->answer);
+    Vect_open_old(&Old, vold->answer, "");
 
-    Vect_open_old(&Old, vold->answer, mapset);
-
     Vect_open_new(&New, vnew->answer, Vect_is_3d(&Old) || zshift->answer);
 
     /* copy and set header */

Modified: grass/trunk/vector/v.type/main.c
===================================================================
--- grass/trunk/vector/v.type/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.type/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -30,7 +30,6 @@
     static struct line_pnts *Points;
     struct line_cats *Cats;
     int type;
-    char *mapset;
     struct GModule *module;
 
 #ifdef FOR_GRASS7
@@ -198,12 +197,8 @@
     Cats = Vect_new_cats_struct();
 
     /* open input vector */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(1);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     Vect_set_fatal_error(GV_FATAL_PRINT);
     if (0 > Vect_open_new(&Out, out_opt->answer, Vect_is_3d(&In))) {

Modified: grass/trunk/vector/v.univar/main.c
===================================================================
--- grass/trunk/vector/v.univar/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.univar/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -31,7 +31,6 @@
     struct Option *map_opt, *type_opt, *field_opt, *col_opt, *where_opt,
 	*percentile;
     struct Flag *shell_flag, *extended;
-    char *mapset;
     struct Map_info Map;
     struct field_info *Fi;
     dbDriver *Driver;
@@ -112,11 +111,8 @@
     Cats = Vect_new_cats_struct();
 
     /* open input vector */
-    if ((mapset = G_find_vector2(map_opt->answer, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), map_opt->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&Map, map_opt->answer, mapset);
+    Vect_open_old(&Map, map_opt->answer, "");
 
     /* Check if types are compatible */
     if ((otype & GV_POINTS) && ((otype & GV_LINES) || (otype & GV_AREA)))

Modified: grass/trunk/vector/v.voronoi/dt_main.c
===================================================================
--- grass/trunk/vector/v.voronoi/dt_main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.voronoi/dt_main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -31,7 +31,6 @@
 
 int main(int argc, char **argv)
 {
-    char *mapset;
     struct Flag *reg_flag, *line_flag;
     struct Option *in_opt, *out_opt;
     struct GModule *module;
@@ -72,12 +71,8 @@
     Cats = Vect_new_cats_struct();
 
     /* open files */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
     /* check if we have a 3D input points map */
     mode3d = 0;

Modified: grass/trunk/vector/v.voronoi/vo_main.c
===================================================================
--- grass/trunk/vector/v.voronoi/vo_main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.voronoi/vo_main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -99,7 +99,6 @@
 {
     int i;
     int **cats, *ncats, nfields, *fields;
-    char *mapset;
     struct Flag *line_flag;
 
     /* struct Flag *all_flag; */
@@ -152,16 +151,11 @@
     Cats = Vect_new_cats_struct();
 
     /* open files */
-    if ((mapset = G_find_vector2(in_opt->answer, "")) == NULL) {
-	G_fatal_error(_("Vector map <%s> not found"), in_opt->answer);
-    }
-
     Vect_set_open_level(2);
-    Vect_open_old(&In, in_opt->answer, mapset);
+    Vect_open_old(&In, in_opt->answer, "");
 
-    if (0 > Vect_open_new(&Out, out_opt->answer, 0)) {
+    if (Vect_open_new(&Out, out_opt->answer, 0) < 0)
 	G_fatal_error(_("Unable to create vector map <%s>"), out_opt->answer);
-    }
 
     Vect_hist_copy(&In, &Out);
     Vect_hist_command(&Out);

Modified: grass/trunk/vector/v.what/main.c
===================================================================
--- grass/trunk/vector/v.what/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.what/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -40,10 +40,8 @@
     struct Option *opt1, *coords_opt, *maxdistance;
     struct Cell_head window;
     struct GModule *module;
-    char *mapset;
-    char *str;
     char buf[2000];
-    int i, j, level, width = 0, mwidth = 0, ret;
+    int i, level, ret;
     double xval, yval, xres, yres, maxd, x;
     double EW_DIST1, EW_DIST2, NS_DIST1, NS_DIST2;
     char nsres[30], ewres[30];
@@ -132,25 +130,8 @@
 
 	Map = (struct Map_info *)G_malloc(nvects * sizeof(struct Map_info));
 
-	width = mwidth = 0;
 	for (i = 0; i < nvects; i++) {
-	    str = strchr(vect[i], '@');
-	    if (str)
-		j = str - vect[i];
-	    else
-		j = strlen(vect[i]);
-	    if (j > width)
-		width = j;
-
-	    mapset = G_find_vector2(vect[i], "");
-	    if (!mapset)
-		G_fatal_error(_("Vector map <%s> not found"), vect[i]);
-
-	    j = strlen(mapset);
-	    if (j > mwidth)
-		mwidth = j;
-
-	    level = Vect_open_old(&Map[i], vect[i], mapset);
+	    level = Vect_open_old(&Map[i], vect[i], "");
 	    if (level < 2)
 		G_fatal_error(_("You must build topology on vector map <%s>"),
 			      vect[i]);
@@ -167,7 +148,7 @@
 	while (fgets(buf, sizeof(buf), stdin) != NULL) {
 	    ret = sscanf(buf, "%lf%c%lf", &xval, &ch, &yval);
 	    if (ret == 3 && (ch == ',' || ch == ' ' || ch == '\t')) {
-		what(xval, yval, maxd, width, mwidth, topo_flag->answer,
+		what(xval, yval, maxd, topo_flag->answer,
 		     printattributes->answer);
 	    }
 	    else {
@@ -181,8 +162,7 @@
 	for (i = 0; coords_opt->answers[i] != NULL; i += 2) {
 	    xval = atof(coords_opt->answers[i]);
 	    yval = atof(coords_opt->answers[i + 1]);
-	    what(xval, yval, maxd, width, mwidth, topo_flag->answer,
-		 printattributes->answer);
+	    what(xval, yval, maxd, topo_flag->answer, printattributes->answer);
 	}
     }
 

Modified: grass/trunk/vector/v.what/what.c
===================================================================
--- grass/trunk/vector/v.what/what.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.what/what.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -14,8 +14,7 @@
 
 #define WDTH 5
 
-int what(double east, double north, double maxdist, int width,
-	 int mwidth, int topo, int showextra)
+int what(double east, double north, double maxdist, int topo, int showextra)
 {
     int type;
     char east_buf[40], north_buf[40];
@@ -75,11 +74,9 @@
 	    *str = 0;
 
 	if (line + area > 0 || G_verbose() >= G_verbose_std()) {
-	    /* fprintf(stdout, "Map: %*s \nMapset: %-*s\n", width, Map[i].name, mwidth, Map[i].mapset); */
 	    fprintf(stdout, "\nMap: %s \nMapset: %s\n", Map[i].name,
 		    Map[i].mapset);
 	    if (notty)
-		/* fprintf(stderr, "Map: %*s \nMapset: %-*s\n", width, Map[i].name, mwidth, Map[i].mapset); */
 		fprintf(stderr, "\nMap: %s \nMapset: %s\n", Map[i].name,
 			Map[i].mapset);
 	}

Modified: grass/trunk/vector/v.what/what.h
===================================================================
--- grass/trunk/vector/v.what/what.h	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.what/what.h	2008-08-31 21:30:54 UTC (rev 33177)
@@ -1,5 +1,5 @@
 /* what.c */
-extern int what(double, double, double, int, int, int, int);
+extern int what(double, double, double, int, int);
 
 extern char **vect;
 extern int nvects;

Modified: grass/trunk/vector/v.what.rast/main.c
===================================================================
--- grass/trunk/vector/v.what.rast/main.c	2008-08-31 13:08:13 UTC (rev 33176)
+++ grass/trunk/vector/v.what.rast/main.c	2008-08-31 21:30:54 UTC (rev 33177)
@@ -41,7 +41,6 @@
 
 int main(int argc, char *argv[])
 {
-    char *mapset;
     int i, j, nlines, type, field, cat;
     int fd;
 
@@ -115,11 +114,8 @@
     Vect_region_box(&window, &box);	/* T and B set to +/- PORT_DOUBLE_MAX */
 
     /* Open vector */
-    if ((mapset = G_find_vector2(vect_opt->answer, "")) == NULL)
-	G_fatal_error(_("Vector map <%s> not found"), vect_opt->answer);
-
     Vect_set_open_level(2);
-    Vect_open_old(&Map, vect_opt->answer, mapset);
+    Vect_open_old(&Map, vect_opt->answer, "");
 
     Fi = Vect_get_field(&Map, field);
     if (Fi == NULL)
@@ -134,17 +130,14 @@
     }
 
     /* Open raster */
-    if ((mapset = G_find_cell2(rast_opt->answer, "")) == NULL)
-	G_fatal_error(_("Raster map <%s> not found"), rast_opt->answer);
-
-    if ((fd = G_open_cell_old(rast_opt->answer, mapset)) < 0)
+    if ((fd = G_open_cell_old(rast_opt->answer, "")) < 0)
 	G_fatal_error(_("Unable to open raster map <%s>"), rast_opt->answer);
 
     out_type = G_get_raster_map_type(fd);
 
     /* TODO: Later possibly category labels */
     /* 
-       if ( G_read_cats (name, mapset, &RCats) < 0 )
+       if ( G_read_cats (name, "", &RCats) < 0 )
        G_fatal_error ( "Cannot read category file");
      */
 



More information about the grass-commit mailing list