Browse Source

libgis: G__get_window() renamed to G_get_element_window()
update modules
(merge r63823-4 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@63825 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 10 years ago
parent
commit
1f916f173e

+ 1 - 1
display/d.grid/main.c

@@ -206,7 +206,7 @@ int main(int argc, char **argv)
 	G_fatal_error("Invalid direction: %s", direction->answer);
 	G_fatal_error("Invalid direction: %s", direction->answer);
 
 
     if (align->answer || strcmp(opt2->answer, "0") == 0)
     if (align->answer || strcmp(opt2->answer, "0") == 0)
-	G__get_window(&wind, "", "WIND", G_mapset());
+	G_get_element_window(&wind, "", "WIND", G_mapset());
 
 
     if (strcmp(opt2->answer, "0") == 0) {
     if (strcmp(opt2->answer, "0") == 0) {
 	if (geogrid->answer)
 	if (geogrid->answer)

+ 2 - 2
general/g.list/main.c

@@ -263,9 +263,9 @@ int main(int argc, char *argv[])
 	    char name[GNAME_MAX], mapset[GMAPSET_MAX];
 	    char name[GNAME_MAX], mapset[GMAPSET_MAX];
 
 
 	    if (G_name_is_fully_qualified(opt.region->answer, name, mapset))
 	    if (G_name_is_fully_qualified(opt.region->answer, name, mapset))
-		G__get_window(&window, "windows", name, mapset);
+		G_get_element_window(&window, "windows", name, mapset);
 	    else
 	    else
-		G__get_window(&window, "windows", opt.region->answer, "");
+		G_get_element_window(&window, "windows", opt.region->answer, "");
 	}
 	}
     }
     }
     else
     else

+ 1 - 1
general/g.region/main.c

@@ -401,7 +401,7 @@ int main(int argc, char *argv[])
 	mapset = G_find_file2("windows", name, "");
 	mapset = G_find_file2("windows", name, "");
 	if (!mapset)
 	if (!mapset)
 	    G_fatal_error(_("Region <%s> not found"), name);
 	    G_fatal_error(_("Region <%s> not found"), name);
-	G__get_window(&window, "windows", name, mapset);
+	G_get_element_window(&window, "windows", name, mapset);
     }
     }
 
 
     /* raster= */
     /* raster= */

+ 2 - 2
include/defs/gis.h

@@ -305,8 +305,8 @@ struct Key_Value *G_get_projepsg(void);
 /* get_window.c */
 /* get_window.c */
 void G_get_window(struct Cell_head *);
 void G_get_window(struct Cell_head *);
 void G_get_default_window(struct Cell_head *);
 void G_get_default_window(struct Cell_head *);
-void G__get_window(struct Cell_head *, const char *, const char *,
-		   const char *);
+void G_get_element_window(struct Cell_head *, const char *, const char *,
+                          const char *);
 
 
 /* getl.c */
 /* getl.c */
 int G_getl(char *, int, FILE *);
 int G_getl(char *, int, FILE *);

+ 13 - 13
lib/gis/get_window.c

@@ -26,10 +26,10 @@ static struct state {
 static struct state *st = &state;
 static struct state *st = &state;
 
 
 /*!
 /*!
-  \brief Read the database region
+  \brief Get the current region
   
   
-  Reads the database region as stored in the WIND file in the user's
-  current mapset into region.
+  Reads the region as stored in the WIND file in the user's current
+  mapset into region.
   
   
   3D values are set to defaults if not available in WIND file.  An
   3D values are set to defaults if not available in WIND file.  An
   error message is printed and exit() is called if there is a problem
   error message is printed and exit() is called if there is a problem
@@ -63,9 +63,9 @@ void G_get_window(struct Cell_head *window)
     else {
     else {
 	char *wind = getenv("WIND_OVERRIDE");
 	char *wind = getenv("WIND_OVERRIDE");
 	if (wind)
 	if (wind)
-	    G__get_window(&st->dbwindow, "windows", wind, G_mapset());
+	    G_get_element_window(&st->dbwindow, "windows", wind, G_mapset());
 	else
 	else
-	    G__get_window(&st->dbwindow, "", "WIND", G_mapset());
+	    G_get_element_window(&st->dbwindow, "", "WIND", G_mapset());
     }
     }
 
 
     *window = st->dbwindow;
     *window = st->dbwindow;
@@ -79,7 +79,7 @@ void G_get_window(struct Cell_head *window)
 }
 }
 
 
 /*!
 /*!
-  \brief Read the default region
+  \brief Get the default region
   
   
   Reads the default region for the location into <i>region.</i> 3D
   Reads the default region for the location into <i>region.</i> 3D
   values are set to defaults if not available in WIND file.
   values are set to defaults if not available in WIND file.
@@ -91,21 +91,21 @@ void G_get_window(struct Cell_head *window)
 */
 */
 void G_get_default_window(struct Cell_head *window)
 void G_get_default_window(struct Cell_head *window)
 {
 {
-    G__get_window(window, "", "DEFAULT_WIND", "PERMANENT");
+    G_get_element_window(window, "", "DEFAULT_WIND", "PERMANENT");
 }
 }
 
 
 /*!
 /*!
-  \brief Get window (region) of selected map
+  \brief Get region for selected element (raster, vector, window, etc.)
   
   
   G_fatal_error() is called on error
   G_fatal_error() is called on error
   
   
-  \param window pointer to Cell_head
+  \param[out] window pointer to Cell_head
   \param element element type
   \param element element type
-  \param name map name
+  \param name element name
   \param mapset mapset name
   \param mapset mapset name
 */
 */
-void G__get_window(struct Cell_head *window,
-		   const char *element, const char *name, const char *mapset)
+void G_get_element_window(struct Cell_head *window,
+                          const char *element, const char *name, const char *mapset)
 {
 {
     FILE *fp;
     FILE *fp;
 
 
@@ -122,7 +122,7 @@ void G__get_window(struct Cell_head *window,
 }
 }
 
 
 /*!
 /*!
-  \brief Unset current window
+  \brief Unset current region
 */
 */
 void G_unset_window()
 void G_unset_window()
 {
 {

+ 1 - 1
ps/ps.map/r_wind.c

@@ -28,7 +28,7 @@ int read_wind(char *name, char *mapset)
 
 
     sprintf(fullname, "%s in %s", name, mapset);
     sprintf(fullname, "%s in %s", name, mapset);
 
 
-    G__get_window(&window, "windows", name, mapset);
+    G_get_element_window(&window, "windows", name, mapset);
 
 
     width = 1.;
     width = 1.;
     color_R = color_G = color_B = 0;
     color_R = color_G = color_B = 0;

+ 1 - 1
raster/r.region/main.c

@@ -155,7 +155,7 @@ int main(int argc, char *argv[])
 	G_get_window(&window);
 	G_get_window(&window);
 
 
     if ((name = parm.region->answer))	/* region= */
     if ((name = parm.region->answer))	/* region= */
-	G__get_window(&window, "windows", name, "");
+	G_get_element_window(&window, "windows", name, "");
 
 
     if ((name = parm.raster->answer)) {	/* raster= */
     if ((name = parm.raster->answer)) {	/* raster= */
 	Rast_get_cellhd(name, "", &window);
 	Rast_get_cellhd(name, "", &window);