[GRASS-SVN] r40771 - in grass/trunk: display/d.profile display/d.rast doc/raster/r.example general/g.region imagery/i.albedo imagery/i.atcorr imagery/i.biomass imagery/i.cca imagery/i.class imagery/i.cluster imagery/i.eb.eta imagery/i.eb.evapfr imagery/i.eb.h_SEBAL01 imagery/i.eb.soilheatflux imagery/i.emissivity imagery/i.evapo.time_integration imagery/i.fft imagery/i.gensig imagery/i.gensigset imagery/i.his.rgb imagery/i.ifft imagery/i.latlong imagery/i.maxlik imagery/i.modis.qc imagery/i.pca imagery/i.points imagery/i.rectify imagery/i.rgb.his imagery/i.smap imagery/i.sunhours imagery/i.vi imagery/i.vpoints imagery/i.zc include lib/gis lib/raster lib/rst/interp_float ps/ps.map raster/r.basins.fill raster/r.bitpattern raster/r.carve raster/r.category raster/r.circle raster/r.clump raster/r.coin raster/r.colors raster/r.compress raster/r.cost raster/r.covar raster/r.cross raster/r.describe raster/r.distance raster/r.drain raster/r.fill.dir raster/r.flow raster/r.grow raster/r.grow.distance raster/r.horizon raster/r.in.arc raster/r.in.ascii raster/r.in.bin raster/r.in.gridatb raster/r.lake raster/r.le/r.le.patch raster/r.le/r.le.pixel raster/r.le/r.le.setup raster/r.le/r.le.trace raster/r.li/r.li.daemon raster/r.los raster/r.mapcalc raster/r.mfilter raster/r.neighbors raster/r.out.arc raster/r.out.ascii raster/r.out.bin raster/r.out.gridatb raster/r.out.mat raster/r.out.mpeg raster/r.out.pov raster/r.out.vrml raster/r.param.scale raster/r.patch raster/r.proj raster/r.quantile raster/r.random raster/r.random.cells raster/r.random.surface raster/r.recode raster/r.region raster/r.resamp.interp raster/r.resamp.stats raster/r.resample raster/r.rescale raster/r.rescale.eq raster/r.ros raster/r.series raster/r.slope.aspect raster/r.spread raster/r.spreadpath raster/r.statistics2 raster/r.statistics3 raster/r.stats raster/r.sun raster/r.sunmask raster/r.support raster/r.support.stats raster/r.surf.contour raster/r.surf.fractal raster/r.surf.gauss raster/r.surf.idw raster/r.surf.idw2 raster/r.surf.random raster/r.terraflow raster/r.texture raster/r.thin raster/r.to.rast3 raster/r.to.rast3elev raster/r.to.vect raster/r.univar raster/r.uslek raster/r.usler raster/r.volume raster/r.walk raster/r.water.outlet raster/r.watershed/ram raster/r.watershed/seg raster/r.watershed/shed raster/r.what raster/simwe/simlib raster3d/r3.cross.rast raster3d/r3.out.vtk raster3d/r3.to.rast swig/perl/R_slope_aspect/r_slope_aspect vector/lidar/lidarlib vector/lidar/v.lidar.correction vector/lidar/v.lidar.growing vector/lidar/v.surf.bspline vector/v.kernel vector/v.neighbors vector/v.to.rast vector/v.what.rast visualization/xganim

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Feb 1 12:53:17 EST 2010


Author: glynn
Date: 2010-02-01 12:53:15 -0500 (Mon, 01 Feb 2010)
New Revision: 40771

Added:
   grass/trunk/lib/raster/align_window.c
   grass/trunk/lib/raster/window.c
Removed:
   grass/trunk/lib/gis/align_window.c
Modified:
   grass/trunk/display/d.profile/main.c
   grass/trunk/display/d.rast/display.c
   grass/trunk/doc/raster/r.example/main.c
   grass/trunk/general/g.region/main.c
   grass/trunk/imagery/i.albedo/main.c
   grass/trunk/imagery/i.atcorr/main.cpp
   grass/trunk/imagery/i.biomass/main.c
   grass/trunk/imagery/i.cca/main.c
   grass/trunk/imagery/i.class/cellhd.c
   grass/trunk/imagery/i.class/draw_cell.c
   grass/trunk/imagery/i.class/outline.c
   grass/trunk/imagery/i.class/signature.c
   grass/trunk/imagery/i.cluster/main.c
   grass/trunk/imagery/i.eb.eta/main.c
   grass/trunk/imagery/i.eb.evapfr/main.c
   grass/trunk/imagery/i.eb.h_SEBAL01/main.c
   grass/trunk/imagery/i.eb.soilheatflux/main.c
   grass/trunk/imagery/i.emissivity/main.c
   grass/trunk/imagery/i.evapo.time_integration/main.c
   grass/trunk/imagery/i.fft/main.c
   grass/trunk/imagery/i.gensig/covariance.c
   grass/trunk/imagery/i.gensig/get_train.c
   grass/trunk/imagery/i.gensig/means.c
   grass/trunk/imagery/i.gensigset/get_train.c
   grass/trunk/imagery/i.gensigset/read_data.c
   grass/trunk/imagery/i.his.rgb/main.c
   grass/trunk/imagery/i.ifft/main.c
   grass/trunk/imagery/i.latlong/main.c
   grass/trunk/imagery/i.maxlik/main.c
   grass/trunk/imagery/i.modis.qc/main.c
   grass/trunk/imagery/i.pca/main.c
   grass/trunk/imagery/i.points/drawcell.c
   grass/trunk/imagery/i.rectify/rectify.c
   grass/trunk/imagery/i.rgb.his/main.c
   grass/trunk/imagery/i.smap/openfiles.c
   grass/trunk/imagery/i.smap/segment.c
   grass/trunk/imagery/i.sunhours/main.c
   grass/trunk/imagery/i.vi/main.c
   grass/trunk/imagery/i.vpoints/drawcell.c
   grass/trunk/imagery/i.zc/main.c
   grass/trunk/include/gisdefs.h
   grass/trunk/include/rasterdefs.h
   grass/trunk/lib/gis/get_window.c
   grass/trunk/lib/gis/window_map.c
   grass/trunk/lib/raster/alloc_cell.c
   grass/trunk/lib/raster/get_row_colr.c
   grass/trunk/lib/raster/sample.c
   grass/trunk/lib/raster/zero_cell.c
   grass/trunk/lib/rst/interp_float/output2d.c
   grass/trunk/ps/ps.map/do_masking.c
   grass/trunk/ps/ps.map/ps_outline.c
   grass/trunk/raster/r.basins.fill/main.c
   grass/trunk/raster/r.bitpattern/main.c
   grass/trunk/raster/r.carve/enforce_ds.c
   grass/trunk/raster/r.carve/raster.c
   grass/trunk/raster/r.category/cats.c
   grass/trunk/raster/r.circle/main.c
   grass/trunk/raster/r.clump/clump.c
   grass/trunk/raster/r.coin/main.c
   grass/trunk/raster/r.colors/stats.c
   grass/trunk/raster/r.compress/main.c
   grass/trunk/raster/r.cost/main.c
   grass/trunk/raster/r.covar/main.c
   grass/trunk/raster/r.cross/main.c
   grass/trunk/raster/r.describe/describe.c
   grass/trunk/raster/r.distance/distance.c
   grass/trunk/raster/r.distance/edges.c
   grass/trunk/raster/r.drain/main.c
   grass/trunk/raster/r.fill.dir/main.c
   grass/trunk/raster/r.flow/precomp.c
   grass/trunk/raster/r.grow.distance/main.c
   grass/trunk/raster/r.grow/main.c
   grass/trunk/raster/r.horizon/main.c
   grass/trunk/raster/r.in.arc/main.c
   grass/trunk/raster/r.in.ascii/main.c
   grass/trunk/raster/r.in.bin/main.c
   grass/trunk/raster/r.in.gridatb/adjcellhd.c
   grass/trunk/raster/r.lake/main.c
   grass/trunk/raster/r.le/r.le.patch/driver.c
   grass/trunk/raster/r.le/r.le.patch/input.c
   grass/trunk/raster/r.le/r.le.pixel/driver.c
   grass/trunk/raster/r.le/r.le.setup/main.c
   grass/trunk/raster/r.le/r.le.trace/main.c
   grass/trunk/raster/r.li/r.li.daemon/daemon.c
   grass/trunk/raster/r.los/main.c
   grass/trunk/raster/r.mapcalc/map.c
   grass/trunk/raster/r.mapcalc/xcoor.c
   grass/trunk/raster/r.mfilter/main.c
   grass/trunk/raster/r.neighbors/bufs.c
   grass/trunk/raster/r.neighbors/main.c
   grass/trunk/raster/r.out.arc/main.c
   grass/trunk/raster/r.out.ascii/main.c
   grass/trunk/raster/r.out.bin/main.c
   grass/trunk/raster/r.out.gridatb/adjcellhd.c
   grass/trunk/raster/r.out.mat/main.c
   grass/trunk/raster/r.out.mpeg/main.c
   grass/trunk/raster/r.out.pov/main.c
   grass/trunk/raster/r.out.vrml/main.c
   grass/trunk/raster/r.out.vrml/put_grid.c
   grass/trunk/raster/r.param.scale/process.c
   grass/trunk/raster/r.patch/main.c
   grass/trunk/raster/r.proj/bordwalk.c
   grass/trunk/raster/r.proj/main.c
   grass/trunk/raster/r.proj/readcell.c
   grass/trunk/raster/r.quantile/main.c
   grass/trunk/raster/r.random.cells/init.c
   grass/trunk/raster/r.random.surface/init.c
   grass/trunk/raster/r.random/count.c
   grass/trunk/raster/r.random/random.c
   grass/trunk/raster/r.recode/recode.c
   grass/trunk/raster/r.region/main.c
   grass/trunk/raster/r.resamp.interp/main.c
   grass/trunk/raster/r.resamp.stats/main.c
   grass/trunk/raster/r.resample/main.c
   grass/trunk/raster/r.rescale.eq/get_stats.c
   grass/trunk/raster/r.rescale/get_range.c
   grass/trunk/raster/r.ros/main.c
   grass/trunk/raster/r.series/main.c
   grass/trunk/raster/r.slope.aspect/main.c
   grass/trunk/raster/r.spread/main.c
   grass/trunk/raster/r.spread/ram2out.c
   grass/trunk/raster/r.spreadpath/main.c
   grass/trunk/raster/r.statistics2/main.c
   grass/trunk/raster/r.statistics3/main.c
   grass/trunk/raster/r.stats/main.c
   grass/trunk/raster/r.stats/raw_stats.c
   grass/trunk/raster/r.sun/main.c
   grass/trunk/raster/r.sunmask/main.c
   grass/trunk/raster/r.support.stats/histo.c
   grass/trunk/raster/r.support/histo.c
   grass/trunk/raster/r.surf.contour/main.c
   grass/trunk/raster/r.surf.contour/read_cell.c
   grass/trunk/raster/r.surf.fractal/process.c
   grass/trunk/raster/r.surf.fractal/write_rast.c
   grass/trunk/raster/r.surf.gauss/gaussurf.c
   grass/trunk/raster/r.surf.idw/main.c
   grass/trunk/raster/r.surf.idw2/read_cell.c
   grass/trunk/raster/r.surf.random/randsurf.c
   grass/trunk/raster/r.terraflow/main.cc
   grass/trunk/raster/r.texture/main.c
   grass/trunk/raster/r.thin/io.c
   grass/trunk/raster/r.to.rast3/main.c
   grass/trunk/raster/r.to.rast3elev/main.c
   grass/trunk/raster/r.to.vect/points.c
   grass/trunk/raster/r.univar/r.univar_main.c
   grass/trunk/raster/r.uslek/main.c
   grass/trunk/raster/r.usler/main.c
   grass/trunk/raster/r.volume/centroids.c
   grass/trunk/raster/r.walk/main.c
   grass/trunk/raster/r.water.outlet/main.c
   grass/trunk/raster/r.watershed/ram/init_vars.c
   grass/trunk/raster/r.watershed/seg/bseg_open.c
   grass/trunk/raster/r.watershed/seg/bseg_read.c
   grass/trunk/raster/r.watershed/seg/bseg_write.c
   grass/trunk/raster/r.watershed/seg/cseg_open.c
   grass/trunk/raster/r.watershed/seg/cseg_read.c
   grass/trunk/raster/r.watershed/seg/cseg_write.c
   grass/trunk/raster/r.watershed/seg/dseg_open.c
   grass/trunk/raster/r.watershed/seg/dseg_read.c
   grass/trunk/raster/r.watershed/seg/dseg_write.c
   grass/trunk/raster/r.watershed/seg/init_vars.c
   grass/trunk/raster/r.watershed/shed/read.c
   grass/trunk/raster/r.watershed/shed/valid.c
   grass/trunk/raster/r.what/main.c
   grass/trunk/raster/simwe/simlib/output.c
   grass/trunk/raster3d/r3.cross.rast/main.c
   grass/trunk/raster3d/r3.out.vtk/main.c
   grass/trunk/raster3d/r3.to.rast/main.c
   grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c
   grass/trunk/vector/lidar/lidarlib/raster.c
   grass/trunk/vector/lidar/lidarlib/zones.c
   grass/trunk/vector/lidar/v.lidar.correction/main.c
   grass/trunk/vector/lidar/v.lidar.growing/main.c
   grass/trunk/vector/lidar/v.surf.bspline/main.c
   grass/trunk/vector/v.kernel/main.c
   grass/trunk/vector/v.neighbors/main.c
   grass/trunk/vector/v.to.rast/support.c
   grass/trunk/vector/v.what.rast/main.c
   grass/trunk/visualization/xganim/main.cc
Log:
Move raster-specific functions from lib/gis to lib/raster:
 G_align_window -> Rast_align_window
 G_window_rows -> Rast_window_rows
 G_window_cols -> Rast_window_cols
 G_northing_to_row -> Rast_northing_to_row
 G_easting_to_col -> Rast_easting_to_col
 G_row_to_northing -> Rast_row_to_northing
 G_col_to_easting -> Rast_col_to_easting


Modified: grass/trunk/display/d.profile/main.c
===================================================================
--- grass/trunk/display/d.profile/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/display/d.profile/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -40,8 +40,8 @@
 {
     DCELL *buf = Rast_allocate_d_buf();
 
-    int nrows = G_window_rows();
-    int ncols = G_window_cols();
+    int nrows = Rast_window_rows();
+    int ncols = Rast_window_cols();
     int row, col;
 
     min = 1e300;
@@ -133,8 +133,8 @@
     x -= col + 0.5;
     y -= row + 0.5;
 
-    if (row < 0 || row + 1 >= G_window_rows() ||
-	col < 0 || col + 1 >= G_window_cols()) {
+    if (row < 0 || row + 1 >= Rast_window_rows() ||
+	col < 0 || col + 1 >= Rast_window_cols()) {
 	Rast_set_d_null_value(result, 1);
 	return 0;
     }
@@ -237,8 +237,8 @@
 	G_scan_easting( profile->answers[i+0], &x, G_projection());
 	G_scan_northing(profile->answers[i+1], &y, G_projection());
 
-	p->x = G_easting_to_col (x, &window);
-	p->y = G_northing_to_row(y, &window);
+	p->x = Rast_easting_to_col (x, &window);
+	p->y = Rast_northing_to_row(y, &window);
 
 	if (num_points > 0) {
 	    const struct point *prev = &points[num_points-1];

Modified: grass/trunk/display/d.rast/display.c
===================================================================
--- grass/trunk/display/d.rast/display.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/display/d.rast/display.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -50,8 +50,8 @@
     int cur_A_row;
     int ncols, nrows;
 
-    ncols = G_window_cols();
-    nrows = G_window_rows();
+    ncols = Rast_window_cols();
+    nrows = Rast_window_rows();
 
     /* Set up the screen, conversions, and graphics */
     D_setup(0);

Modified: grass/trunk/doc/raster/r.example/main.c
===================================================================
--- grass/trunk/doc/raster/r.example/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/doc/raster/r.example/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -119,8 +119,8 @@
     inrast = Rast_allocate_buf(data_type);
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(data_type);
 
     /* controlling, if we can write the raster */

Modified: grass/trunk/general/g.region/main.c
===================================================================
--- grass/trunk/general/g.region/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/general/g.region/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -549,7 +549,7 @@
 	    }
 
 	    if (flag.res_set->answer)
-		G_align_window(&window, &temp_window);
+		Rast_align_window(&window, &temp_window);
 
 	    Vect_close(&Map);
 	}
@@ -783,7 +783,7 @@
 	if (!mapset)
 	    G_fatal_error(_("Raster map <%s> not found"), name);
 	Rast_get_cellhd(name, mapset, &temp_window);
-	G_align_window(&window, &temp_window);
+	Rast_align_window(&window, &temp_window);
     }
 
     /* save= */

Modified: grass/trunk/imagery/i.albedo/main.c
===================================================================
--- grass/trunk/imagery/i.albedo/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.albedo/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -164,8 +164,8 @@
 	G_fatal_error(_("At least two raster maps are required"));
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(out_data_type);
 
     /* Create New raster files */

Modified: grass/trunk/imagery/i.atcorr/main.cpp
===================================================================
--- grass/trunk/imagery/i.atcorr/main.cpp	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.atcorr/main.cpp	2010-02-01 17:53:15 UTC (rev 40771)
@@ -120,7 +120,7 @@
 
     cbuf = (CELL*)Rast_allocate_buf(CELL_TYPE);
 
-    for(col = 0; col < G_window_cols(); col++) cbuf[col] = round_c(buf[col]);
+    for(col = 0; col < Rast_window_cols(); col++) cbuf[col] = round_c(buf[col]);
     Rast_put_row(ofd, cbuf, CELL_TYPE);
 }
 
@@ -295,8 +295,8 @@
     if(ivis_fd >= 0) vis = (FCELL*)Rast_allocate_buf(FCELL_TYPE);
 
     G_verbose_message(_("Percent complete..."));
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     for(row = 0; row < nrows; row++)
     {

Modified: grass/trunk/imagery/i.biomass/main.c
===================================================================
--- grass/trunk/imagery/i.biomass/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.biomass/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -117,8 +117,8 @@
     infd_wa = Rast_open_old(wa, "");
     inrast_wa = Rast_allocate_d_buf();
     
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast1 = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

Modified: grass/trunk/imagery/i.cca/main.c
===================================================================
--- grass/trunk/imagery/i.cca/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.cca/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -207,7 +207,7 @@
     }
 
     /* do the transform */
-    transform(datafds, outfds, G_window_rows(), G_window_cols(), q, bands,
+    transform(datafds, outfds, Rast_window_rows(), Rast_window_cols(), q, bands,
 	      outbandmin, outbandmax);
 
     /* make grey scale color table */

Modified: grass/trunk/imagery/i.class/cellhd.c
===================================================================
--- grass/trunk/imagery/i.class/cellhd.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.class/cellhd.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -7,13 +7,13 @@
     int row, col;
     int top, bottom, left, right;
 
-    row = G_northing_to_row(cellhd->north, &view->cell.head) + .5;
+    row = Rast_northing_to_row(cellhd->north, &view->cell.head) + .5;
     top = row_to_view(view, row);
-    col = G_easting_to_col(cellhd->west, &view->cell.head) + .5;
+    col = Rast_easting_to_col(cellhd->west, &view->cell.head) + .5;
     left = col_to_view(view, col);
-    row = G_northing_to_row(cellhd->south, &view->cell.head) + .5;
+    row = Rast_northing_to_row(cellhd->south, &view->cell.head) + .5;
     bottom = row_to_view(view, row);
-    col = G_easting_to_col(cellhd->east, &view->cell.head) + .5;
+    col = Rast_easting_to_col(cellhd->east, &view->cell.head) + .5;
     right = col_to_view(view, col);
 
     Outline_box(top, bottom, left, right);

Modified: grass/trunk/imagery/i.class/draw_cell.c
===================================================================
--- grass/trunk/imagery/i.class/draw_cell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.class/draw_cell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -24,8 +24,8 @@
 	display_title(view);
 
     Rast_set_window(&view->cell.head);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     left = view->cell.left;
     top = view->cell.top;

Modified: grass/trunk/imagery/i.class/outline.c
===================================================================
--- grass/trunk/imagery/i.class/outline.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.class/outline.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -40,8 +40,8 @@
 	temp.x = view_to_col(Region.view, A[cur].x);
 	tmp_n = row_to_northing(&(Region.view->cell.head), temp.y, 0.5);
 	tmp_e = col_to_easting(&(Region.view->cell.head), temp.x, 0.5);
-	tmp[cur].y = G_northing_to_row(tmp_n, &Band_cellhd);
-	tmp[cur].x = G_easting_to_col(tmp_e, &Band_cellhd);
+	tmp[cur].y = Rast_northing_to_row(tmp_n, &Band_cellhd);
+	tmp[cur].x = Rast_easting_to_col(tmp_e, &Band_cellhd);
     }
 
     /* find first edge which is not horizontal */

Modified: grass/trunk/imagery/i.class/signature.c
===================================================================
--- grass/trunk/imagery/i.class/signature.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.class/signature.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -274,8 +274,8 @@
 
 	fd = Rast_open_c_new(MASK);
 	buffer = Rast_allocate_c_buf();
-	nrows = G_window_rows();
-	ncols = G_window_cols();
+	nrows = Rast_window_rows();
+	ncols = Rast_window_cols();
 
 	for (row = 0; row < nrows; row++) {
 	    readbands(nbands, row);

Modified: grass/trunk/imagery/i.cluster/main.c
===================================================================
--- grass/trunk/imagery/i.cluster/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.cluster/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -160,8 +160,8 @@
 
 
     G_get_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     I_cluster_clear(&C);
 

Modified: grass/trunk/imagery/i.eb.eta/main.c
===================================================================
--- grass/trunk/imagery/i.eb.eta/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.eb.eta/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -85,8 +85,8 @@
     infd_tempk = Rast_open_old(tempk, "");
     inrast_tempk = Rast_allocate_d_buf();
     
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast1 = Rast_allocate_d_buf();
     
     outfd1 = Rast_open_new(result1, DCELL_TYPE);

Modified: grass/trunk/imagery/i.eb.evapfr/main.c
===================================================================
--- grass/trunk/imagery/i.eb.evapfr/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.eb.evapfr/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -107,8 +107,8 @@
     inrast_h0 = Rast_allocate_d_buf();
     
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast1 = Rast_allocate_d_buf();
 
     if (makin) 

Modified: grass/trunk/imagery/i.eb.h_SEBAL01/main.c
===================================================================
--- grass/trunk/imagery/i.eb.h_SEBAL01/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.eb.h_SEBAL01/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -231,8 +231,8 @@
     ymin = cellhd.south;
     ymax = cellhd.north;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /***************************************************/
     /* Allocate output buffer */

Modified: grass/trunk/imagery/i.eb.soilheatflux/main.c
===================================================================
--- grass/trunk/imagery/i.eb.soilheatflux/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.eb.soilheatflux/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -109,8 +109,8 @@
     infd_time = Rast_open_old(time, "");
     inrast_time = Rast_allocate_d_buf();
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

Modified: grass/trunk/imagery/i.emissivity/main.c
===================================================================
--- grass/trunk/imagery/i.emissivity/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.emissivity/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -66,8 +66,8 @@
     inr = Rast_allocate_d_buf();
     
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outr = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

Modified: grass/trunk/imagery/i.evapo.time_integration/main.c
===================================================================
--- grass/trunk/imagery/i.evapo.time_integration/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.evapo.time_integration/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -235,8 +235,8 @@
 	G_fatal_error(_("The min specified input map is two"));
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(out_data_type);
 
    

Modified: grass/trunk/imagery/i.fft/main.c
===================================================================
--- grass/trunk/imagery/i.fft/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.fft/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -109,8 +109,8 @@
     G_get_set_window(&window);	/* get the current window for later */
 
     /* get the rows and columns in the current window */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     totsize = rows * cols;
 
     /* Allocate appropriate memory for the structure containing

Modified: grass/trunk/imagery/i.gensig/covariance.c
===================================================================
--- grass/trunk/imagery/i.gensig/covariance.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.gensig/covariance.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -23,8 +23,8 @@
 	    for (b2 = 0; b2 < S->nbands; b2++)
 		S->sig[n].var[b1][b2] = 0.0;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     class = (CELL *) G_calloc(ncols, sizeof(CELL));
 
     G_message(_("Calculating class covariance matrices..."));

Modified: grass/trunk/imagery/i.gensig/get_train.c
===================================================================
--- grass/trunk/imagery/i.gensig/get_train.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.gensig/get_train.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -23,8 +23,8 @@
     fd = files->train_fd;
     cell = files->train_cell;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* determine the categories in the map */
     I_init_signatures(S, files->nbands);

Modified: grass/trunk/imagery/i.gensig/means.c
===================================================================
--- grass/trunk/imagery/i.gensig/means.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.gensig/means.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -19,8 +19,8 @@
 	for (b = 0; b < S->nbands; b++)	/* for each band file */
 	    S->sig[n].mean[b] = 0.0;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     class = (CELL *) G_calloc(ncols, sizeof(CELL));
 
     G_message(_("Calculating class means..."));

Modified: grass/trunk/imagery/i.gensigset/get_train.c
===================================================================
--- grass/trunk/imagery/i.gensigset/get_train.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.gensigset/get_train.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -23,8 +23,8 @@
     fd = files->train_fd;
     cell = files->train_cell;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* determine the non-zero categories in the map */
     I_InitSigSet(S);

Modified: grass/trunk/imagery/i.gensigset/read_data.c
===================================================================
--- grass/trunk/imagery/i.gensigset/read_data.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.gensigset/read_data.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -15,8 +15,8 @@
     CELL *class;
     struct ClassData *Data;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     class = (CELL *) G_calloc(ncols, sizeof(CELL));
 
     G_message(_("Reading raster maps..."));

Modified: grass/trunk/imagery/i.his.rgb/main.c
===================================================================
--- grass/trunk/imagery/i.his.rgb/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.his.rgb/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -80,8 +80,8 @@
 	exit(EXIT_FAILURE);
 
     /* get dimension of the image */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     openfiles(opt_hue->answer, opt_int->answer, opt_sat->answer,
 	      opt_red->answer, opt_green->answer, opt_blue->answer,

Modified: grass/trunk/imagery/i.ifft/main.c
===================================================================
--- grass/trunk/imagery/i.ifft/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.ifft/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -121,8 +121,8 @@
     Rast_set_window(&realhead);	/* set the window to the whole cell map */
 
     /* get the rows and columns in the current window */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     totsize = rows * cols;
 
     /* Allocate appropriate memory for the structure containing

Modified: grass/trunk/imagery/i.latlong/main.c
===================================================================
--- grass/trunk/imagery/i.latlong/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.latlong/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -89,8 +89,8 @@
     xmax = cellhd.east;
     ymin = cellhd.south;
     ymax = cellhd.north;
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     
     /*Stolen from r.sun */ 
     /* Set up parameters for projection to lat/long if necessary */ 

Modified: grass/trunk/imagery/i.maxlik/main.c
===================================================================
--- grass/trunk/imagery/i.maxlik/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.maxlik/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -102,8 +102,8 @@
 
     open_files();
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 2);

Modified: grass/trunk/imagery/i.modis.qc/main.c
===================================================================
--- grass/trunk/imagery/i.modis.qc/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.modis.qc/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -204,8 +204,8 @@
     inrast = Rast_allocate_c_buf();
 
     G_debug(3, "number of rows %d", cellhd.rows);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_c_buf();
 
     /* Create New raster files */ 

Modified: grass/trunk/imagery/i.pca/main.c
===================================================================
--- grass/trunk/imagery/i.pca/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.pca/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -129,7 +129,7 @@
 	for (j = 0; j < bands; j++) {
 	    covar[i][j] =
 		covar[i][j] /
-		((double)((G_window_rows() * G_window_cols()) - 1));
+		((double)((Rast_window_rows() * Rast_window_cols()) - 1));
 	    G_debug(3, "covar[%d][%d] = %f", i, j, covar[i][j]);
 	}
     }
@@ -226,8 +226,8 @@
 static int calc_mu(int *fds, double *mu, int bands)
 {
     int i;
-    int rows = G_window_rows();
-    int cols = G_window_cols();
+    int rows = Rast_window_rows();
+    int cols = Rast_window_cols();
     void *rowbuf = NULL;
 
     for (i = 0; i < bands; i++) {
@@ -276,8 +276,8 @@
 static int calc_covariance(int *fds, double **covar, double *mu, int bands)
 {
     int j, k;
-    int rows = G_window_rows();
-    int cols = G_window_cols();
+    int rows = Rast_window_rows();
+    int cols = Rast_window_cols();
     int row, col;
 
     for (j = 0; j < bands; j++) {
@@ -351,8 +351,8 @@
     double max = 0.;
     double old_range = 0.;
     double new_range = 0.;
-    int rows = G_window_rows();
-    int cols = G_window_cols();
+    int rows = Rast_window_rows();
+    int cols = Rast_window_cols();
     int cell_mapsiz = Rast_cell_size(CELL_TYPE);
     int dcell_mapsiz = Rast_cell_size(DCELL_TYPE);
     DCELL *d_buf;

Modified: grass/trunk/imagery/i.points/drawcell.c
===================================================================
--- grass/trunk/imagery/i.points/drawcell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.points/drawcell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -37,8 +37,8 @@
     set_colors(colors);
 
     Rast_set_window(&view->cell.head);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     left = view->cell.left;
     top = view->cell.top;

Modified: grass/trunk/imagery/i.rectify/rectify.c
===================================================================
--- grass/trunk/imagery/i.rectify/rectify.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.rectify/rectify.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -42,8 +42,8 @@
     Rast_set_window(&cellhd);
     infd = Rast_open_old(name, mapset);
     map_type = Rast_get_map_type(infd);
-    rast = (void *)G_calloc(G_window_cols() + 1, Rast_cell_size(map_type));
-    Rast_set_null_value(rast, G_window_cols() + 1, map_type);
+    rast = (void *)G_calloc(Rast_window_cols() + 1, Rast_cell_size(map_type));
+    Rast_set_null_value(rast, Rast_window_cols() + 1, map_type);
 
     G_copy(&win, &target_window, sizeof(win));
 

Modified: grass/trunk/imagery/i.rgb.his/main.c
===================================================================
--- grass/trunk/imagery/i.rgb.his/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.rgb.his/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -81,8 +81,8 @@
 
 
     /* get dimension of the image */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     openfiles(opt_red->answer, opt_green->answer, opt_blue->answer,
 	      opt_hue->answer, opt_inten->answer, opt_sat->answer,

Modified: grass/trunk/imagery/i.smap/openfiles.c
===================================================================
--- grass/trunk/imagery/i.smap/openfiles.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.smap/openfiles.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -26,7 +26,7 @@
     files->cellbuf = Rast_allocate_d_buf();
     files->outbuf = Rast_allocate_c_buf();
 
-    files->isdata = G_malloc(G_window_cols());
+    files->isdata = G_malloc(Rast_window_cols());
 
     files->nbands = Ref.nfiles;
     files->band_fd = (int *)G_calloc(Ref.nfiles, sizeof(int));

Modified: grass/trunk/imagery/i.smap/segment.c
===================================================================
--- grass/trunk/imagery/i.smap/segment.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.smap/segment.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -47,8 +47,8 @@
     ml = parms->ml;		/* use maxl? */
     block_size = parms->blocksize;
 
-    wd = G_window_cols();	/* get width from GRASS */
-    ht = G_window_rows();	/* get height from GRASS */
+    wd = Rast_window_cols();	/* get width from GRASS */
+    ht = Rast_window_rows();	/* get height from GRASS */
 
     /* make blocksize a power of 2 */
     if (block_size < 8)

Modified: grass/trunk/imagery/i.sunhours/main.c
===================================================================
--- grass/trunk/imagery/i.sunhours/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.sunhours/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -77,8 +77,8 @@
     inrast_lat = Rast_allocate_d_buf();
 
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     outrast1 = Rast_allocate_d_buf();
     outfd1 = Rast_open_new(result1, DCELL_TYPE);

Modified: grass/trunk/imagery/i.vi/main.c
===================================================================
--- grass/trunk/imagery/i.vi/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.vi/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -238,8 +238,8 @@
 	inrast_chan7chan = Rast_allocate_d_buf();
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_d_buf();
 
     /* Create New raster files */ 

Modified: grass/trunk/imagery/i.vpoints/drawcell.c
===================================================================
--- grass/trunk/imagery/i.vpoints/drawcell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.vpoints/drawcell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -47,8 +47,8 @@
     }
 
     Rast_set_window(&view->cell.head);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     left = view->cell.left;
     top = view->cell.top;

Modified: grass/trunk/imagery/i.zc/main.c
===================================================================
--- grass/trunk/imagery/i.zc/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/imagery/i.zc/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -121,8 +121,8 @@
     G_get_set_window(&window);
 
     /* get the rows and columns in the current window */
-    or = G_window_rows();
-    oc = G_window_cols();
+    or = Rast_window_rows();
+    oc = Rast_window_cols();
     rows = G_math_max_pow2((long)or);
     cols = G_math_max_pow2((long)oc);
     size = (rows > cols) ? rows : cols;

Modified: grass/trunk/include/gisdefs.h
===================================================================
--- grass/trunk/include/gisdefs.h	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/include/gisdefs.h	2010-02-01 17:53:15 UTC (rev 40771)
@@ -50,9 +50,6 @@
 void G_adjust_Cell_head(struct Cell_head *, int, int);
 void G_adjust_Cell_head3(struct Cell_head *, int, int, int);
 
-/* align_window.c */
-void G_align_window(struct Cell_head *, const struct Cell_head *);
-
 /* alloc.c */
 #define G_incr_void_ptr(ptr, size) \
     ((void *)((const unsigned char *)(ptr) + (size)))
@@ -675,14 +672,8 @@
 int G_scan_resolution(const char *, double *, int);
 
 /* window_map.c */
-double G_northing_to_row(double, const struct Cell_head *);
 double G_adjust_east_longitude(double, double);
 double G_adjust_easting(double, const struct Cell_head *);
-double G_easting_to_col(double, const struct Cell_head *);
-double G_row_to_northing(double, const struct Cell_head *);
-double G_col_to_easting(double, const struct Cell_head *);
-int G_window_rows(void);
-int G_window_cols(void);
 void G__init_window(void);
 
 /* worker.c */

Modified: grass/trunk/include/rasterdefs.h
===================================================================
--- grass/trunk/include/rasterdefs.h	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/include/rasterdefs.h	2010-02-01 17:53:15 UTC (rev 40771)
@@ -5,6 +5,9 @@
 
 /* --- ANSI prototypes for the lib/raster functions --- */
 
+/* align_window.c */
+void Rast_align_window(struct Cell_head *, const struct Cell_head *);
+
 /* alloc_cell.c */
 size_t Rast_cell_size(RASTER_MAP_TYPE);
 void *Rast_allocate_buf(RASTER_MAP_TYPE);
@@ -517,6 +520,14 @@
 /* set_window.c */
 void Rast_set_window(struct Cell_head *);
 
+/* window.c */
+double Rast_northing_to_row(double, const struct Cell_head *);
+double Rast_easting_to_col(double, const struct Cell_head *);
+double Rast_row_to_northing(double, const struct Cell_head *);
+double Rast_col_to_easting(double, const struct Cell_head *);
+int Rast_window_rows(void);
+int Rast_window_cols(void);
+
 /* window_map.c */
 void Rast__create_window_mapping(int);
 int Rast_row_repeat_nomask(int, int);

Deleted: grass/trunk/lib/gis/align_window.c
===================================================================
--- grass/trunk/lib/gis/align_window.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/gis/align_window.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -1,74 +0,0 @@
-/*!
- * \file gis/align_window.c
- *
- * \brief GIS Library - Window alignment functions.
- *
- * (C) 2001-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 for details.
- *
- * \author Original author CERL
- */
-
-#include <stdio.h>
-#include <math.h>
-
-#include <grass/gis.h>
-
-/*!
- * \brief Align two regions.
- *
- * Modifies the input <i>window</i> to align to <i>ref</i> region. The
- * resolutions in <i>window</i> are set to match those in <i>ref</i>
- * and the <i>window</i> edges (north, south, east, west) are modified
- * to align with the grid of the <i>ref</i> region.
- *
- * The <i>window</i> may be enlarged if necessary to achieve the
- * alignment.  The north is rounded northward, the south southward,
- * the east eastward and the west westward. Lon-lon constraints are
- * taken into consideration to make sure that the north doesn't go
- * above 90 degrees (for lat/lon) or that the east does "wrap" past
- * the west, etc.
- *
- * \param[in,out] window pointer to Cell_head to be modified
- * \param ref pointer to Cell_head
- *
- * \return NULL on success
- */
-
-void G_align_window(struct Cell_head *window, const struct Cell_head *ref)
-{
-    int preserve;
-
-    window->ns_res = ref->ns_res;
-    window->ew_res = ref->ew_res;
-    window->zone = ref->zone;
-    window->proj = ref->proj;
-
-    preserve = window->proj == PROJECTION_LL &&
-	window->east == (window->west + 360);
-    window->south =
-	G_row_to_northing(ceil(G_northing_to_row(window->south, ref)), ref);
-    window->north =
-	G_row_to_northing(floor(G_northing_to_row(window->north, ref)), ref);
-    window->east =
-	G_col_to_easting(ceil(G_easting_to_col(window->east, ref)), ref);
-    window->west =
-	G_col_to_easting(floor(G_easting_to_col(window->west, ref)), ref);
-
-    if (window->proj == PROJECTION_LL) {
-	while (window->north > 90.0)
-	    window->north -= window->ns_res;
-	while (window->south < -90.0)
-	    window->south += window->ns_res;
-
-	if (preserve)
-	    window->east = window->west + 360;
-	else
-	    while (window->east - window->west > 360.0)
-		window->east -= window->ew_res;
-    }
-
-    G_adjust_Cell_head(window, 0, 0);
-}

Modified: grass/trunk/lib/gis/get_window.c
===================================================================
--- grass/trunk/lib/gis/get_window.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/gis/get_window.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -39,7 +39,7 @@
  * should not use this routine since its use implies that the active
  * module region will not be used. Programs that read or write raster
  * map data (or vector data) can query the active module region using
- * G_window_rows() and G_window_cols().
+ * Rast_window_rows() and Rast_window_cols().
  *
  * \param window pointer to Cell_head
  */

Modified: grass/trunk/lib/gis/window_map.c
===================================================================
--- grass/trunk/lib/gis/window_map.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/gis/window_map.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -11,34 +11,12 @@
  * \author Original author CERL
  */
 
-#include <stdlib.h>
 #include <grass/gis.h>
 
 #include "G.h"
 
 
-
 /*!
- * \brief Northing to row.
- *
- * Converts a <i>north</i>ing relative to a <i>window</i> to a row.
-
- * <b>Note:</b> The result is a double. Casting it to an integer will 
- * give the row number.
- *
- * \param north northing value
- * \param window pointer to Cell_head
- *
- * \return row number
- */
-
-double G_northing_to_row(double north, const struct Cell_head *window)
-{
-    return (window->north - north) / window->ns_res;
-}
-
-
-/*!
  * \brief Adjust east longitude.
  *
  * This routine returns an equivalent <i>east</i> that is
@@ -91,131 +69,6 @@
 }
 
 /*!
- * \brief Easting to column.
- *
- * Converts <i>east</i> relative to a <i>window</i> to a column.
-
- * <b>Note:</b> The result is a <i>double</i>. Casting it to an 
- * <i>int</i> will give the column number.
- *
- * \param east east coordinate
- * \param window pointer to Cell_head
- *
- * \return column number
- */
-
-double G_easting_to_col(double east, const struct Cell_head *window)
-{
-    east = G_adjust_easting(east, window);
-
-    return (east - window->west) / window->ew_res;
-}
-
-/*!
- * \brief Row to northing.
- *
- * Converts a <i>row</i> relative to a <i>window</i> to a
- * northing.
-
- * <b>Note:</b> row is a double:
- *  - row+0.0 will return the northing for the northern edge of the row.
- *  - row+0.5 will return the northing for the center of the row.
- *  - row+1.0 will return the northing for the southern edge of the row.
- *
- * <b>Note:</b> The result is a <i>double</i>. Casting it to an
- * <i>int</i> will give the column number.
- *
- * \param row row number
- * \param[in] window pointer to Cell_head
- *
- * \return north coordinate
- */
-double G_row_to_northing(double row, const struct Cell_head *window)
-{
-    return window->north - row * window->ns_res;
-}
-
-/*!
- * \brief Column to easting.
- *
- * Converts a <i>col</i> relative to a <i>window</i> to an easting.
- *
- * <b>Note:</b> <i>col</i> is a <i>double</i>:
- *  - col+0.0 will return the easting for the western edge of the column.
- *  - col+0.5 will return the easting for the center of the column.
- *  - col+1.0 will return the easting for the eastern edge of the column.
- *
- * \param col column number
- * \param[in] window pointer to Cell_head
- *
- * \return east coordinate
- */
-double G_col_to_easting(double col, const struct Cell_head *window)
-{
-    return window->west + col * window->ew_res;
-}
-
-/*!
- * \brief Number of rows in active window.
- *
- * This routine returns the number of rows in the active module window. 
- * Before raster files can be read or written, it is necessary to
- * known how many rows are in the active window. For example:
- \code  
-int nrows, cols;
-int row, col;
-
-nrows = G_window_rows();
-ncols = G_window_cols();
-for (row = 0; row < nrows; row++) {
-    // read row ...
-    for (col = 0; col < ncols; col++) {
-        // process col ...
-    }
-}
- \endcode 
- *
- * \return number of rows
- */
-int G_window_rows(void)
-{
-    G__init_window();
-
-    return G__.window.rows;
-}
-
-/*!
- * \brief Number of columns in active window.
- *
- * These routines return the number of rows and columns (respectively)
- * in the active module region. Before raster maps can be read or
- * written, it is necessary to known how many rows and columns are in
- * the active region. For example:
- *
- \code  
-int nrows, cols;
-int row, col;
-
-nrows = G_window_rows();
-ncols = G_window_cols();
-for (row = 0; row < nrows; row++) {
-    // read row ...
-    for (col = 0; col < ncols; col++) {
-        // process col ...
-    }
-}
- \endcode 
- *
- * \return number of columns
- */
-int G_window_cols(void)
-{
-    G__init_window();
-
-    return G__.window.cols;
-}
-
-/*!
  * \brief Initialize window.
  *
  */

Copied: grass/trunk/lib/raster/align_window.c (from rev 40768, grass/trunk/lib/gis/align_window.c)
===================================================================
--- grass/trunk/lib/raster/align_window.c	                        (rev 0)
+++ grass/trunk/lib/raster/align_window.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -0,0 +1,75 @@
+/*!
+ * \file gis/align_window.c
+ *
+ * \brief GIS Library - Window alignment functions.
+ *
+ * (C) 2001-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 for details.
+ *
+ * \author Original author CERL
+ */
+
+#include <stdio.h>
+#include <math.h>
+
+#include <grass/gis.h>
+#include <grass/raster.h>
+
+/*!
+ * \brief Align two regions.
+ *
+ * Modifies the input <i>window</i> to align to <i>ref</i> region. The
+ * resolutions in <i>window</i> are set to match those in <i>ref</i>
+ * and the <i>window</i> edges (north, south, east, west) are modified
+ * to align with the grid of the <i>ref</i> region.
+ *
+ * The <i>window</i> may be enlarged if necessary to achieve the
+ * alignment.  The north is rounded northward, the south southward,
+ * the east eastward and the west westward. Lon-lon constraints are
+ * taken into consideration to make sure that the north doesn't go
+ * above 90 degrees (for lat/lon) or that the east does "wrap" past
+ * the west, etc.
+ *
+ * \param[in,out] window pointer to Cell_head to be modified
+ * \param ref pointer to Cell_head
+ *
+ * \return NULL on success
+ */
+
+void Rast_align_window(struct Cell_head *window, const struct Cell_head *ref)
+{
+    int preserve;
+
+    window->ns_res = ref->ns_res;
+    window->ew_res = ref->ew_res;
+    window->zone = ref->zone;
+    window->proj = ref->proj;
+
+    preserve = window->proj == PROJECTION_LL &&
+	window->east == (window->west + 360);
+    window->south =
+	Rast_row_to_northing(ceil(Rast_northing_to_row(window->south, ref)), ref);
+    window->north =
+	Rast_row_to_northing(floor(Rast_northing_to_row(window->north, ref)), ref);
+    window->east =
+	Rast_col_to_easting(ceil(Rast_easting_to_col(window->east, ref)), ref);
+    window->west =
+	Rast_col_to_easting(floor(Rast_easting_to_col(window->west, ref)), ref);
+
+    if (window->proj == PROJECTION_LL) {
+	while (window->north > 90.0)
+	    window->north -= window->ns_res;
+	while (window->south < -90.0)
+	    window->south += window->ns_res;
+
+	if (preserve)
+	    window->east = window->west + 360;
+	else
+	    while (window->east - window->west > 360.0)
+		window->east -= window->ew_res;
+    }
+
+    G_adjust_Cell_head(window, 0, 0);
+}

Modified: grass/trunk/lib/raster/alloc_cell.c
===================================================================
--- grass/trunk/lib/raster/alloc_cell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/raster/alloc_cell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -54,7 +54,7 @@
  */
 void *Rast_allocate_buf(RASTER_MAP_TYPE data_type)
 {
-    return (void *)G_calloc(G_window_cols() + 1, Rast_cell_size(data_type));
+    return (void *)G_calloc(Rast_window_cols() + 1, Rast_cell_size(data_type));
 }
 
 /*!
@@ -81,7 +81,7 @@
  */
 CELL *Rast_allocate_c_buf(void)
 {
-    return (CELL *) G_calloc(G_window_cols() + 1, sizeof(CELL));
+    return (CELL *) G_calloc(Rast_window_cols() + 1, sizeof(CELL));
 }
 
 /*!
@@ -94,7 +94,7 @@
  */
 FCELL *Rast_allocate_f_buf(void)
 {
-    return (FCELL *) G_calloc(G_window_cols() + 1, sizeof(FCELL));
+    return (FCELL *) G_calloc(Rast_window_cols() + 1, sizeof(FCELL));
 }
 
 /*!
@@ -107,7 +107,7 @@
  */
 DCELL *Rast_allocate_d_buf(void)
 {
-    return (DCELL *) G_calloc(G_window_cols() + 1, sizeof(DCELL));
+    return (DCELL *) G_calloc(Rast_window_cols() + 1, sizeof(DCELL));
 }
 
 /*!
@@ -120,7 +120,7 @@
  */
 char *Rast_allocate_null_buf(void)
 {
-    return (char *)G_calloc(G_window_cols() + 1, sizeof(char));
+    return (char *)G_calloc(Rast_window_cols() + 1, sizeof(char));
 }
 
 /*!

Modified: grass/trunk/lib/raster/get_row_colr.c
===================================================================
--- grass/trunk/lib/raster/get_row_colr.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/raster/get_row_colr.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -40,7 +40,7 @@
 			 unsigned char *red, unsigned char *grn,
 			 unsigned char *blu, unsigned char *nul)
 {
-    int cols = G_window_cols();
+    int cols = Rast_window_cols();
     int type = Rast_get_map_type(fd);
     int size = Rast_cell_size(type);
     void *array;

Modified: grass/trunk/lib/raster/sample.c
===================================================================
--- grass/trunk/lib/raster/sample.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/raster/sample.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -98,11 +98,11 @@
     DCELL *maprow = Rast_allocate_d_buf();
 
     /* convert northing and easting to row and col, resp */
-    row = (int)floor(G_northing_to_row(north, window));
-    col = (int)floor(G_easting_to_col(east, window));
+    row = (int)floor(Rast_northing_to_row(north, window));
+    col = (int)floor(Rast_easting_to_col(east, window));
 
-    if (row < 0 || row >= G_window_rows() ||
-	col < 0 || col >= G_window_cols()) {
+    if (row < 0 || row >= Rast_window_rows() ||
+	col < 0 || col >= Rast_window_cols()) {
 	Rast_set_d_null_value(&result, 1);
 	goto done;
     }
@@ -157,8 +157,8 @@
     double frow, fcol, trow, tcol;
     DCELL result;
 
-    frow = G_northing_to_row(north, window);
-    fcol = G_easting_to_col(east, window);
+    frow = Rast_northing_to_row(north, window);
+    fcol = Rast_easting_to_col(east, window);
 
     /* convert northing and easting to row and col, resp */
     row = (int)floor(frow - 0.5);
@@ -167,8 +167,8 @@
     trow = frow - row - 0.5;
     tcol = fcol - col - 0.5;
 
-    if (row < 0 || row + 1 >= G_window_rows() ||
-	col < 0 || col + 1 >= G_window_cols()) {
+    if (row < 0 || row + 1 >= Rast_window_rows() ||
+	col < 0 || col + 1 >= Rast_window_cols()) {
 	Rast_set_d_null_value(&result, 1);
 	goto done;
     }
@@ -249,8 +249,8 @@
     for (i = 0; i < 4; i++)
 	rows[i] = Rast_allocate_d_buf();
 
-    frow = G_northing_to_row(north, window);
-    fcol = G_easting_to_col(east, window);
+    frow = Rast_northing_to_row(north, window);
+    fcol = Rast_easting_to_col(east, window);
 
     /* convert northing and easting to row and col, resp */
     row = (int)floor(frow - 1.5);
@@ -259,8 +259,8 @@
     trow = frow - row - 1.5;
     tcol = fcol - col - 1.5;
 
-    if (row < 0 || row + 3 >= G_window_rows() ||
-	col < 0 || col + 3 >= G_window_cols()) {
+    if (row < 0 || row + 3 >= Rast_window_rows() ||
+	col < 0 || col + 3 >= Rast_window_cols()) {
 	Rast_set_d_null_value(&result, 1);
 	goto done;
     }

Added: grass/trunk/lib/raster/window.c
===================================================================
--- grass/trunk/lib/raster/window.c	                        (rev 0)
+++ grass/trunk/lib/raster/window.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -0,0 +1,151 @@
+#include <grass/gis.h>
+#include <grass/raster.h>
+
+#include "../gis/G.h"
+#include "R.h"
+
+/*!
+ * \brief Number of rows in active window.
+ *
+ * This routine returns the number of rows in the active module window. 
+ * Before raster files can be read or written, it is necessary to
+ * known how many rows are in the active window. For example:
+ \code  
+int nrows, cols;
+int row, col;
+
+nrows = Rast_window_rows();
+ncols = Rast_window_cols();
+for (row = 0; row < nrows; row++) {
+    // read row ...
+    for (col = 0; col < ncols; col++) {
+        // process col ...
+    }
+}
+ \endcode 
+ *
+ * \return number of rows
+ */
+int Rast_window_rows(void)
+{
+    G__init_window();
+
+    return G__.window.rows;
+}
+
+/*!
+ * \brief Number of columns in active window.
+ *
+ * These routines return the number of rows and columns (respectively)
+ * in the active module region. Before raster maps can be read or
+ * written, it is necessary to known how many rows and columns are in
+ * the active region. For example:
+ *
+ \code  
+int nrows, cols;
+int row, col;
+
+nrows = Rast_window_rows();
+ncols = Rast_window_cols();
+for (row = 0; row < nrows; row++) {
+    // read row ...
+    for (col = 0; col < ncols; col++) {
+        // process col ...
+    }
+}
+ \endcode 
+ *
+ * \return number of columns
+ */
+int Rast_window_cols(void)
+{
+    G__init_window();
+
+    return G__.window.cols;
+}
+
+/*!
+ * \brief Northing to row.
+ *
+ * Converts a <i>north</i>ing relative to a <i>window</i> to a row.
+
+ * <b>Note:</b> The result is a double. Casting it to an integer will 
+ * give the row number.
+ *
+ * \param north northing value
+ * \param window pointer to Cell_head
+ *
+ * \return row number
+ */
+
+double Rast_northing_to_row(double north, const struct Cell_head *window)
+{
+    return (window->north - north) / window->ns_res;
+}
+
+
+/*!
+ * \brief Easting to column.
+ *
+ * Converts <i>east</i> relative to a <i>window</i> to a column.
+
+ * <b>Note:</b> The result is a <i>double</i>. Casting it to an 
+ * <i>int</i> will give the column number.
+ *
+ * \param east east coordinate
+ * \param window pointer to Cell_head
+ *
+ * \return column number
+ */
+
+double Rast_easting_to_col(double east, const struct Cell_head *window)
+{
+    east = G_adjust_easting(east, window);
+
+    return (east - window->west) / window->ew_res;
+}
+
+/*!
+ * \brief Row to northing.
+ *
+ * Converts a <i>row</i> relative to a <i>window</i> to a
+ * northing.
+
+ * <b>Note:</b> row is a double:
+ *  - row+0.0 will return the northing for the northern edge of the row.
+ *  - row+0.5 will return the northing for the center of the row.
+ *  - row+1.0 will return the northing for the southern edge of the row.
+ *
+ * <b>Note:</b> The result is a <i>double</i>. Casting it to an
+ * <i>int</i> will give the column number.
+ *
+ * \param row row number
+ * \param[in] window pointer to Cell_head
+ *
+ * \return north coordinate
+ */
+double Rast_row_to_northing(double row, const struct Cell_head *window)
+{
+    return window->north - row * window->ns_res;
+}
+
+/*!
+ * \brief Column to easting.
+ *
+ * Converts a <i>col</i> relative to a <i>window</i> to an easting.
+ *
+ * <b>Note:</b> <i>col</i> is a <i>double</i>:
+ *  - col+0.0 will return the easting for the western edge of the column.
+ *  - col+0.5 will return the easting for the center of the column.
+ *  - col+1.0 will return the easting for the eastern edge of the column.
+ *
+ * \param col column number
+ * \param[in] window pointer to Cell_head
+ *
+ * \return east coordinate
+ */
+double Rast_col_to_easting(double col, const struct Cell_head *window)
+{
+    return window->west + col * window->ew_res;
+}
+

Modified: grass/trunk/lib/raster/zero_cell.c
===================================================================
--- grass/trunk/lib/raster/zero_cell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/raster/zero_cell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -27,7 +27,7 @@
 
 void Rast_zero_c_buf(CELL * buf)
 {
-    int i = G_window_cols();
+    int i = Rast_window_cols();
 
     while (i--)
 	*buf++ = 0;
@@ -45,5 +45,5 @@
  */
 void Rast_zero_buf(void *rast, RASTER_MAP_TYPE data_type)
 {
-    memset(rast, 0, G_window_cols() * Rast_cell_size(data_type));
+    memset(rast, 0, Rast_window_cols() * Rast_cell_size(data_type));
 }

Modified: grass/trunk/lib/rst/interp_float/output2d.c
===================================================================
--- grass/trunk/lib/rst/interp_float/output2d.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/lib/rst/interp_float/output2d.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -95,15 +95,15 @@
 
     Rast_set_window(cellhd);
 
-    if (nrows != G_window_rows()) {
+    if (nrows != Rast_window_rows()) {
 	G_warning(_("Rows changed from %d to %d"), nrows,
-		  G_window_rows());
+		  Rast_window_rows());
 	return -1;
     }
 
-    if (ncols != G_window_cols()) {
+    if (ncols != Rast_window_cols()) {
 	G_warning(_("Cols changed from %d to %d"), ncols,
-		  G_window_cols());
+		  Rast_window_cols());
 	return -1;
     }
 

Modified: grass/trunk/ps/ps.map/do_masking.c
===================================================================
--- grass/trunk/ps/ps.map/do_masking.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/ps/ps.map/do_masking.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -24,11 +24,11 @@
 
 
     /* adjust columns to multiple of 8 */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     while (cols % 8)
 	cols++;
-    factor = (double)cols / (double)G_window_cols();
+    factor = (double)cols / (double)Rast_window_cols();
     width = factor * PS.map_pix_wide;
 
     /* write mask to PostScript file, using "no data" color */

Modified: grass/trunk/ps/ps.map/ps_outline.c
===================================================================
--- grass/trunk/ps/ps.map/ps_outline.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/ps/ps.map/ps_outline.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -116,14 +116,14 @@
     k = 0;
     raster_size = Rast_cell_size(map_type);
     while (read_next()) {	/* read rest of file, one row at *//*   a time */
-	n1 = G_row_to_northing((double)row - 1., &(PS.w));
-	n2 = G_row_to_northing((double)row, &(PS.w));
-	n3 = G_row_to_northing((double)row + 1., &(PS.w));
+	n1 = Rast_row_to_northing((double)row - 1., &(PS.w));
+	n2 = Rast_row_to_northing((double)row, &(PS.w));
+	n3 = Rast_row_to_northing((double)row + 1., &(PS.w));
 
 	for (col = 0; col < scan_length - 1; col++) {
-	    e1 = G_col_to_easting((double)col - 1., &(PS.w));
-	    e2 = G_col_to_easting((double)col, &(PS.w));
-	    e3 = G_col_to_easting((double)col + 1., &(PS.w));
+	    e1 = Rast_col_to_easting((double)col - 1., &(PS.w));
+	    e2 = Rast_col_to_easting((double)col, &(PS.w));
+	    e3 = Rast_col_to_easting((double)col + 1., &(PS.w));
 	    tl = G_incr_void_ptr(buffer[top], col * raster_size);
 	    /* top left in window */
 	    tr = G_incr_void_ptr(buffer[top], (col + 1) * raster_size);

Modified: grass/trunk/raster/r.basins.fill/main.c
===================================================================
--- grass/trunk/raster/r.basins.fill/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.basins.fill/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -94,8 +94,8 @@
     Rast_get_cellhd(drain_name, "", &window);
     Rast_set_window(&window);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     ridge_name = ridge_opt->answer;
 

Modified: grass/trunk/raster/r.bitpattern/main.c
===================================================================
--- grass/trunk/raster/r.bitpattern/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.bitpattern/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -107,8 +107,8 @@
     inrast = Rast_allocate_buf(data_type);
 
     /* Allocate output buffer, use input map data_type */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_buf(data_type);
 
     outfd = Rast_open_new(result, data_type);

Modified: grass/trunk/raster/r.carve/enforce_ds.c
===================================================================
--- grass/trunk/raster/r.carve/enforce_ds.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.carve/enforce_ds.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -73,7 +73,7 @@
 
     /* allocate and clear memory for entire raster */
     rbuf =
-	G_calloc(G_window_rows() * G_window_cols(),
+	G_calloc(Rast_window_rows() * Rast_window_cols(),
 		 Rast_cell_size(parm->raster_type));
 
     /* first read whole elevation file into buf */
@@ -122,7 +122,7 @@
 	return 0;
 
     if (!bm)
-	bm = BM_create(G_window_cols(), G_window_rows());
+	bm = BM_create(Rast_window_cols(), Rast_window_rows());
     clear_bitmap(bm);
 
     pg_init(&pg);
@@ -133,12 +133,12 @@
     for (i = 0; i < points->n_points; i++) {
 	Point2 pt, ptxy;
 	double elev;
-	int row = G_northing_to_row(points->y[i], &wind);
-	int col = G_easting_to_col(points->x[i], &wind);
+	int row = Rast_northing_to_row(points->y[i], &wind);
+	int col = Rast_easting_to_col(points->x[i], &wind);
 
 	/* rough clipping */
-	if (row < 0 || row > G_window_rows() - 1 ||
-	    col < 0 || col > G_window_cols() - 1) {
+	if (row < 0 || row > Rast_window_rows() - 1 ||
+	    col < 0 || col > Rast_window_cols() - 1) {
 	    if (first_in != -1)
 		in_out = 1;
 
@@ -210,8 +210,8 @@
 {
     int i, j;
 
-    for (i = 0; i < G_window_rows(); i++)
-	for (j = 0; j < G_window_cols(); j++)
+    for (i = 0; i < Rast_window_rows(); i++)
+	for (j = 0; j < Rast_window_cols(); j++)
 	    BM_set(bm, i, j, 0);
 }
 
@@ -278,24 +278,24 @@
 	{
 	    CELL *cbuf = data;
 
-	    cbuf[row * G_window_cols() + col] =
-		MIN(cbuf[row * G_window_cols() + col], elev) - (int)depth;
+	    cbuf[row * Rast_window_cols() + col] =
+		MIN(cbuf[row * Rast_window_cols() + col], elev) - (int)depth;
 	}
 	break;
     case FCELL_TYPE:
 	{
 	    FCELL *fbuf = data;
 
-	    fbuf[row * G_window_cols() + col] =
-		MIN(fbuf[row * G_window_cols() + col], elev) - depth;
+	    fbuf[row * Rast_window_cols() + col] =
+		MIN(fbuf[row * Rast_window_cols() + col], elev) - depth;
 	}
 	break;
     case DCELL_TYPE:
 	{
 	    DCELL *dbuf = data;
 
-	    dbuf[row * G_window_cols() + col] =
-		MIN(dbuf[row * G_window_cols() + col], elev) - depth;
+	    dbuf[row * Rast_window_cols() + col] =
+		MIN(dbuf[row * Rast_window_cols() + col], elev) - depth;
 	}
 	break;
     }
@@ -313,8 +313,8 @@
     struct Cell_head wind;
 
     G_get_window(&wind);
-    rastrows = G_window_rows();
-    rastcols = G_window_cols();
+    rastrows = Rast_window_rows();
+    rastcols = Rast_window_cols();
 
     Rast_set_d_null_value(&min, 1);
 
@@ -322,8 +322,8 @@
     rowoff = rad / wind.ns_res;
     coloff = rad / wind.ew_res;
 
-    row = G_northing_to_row(py, &wind);
-    col = G_easting_to_col(px, &wind);
+    row = Rast_northing_to_row(py, &wind);
+    col = Rast_easting_to_col(px, &wind);
 
     /* get bounding box of line segment */
     row1 = MAX(0, row - rowoff);
@@ -359,11 +359,11 @@
     }
 
     for (r = row1; r < row2; r++) {
-	double cy = G_row_to_northing(r + 0.5, &wind);
+	double cy = Rast_row_to_northing(r + 0.5, &wind);
 	int c;
 
 	for (c = col1; c < col2; c++) {
-	    double cx = G_col_to_easting(c + 0.5, &wind);
+	    double cx = Rast_col_to_easting(c + 0.5, &wind);
 
 	    if (G_distance(px, py, cx, cy) <= SQR(rad)) {
 		switch (rtype) {
@@ -450,26 +450,26 @@
     coloff = parm->swidth / wind.ew_res;
 
     /* get prevrow and prevcol for iteration 0 of following loop */
-    prevrow = G_northing_to_row(pgxypts[0][1], &wind);
-    prevcol = G_easting_to_col(pgxypts[0][0], &wind);
+    prevrow = Rast_northing_to_row(pgxypts[0][1], &wind);
+    prevcol = Rast_easting_to_col(pgxypts[0][0], &wind);
 
     for (i = 1; i < (npts - 1); i++) {
 	int c, r;
 
-	int row = G_northing_to_row(pgxypts[i][1], &wind);
-	int col = G_easting_to_col(pgxypts[i][0], &wind);
+	int row = Rast_northing_to_row(pgxypts[i][1], &wind);
+	int col = Rast_easting_to_col(pgxypts[i][0], &wind);
 
 	/* get bounding box of line segment */
 	row1 = MAX(0, MIN(row, prevrow) - rowoff);
-	row2 = MIN(G_window_rows() - 1, MAX(row, prevrow) + rowoff);
+	row2 = MIN(Rast_window_rows() - 1, MAX(row, prevrow) + rowoff);
 	col1 = MAX(0, MIN(col, prevcol) - coloff);
-	col2 = MIN(G_window_cols() - 1, MAX(col, prevcol) + coloff);
+	col2 = MIN(Rast_window_cols() - 1, MAX(col, prevcol) + coloff);
 
 	for (r = row1; r < row2; r++) {
-	    cy = G_row_to_northing(r + 0.5, &wind);
+	    cy = Rast_row_to_northing(r + 0.5, &wind);
 
 	    for (c = col1; c < col2; c++) {
-		cellx = G_col_to_easting(c + 0.5, &wind);
+		cellx = Rast_col_to_easting(c + 0.5, &wind);
 		celly = cy;	/* gets written over in distance2... */
 
 		/* Thought about not going past endpoints (use 

Modified: grass/trunk/raster/r.carve/raster.c
===================================================================
--- grass/trunk/raster/r.carve/raster.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.carve/raster.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -7,7 +7,7 @@
 void *read_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 {
     void *tmpbuf = buf;
-    int rows = G_window_rows();
+    int rows = Rast_window_rows();
     int i;
 
     G_message(_("Reading raster map..."));
@@ -17,7 +17,7 @@
 
 	Rast_get_row(fd, tmpbuf, i, rtype);
 	tmpbuf =
-	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * G_window_cols());
+	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * Rast_window_cols());
     }
 
     return tmpbuf;
@@ -27,7 +27,7 @@
 void *write_raster(void *buf, const int fd, const RASTER_MAP_TYPE rtype)
 {
     void *tmpbuf = buf;
-    int rows = G_window_rows();
+    int rows = Rast_window_rows();
     int i;
 
     G_message(_("Writing raster map..."));
@@ -37,7 +37,7 @@
 
 	Rast_put_row(fd, tmpbuf, rtype);
 	tmpbuf =
-	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * G_window_cols());
+	    G_incr_void_ptr(tmpbuf, Rast_cell_size(rtype) * Rast_window_cols());
     }
 
     return tmpbuf;

Modified: grass/trunk/raster/r.category/cats.c
===================================================================
--- grass/trunk/raster/r.category/cats.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.category/cats.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -38,8 +38,8 @@
 
     /* open the raster map */
     fd = Rast_open_old(name, mapset);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     cell = Rast_allocate_c_buf();
     Rast_init_cell_stats(&statf);
 

Modified: grass/trunk/raster/r.circle/main.c
===================================================================
--- grass/trunk/raster/r.circle/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.circle/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -131,10 +131,10 @@
 
 	for (row = 0; row < w.rows; row++) {
 	    G_percent(row, w.rows, 2);
-	    cur[1] = G_row_to_northing(row + 0.5, &w);
+	    cur[1] = Rast_row_to_northing(row + 0.5, &w);
 	    for (col = 0; col < w.cols; col++) {
 		c = col;
-		cur[0] = G_col_to_easting(col + 0.5, &w);
+		cur[0] = Rast_col_to_easting(col + 0.5, &w);
 		int_buf[c] =
 		    (int)(distance(pt, cur, fmin, fmax, binary) * fmult);
 		if (int_buf[c] == 0)

Modified: grass/trunk/raster/r.clump/clump.c
===================================================================
--- grass/trunk/raster/r.clump/clump.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.clump/clump.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -44,8 +44,8 @@
     int column;
 
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* allocate reclump index */
     nalloc = INCR;

Modified: grass/trunk/raster/r.coin/main.c
===================================================================
--- grass/trunk/raster/r.coin/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.coin/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -117,7 +117,7 @@
     dumpname = G_tempfile();
     statname = G_tempfile();
 
-    window_cells = G_window_rows() * G_window_cols();
+    window_cells = Rast_window_rows() * Rast_window_cols();
 
     map1name = parm.map1->answer;
     map2name = parm.map2->answer;

Modified: grass/trunk/raster/r.colors/stats.c
===================================================================
--- grass/trunk/raster/r.colors/stats.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.colors/stats.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -33,8 +33,8 @@
     fd = Rast_open_old(name, mapset);
 
     cell = Rast_allocate_c_buf();
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     Rast_init_cell_stats(statf);
     G_verbose_message(_("Reading raster map <%s>..."),
@@ -62,8 +62,8 @@
     fd = Rast_open_old(name, mapset);
 
     dcell = Rast_allocate_d_buf();
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     statf->geometric = geometric;
     statf->geom_abs = geom_abs;

Modified: grass/trunk/raster/r.compress/main.c
===================================================================
--- grass/trunk/raster/r.compress/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.compress/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -202,7 +202,7 @@
     else
 	new = Rast_open_new(name, map_type);
 
-    nrows = G_window_rows();
+    nrows = Rast_window_rows();
     rast = Rast_allocate_buf(map_type);
 
     oldsize = lseek(old, (off_t) 0, SEEK_END);

Modified: grass/trunk/raster/r.cost/main.c
===================================================================
--- grass/trunk/raster/r.cost/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.cost/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -340,8 +340,8 @@
     move_dir_layer = opt11->answer;
 
     /* Find number of rows and columns in window */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* Open cost cell layer for reading */
     cost_mapset = G_find_raster2(cost_layer, "");
@@ -540,8 +540,8 @@
 		continue;
 	    got_one = 1;
 
-	    col = (int)G_easting_to_col(site->east, &window);
-	    row = (int)G_northing_to_row(site->north, &window);
+	    col = (int)Rast_easting_to_col(site->east, &window);
+	    row = (int)Rast_northing_to_row(site->north, &window);
 
 	    new_start_pt =
 		(struct start_pt *)(G_malloc(sizeof(struct start_pt)));
@@ -589,8 +589,8 @@
 		continue;
 	    have_stop_points = 1;
 
-	    col = (int)G_easting_to_col(site->east, &window);
-	    row = (int)G_northing_to_row(site->north, &window);
+	    col = (int)Rast_easting_to_col(site->east, &window);
+	    row = (int)Rast_northing_to_row(site->north, &window);
 
 	    new_start_pt =
 		(struct start_pt *)(G_malloc(sizeof(struct start_pt)));

Modified: grass/trunk/raster/r.covar/main.c
===================================================================
--- grass/trunk/raster/r.covar/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.covar/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -79,8 +79,8 @@
 	fd[i] = Rast_open_old(name, "");
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     G_message(_("%s: complete ... "), G_program_name());
     count = 0;

Modified: grass/trunk/raster/r.cross/main.c
===================================================================
--- grass/trunk/raster/r.cross/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.cross/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -95,8 +95,8 @@
     if (G_parser(argc, argv))
 	exit(EXIT_FAILURE);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     nfiles = 0;
     non_zero = flag.z->answer;

Modified: grass/trunk/raster/r.describe/describe.c
===================================================================
--- grass/trunk/raster/r.describe/describe.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.describe/describe.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -88,8 +88,8 @@
 	Rast_set_quant_rules(fd, &q);
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     G_verbose_message(_("Reading <%s> ..."), name);
     for (row = 0; row < nrows; row++) {

Modified: grass/trunk/raster/r.distance/distance.c
===================================================================
--- grass/trunk/raster/r.distance/distance.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.distance/distance.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -37,8 +37,8 @@
     double dist;
     double e1, n1, e2, n2;
     extern double G_distance();
-    extern double G_row_to_northing();
-    extern double G_col_to_easting();
+    extern double Rast_row_to_northing();
+    extern double Rast_col_to_easting();
     int zerro_row, zerro_col;
 
     int nulldistance = 0;
@@ -48,18 +48,18 @@
 	nulldistance = null_distance(name1, name2, &zerro_row, &zerro_col);
 
     for (i1 = 0; i1 < list1->ncells; i1++) {
-	e1 = G_col_to_easting(list1->col[i1] + 0.5, region);
-	n1 = G_row_to_northing(list1->row[i1] + 0.5, region);
+	e1 = Rast_col_to_easting(list1->col[i1] + 0.5, region);
+	n1 = Rast_row_to_northing(list1->row[i1] + 0.5, region);
 
 	for (i2 = 0; i2 < list2->ncells; i2++) {
 	    if (!nulldistance) {
-		e2 = G_col_to_easting(list2->col[i2] + 0.5, region);
-		n2 = G_row_to_northing(list2->row[i2] + 0.5, region);
+		e2 = Rast_col_to_easting(list2->col[i2] + 0.5, region);
+		n2 = Rast_row_to_northing(list2->row[i2] + 0.5, region);
 		dist = G_distance(e1, n1, e2, n2);
 	    }
 	    else {
-		e2 = e1 = G_col_to_easting(zerro_col + 0.5, region);
-		n2 = n1 = G_row_to_northing(zerro_row + 0.5, region);
+		e2 = e1 = Rast_col_to_easting(zerro_col + 0.5, region);
+		n2 = n1 = Rast_row_to_northing(zerro_row + 0.5, region);
 		dist = 0.;
 	    }
 
@@ -101,8 +101,8 @@
     G_message(_("Reading maps  <%s,%s> while finding 0 distance ..."), name1,
 	      name2);
 
-    ncols = G_window_cols();
-    nrows = G_window_rows();
+    ncols = Rast_window_cols();
+    nrows = Rast_window_rows();
 
     for (row = 0; row < nrows; row++) {
 

Modified: grass/trunk/raster/r.distance/edges.c
===================================================================
--- grass/trunk/raster/r.distance/edges.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.distance/edges.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -45,8 +45,8 @@
 
     G_message(_("Reading map %s ..."), map->fullname);
 
-    ncols = G_window_cols();
-    nrows = G_window_rows();
+    ncols = Rast_window_cols();
+    nrows = Rast_window_rows();
 
     buf0 = (CELL *) G_calloc(ncols + 2, sizeof(CELL));
     buf1 = (CELL *) G_calloc(ncols + 2, sizeof(CELL));

Modified: grass/trunk/raster/r.drain/main.c
===================================================================
--- grass/trunk/raster/r.drain/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.drain/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -223,8 +223,8 @@
 
     /* get the window information  */
     G_get_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     if (opt4->answer) {
 	Points = Vect_new_line_struct();
 	Cats = Vect_new_cats_struct();
@@ -240,8 +240,8 @@
 	for (i = 0; coordopt->answers[i] != NULL; i += 2) {
 	    G_scan_easting(coordopt->answers[i], &east, G_projection());
 	    G_scan_northing(coordopt->answers[i + 1], &north, G_projection());
-	    start_col = (int)G_easting_to_col(east, &window);
-	    start_row = (int)G_northing_to_row(north, &window);
+	    start_col = (int)Rast_easting_to_col(east, &window);
+	    start_row = (int)Rast_northing_to_row(north, &window);
 
 	    if (start_row < 0 || start_row > nrows ||
 		start_col < 0 || start_col > ncols) {
@@ -277,8 +277,8 @@
 		if (!G_site_in_region(site, &window))
 		    continue;
 
-		start_col = (int)G_easting_to_col(site->east, &window);
-		start_row = (int)G_northing_to_row(site->north, &window);
+		start_col = (int)Rast_easting_to_col(site->east, &window);
+		start_row = (int)Rast_northing_to_row(site->north, &window);
 
 		/* effectively just a duplicate check to G_site_in_region() ??? */
 		if (start_row < 0 || start_row > nrows || start_col < 0 ||

Modified: grass/trunk/raster/r.fill.dir/main.c
===================================================================
--- grass/trunk/raster/r.fill.dir/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.fill.dir/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -184,8 +184,8 @@
 
     /* get the window information  */
     G_get_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* buffers for internal use */
     bndC.ns = ncols;

Modified: grass/trunk/raster/r.flow/precomp.c
===================================================================
--- grass/trunk/raster/r.flow/precomp.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.flow/precomp.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -80,9 +80,9 @@
 
     if (G_projection() == PROJECTION_LL) {
 	for (row = 0; row < region.rows; row++) {
-	    northing = G_row_to_northing(row + 0.5, &region);
-	    ew_dist[row] = G_distance(G_col_to_easting(0., &region), northing,
-				      G_col_to_easting(1., &region),
+	    northing = Rast_row_to_northing(row + 0.5, &region);
+	    ew_dist[row] = G_distance(Rast_col_to_easting(0., &region), northing,
+				      Rast_col_to_easting(1., &region),
 				      northing);
 	}
     }

Modified: grass/trunk/raster/r.grow/main.c
===================================================================
--- grass/trunk/raster/r.grow/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.grow/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -170,8 +170,8 @@
     if (opt.new->answer)
 	newval = atoi(opt.new->answer);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     if (strcmp(opt.met->answer, "euclidean") == 0)
 	setup_neighbors_euclidean(radius);

Modified: grass/trunk/raster/r.grow.distance/main.c
===================================================================
--- grass/trunk/raster/r.grow.distance/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.grow.distance/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -56,10 +56,10 @@
 
 static double geodesic_distance(int x1, int y1, int x2, int y2)
 {
-    double lat1 = G_row_to_northing(y1 + 0.5, &window);
-    double lat2 = G_row_to_northing(y2 + 0.5, &window);
-    double lon1 = G_col_to_easting(x1 + 0.5, &window);
-    double lon2 = G_col_to_easting(x2 + 0.5, &window);
+    double lat1 = Rast_row_to_northing(y1 + 0.5, &window);
+    double lat2 = Rast_row_to_northing(y2 + 0.5, &window);
+    double lon1 = Rast_col_to_easting(x1 + 0.5, &window);
+    double lon2 = Rast_col_to_easting(x2 + 0.5, &window);
 
     return G_geodesic_distance(lon1, lat1, lon2, lat2);
 }

Modified: grass/trunk/raster/r.horizon/main.c
===================================================================
--- grass/trunk/raster/r.horizon/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.horizon/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -594,13 +594,13 @@
 	fd1 = Rast_open_fp_new(shad_filename);
     }
 
-    if (numrows != G_window_rows())
+    if (numrows != Rast_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), numrows,
-		      G_window_rows());
+		      Rast_window_rows());
 
-    if (numcols != G_window_cols())
+    if (numcols != Rast_window_cols())
 	G_fatal_error(_("OOPS: cols changed from %d to %d"), numcols,
-		      G_window_cols());
+		      Rast_window_cols());
 
     for (iarc = 0; iarc < numrows; iarc++) {
 	i = numrows - iarc - 1;

Modified: grass/trunk/raster/r.in.arc/main.c
===================================================================
--- grass/trunk/raster/r.in.arc/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.in.arc/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -131,12 +131,12 @@
     ncols = cellhd.cols;
     Rast_set_window(&cellhd);
 
-    if (nrows != G_window_rows())
+    if (nrows != Rast_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), nrows,
-		      G_window_rows());
-    if (ncols != G_window_cols())
+		      Rast_window_rows());
+    if (ncols != Rast_window_cols())
 	G_fatal_error(_("OOPS: cols changed from %d to %d"), ncols,
-		      G_window_cols());
+		      Rast_window_cols());
 
     switch (rtype) {
     case CELL_TYPE:

Modified: grass/trunk/raster/r.in.ascii/main.c
===================================================================
--- grass/trunk/raster/r.in.ascii/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.in.ascii/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -191,12 +191,12 @@
     ncols = cellhd.cols;
     Rast_set_window(&cellhd);
 
-    if (nrows != G_window_rows())
+    if (nrows != Rast_window_rows())
 	G_fatal_error(_("OOPS: rows changed from %d to %d"), nrows,
-		      G_window_rows());
-    if (ncols != G_window_cols())
+		      Rast_window_rows());
+    if (ncols != Rast_window_cols())
 	G_fatal_error(_("OOPS: cols changed from %d to %d"), ncols,
-		      G_window_cols());
+		      Rast_window_cols());
 
 
     rast_ptr = Rast_allocate_buf(data_type);

Modified: grass/trunk/raster/r.in.bin/main.c
===================================================================
--- grass/trunk/raster/r.in.bin/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.in.bin/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -473,13 +473,13 @@
 
     Rast_set_window(&cellhd);
 
-    if (grass_nrows != G_window_rows())
+    if (grass_nrows != Rast_window_rows())
 	G_fatal_error("rows changed from %d to %d",
-		      grass_nrows, G_window_rows());
+		      grass_nrows, Rast_window_rows());
 
-    if (grass_ncols != G_window_cols())
+    if (grass_ncols != Rast_window_cols())
 	G_fatal_error("cols changed from %d to %d",
-		      grass_ncols, G_window_cols());
+		      grass_ncols, Rast_window_cols());
 
     expected = (off_t) ncols * nrows * bytes;
     if (flag.gmt_hd->answer)

Modified: grass/trunk/raster/r.in.gridatb/adjcellhd.c
===================================================================
--- grass/trunk/raster/r.in.gridatb/adjcellhd.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.in.gridatb/adjcellhd.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -12,11 +12,11 @@
 
     Rast_set_window(cellhd);
 
-    if (cellhd->rows != G_window_rows()) {
+    if (cellhd->rows != Rast_window_rows()) {
 	retval = 2;
     }
 
-    if (cellhd->cols != G_window_cols()) {
+    if (cellhd->cols != Rast_window_cols()) {
 	retval = 3;
     }
 

Modified: grass/trunk/raster/r.lake/main.c
===================================================================
--- grass/trunk/raster/r.lake/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.lake/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -214,8 +214,8 @@
     if (lakemap)
 	lake_fd = Rast_open_new(lakemap, 1);
 
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     /* If we use x,y as seed... */
     if (sdxy_opt->answer) {
@@ -225,8 +225,8 @@
 
 	G_scan_easting(sdxy_opt->answers[0], &east, G_projection());
 	G_scan_northing(sdxy_opt->answers[1], &north, G_projection());
-	start_col = (int)G_easting_to_col(east, &window);
-	start_row = (int)G_northing_to_row(north, &window);
+	start_col = (int)Rast_easting_to_col(east, &window);
+	start_row = (int)Rast_northing_to_row(north, &window);
 
 	if (start_row < 0 || start_row > rows ||
 	    start_col < 0 || start_col > cols)

Modified: grass/trunk/raster/r.le/r.le.patch/driver.c
===================================================================
--- grass/trunk/raster/r.le/r.le.patch/driver.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.le/r.le.patch/driver.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -2807,8 +2807,8 @@
     REGLIST *ptrfirst, *ptrthis, *ptrnew;
     CELL *row_buf;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     n_scale = 1;
 

Modified: grass/trunk/raster/r.le/r.le.patch/input.c
===================================================================
--- grass/trunk/raster/r.le/r.le.patch/input.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.le/r.le.patch/input.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -383,8 +383,8 @@
     if (edge->answer) {
 	choice->edge = atoi(edge->answer);
 	if (choice->edge < 0 ||
-	    choice->edge >= G_window_rows() ||
-	    choice->edge >= G_window_cols()) {
+	    choice->edge >= Rast_window_rows() ||
+	    choice->edge >= Rast_window_cols()) {
 	    fprintf(stderr, "\n");
 	    fprintf(stderr,
 		    "   ***********************************************\n");

Modified: grass/trunk/raster/r.le/r.le.pixel/driver.c
===================================================================
--- grass/trunk/raster/r.le/r.le.pixel/driver.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.le/r.le.pixel/driver.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -1640,8 +1640,8 @@
 
     data_type = Rast_map_type(choice->fn, G_mapset());
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     g_scale = 1;
 

Modified: grass/trunk/raster/r.le/r.le.setup/main.c
===================================================================
--- grass/trunk/raster/r.le/r.le.setup/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.le/r.le.setup/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -91,7 +91,7 @@
     /* setup the current window for display & clear screen */
     D_setup(1);
 
-    Rw_l = (double)G_window_cols() / G_window_rows();
+    Rw_l = (double)Rast_window_cols() / Rast_window_rows();
     /*R_open_driver(); */
     /* R_font("romant"); */
     G_get_set_window(&window);

Modified: grass/trunk/raster/r.le/r.le.trace/main.c
===================================================================
--- grass/trunk/raster/r.le/r.le.trace/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.le/r.le.trace/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -64,7 +64,7 @@
     /* setup the current window for display */
     G_system(" d.colormode float");
     G_system(" d.frame -e");
-    Rw_l = (double)G_window_cols() / G_window_rows();
+    Rw_l = (double)Rast_window_cols() / Rast_window_rows();
     R_open_driver();
     R_font("romant");
     G_get_set_window(&window);

Modified: grass/trunk/raster/r.li/r.li.daemon/daemon.c
===================================================================
--- grass/trunk/raster/r.li/r.li.daemon/daemon.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.li/r.li.daemon/daemon.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -593,7 +593,7 @@
     lseek(random_access, 0, SEEK_SET);
 
     cell_buf = Rast_allocate_d_buf();
-    Rast_set_d_null_value(cell_buf, G_window_cols() + 1);
+    Rast_set_d_null_value(cell_buf, Rast_window_cols() + 1);
 
     for (i = 0; i < g->sf_y + ((int)g->rl / 2); i++) {
 	Rast_put_row(mv_fd, cell_buf, DCELL_TYPE);
@@ -613,9 +613,9 @@
 
     }
 
-    Rast_set_d_null_value(cell_buf, G_window_cols() + 1);
+    Rast_set_d_null_value(cell_buf, Rast_window_cols() + 1);
 
-    for (i = 0; i < G_window_rows() - g->sf_y - g->rows; i++)
+    for (i = 0; i < Rast_window_rows() - g->sf_y - g->rows; i++)
 	Rast_put_row(mv_fd, cell_buf, DCELL_TYPE);
 
     return 1;

Modified: grass/trunk/raster/r.los/main.c
===================================================================
--- grass/trunk/raster/r.los/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.los/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -194,8 +194,8 @@
     fcell = Rast_allocate_buf(FCELL_TYPE);
 
     /*  find number of rows and columns in elevation map    */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /*      open elevation overlay file for reading         */
     old = Rast_open_old(elev_layer, old_mapset);

Modified: grass/trunk/raster/r.mapcalc/map.c
===================================================================
--- grass/trunk/raster/r.mapcalc/map.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.mapcalc/map.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -27,8 +27,8 @@
 {
     G_get_window(&current_region2);
 
-    rows = G_window_rows();
-    columns = G_window_cols();
+    rows = Rast_window_rows();
+    columns = Rast_window_cols();
     depths = 1;
 }
 

Modified: grass/trunk/raster/r.mapcalc/xcoor.c
===================================================================
--- grass/trunk/raster/r.mapcalc/xcoor.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.mapcalc/xcoor.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -24,7 +24,7 @@
     if (argt[0] != DCELL_TYPE)
 	return E_RES_TYPE;
 
-    x = G_col_to_easting(0.5, &current_region2);
+    x = Rast_col_to_easting(0.5, &current_region2);
 
     for (i = 0; i < columns; i++) {
 	res[i] = x;
@@ -46,7 +46,7 @@
     if (argt[0] != DCELL_TYPE)
 	return E_RES_TYPE;
 
-    y = G_row_to_northing(current_row + 0.5, &current_region2);
+    y = Rast_row_to_northing(current_row + 0.5, &current_region2);
 
     for (i = 0; i < columns; i++)
 	res[i] = y;

Modified: grass/trunk/raster/r.mfilter/main.c
===================================================================
--- grass/trunk/raster/r.mfilter/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.mfilter/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -108,8 +108,8 @@
 
     in_name = opt1->answer;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     buflen = ncols * sizeof(DCELL);
 
     /* get the filter */

Modified: grass/trunk/raster/r.neighbors/bufs.c
===================================================================
--- grass/trunk/raster/r.neighbors/bufs.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.neighbors/bufs.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -15,12 +15,12 @@
     int i;
     int bufsize;
 
-    bufsize = (G_window_cols() + 2 * ncb.nsize) * sizeof(DCELL);
+    bufsize = (Rast_window_cols() + 2 * ncb.nsize) * sizeof(DCELL);
 
     ncb.buf = (DCELL **) G_malloc(ncb.nsize * sizeof(DCELL *));
     for (i = 0; i < ncb.nsize; i++) {
 	ncb.buf[i] = (DCELL *) G_malloc(bufsize);
-	Rast_set_d_null_value(ncb.buf[i], G_window_cols() + 2 * ncb.nsize);
+	Rast_set_d_null_value(ncb.buf[i], Rast_window_cols() + 2 * ncb.nsize);
     }
 
     return 0;

Modified: grass/trunk/raster/r.neighbors/main.c
===================================================================
--- grass/trunk/raster/r.neighbors/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.neighbors/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -211,12 +211,12 @@
     if (!flag.align->answer) {
 	Rast_get_cellhd(ncb.oldcell, "", &cellhd);
 	G_get_window(&window);
-	G_align_window(&window, &cellhd);
+	Rast_align_window(&window, &cellhd);
 	Rast_set_window(&window);
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open raster maps */
     in_fd = Rast_open_old(ncb.oldcell, "");

Modified: grass/trunk/raster/r.out.arc/main.c
===================================================================
--- grass/trunk/raster/r.out.arc/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.arc/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -126,8 +126,8 @@
      */
     raster = Rast_allocate_buf(out_type);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open arc file for writing */
     if (do_stdout)

Modified: grass/trunk/raster/r.out.ascii/main.c
===================================================================
--- grass/trunk/raster/r.out.ascii/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.ascii/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -158,8 +158,8 @@
 	    dp = 16;
     }
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open ascii file for writing or use stdout */
     if (parm.output->answer && strcmp("-", parm.output->answer) != 0) {

Modified: grass/trunk/raster/r.out.bin/main.c
===================================================================
--- grass/trunk/raster/r.out.bin/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.bin/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -425,8 +425,8 @@
     if (flag.gmt_hd->answer)
 	write_gmt_header(&header, swap_flag, fp);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     in_buf = Rast_allocate_d_buf();
     out_buf = G_malloc(ncols * bytes);

Modified: grass/trunk/raster/r.out.gridatb/adjcellhd.c
===================================================================
--- grass/trunk/raster/r.out.gridatb/adjcellhd.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.gridatb/adjcellhd.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -7,10 +7,10 @@
 
     G_set_window(cellhd);
 
-    if (cellhd->rows != G_window_rows())
+    if (cellhd->rows != Rast_window_rows())
 	retval = 2;
 
-    if (cellhd->cols != G_window_cols())
+    if (cellhd->cols != Rast_window_cols())
 	retval = 3;
 
     return (retval);

Modified: grass/trunk/raster/r.out.mat/main.c
===================================================================
--- grass/trunk/raster/r.out.mat/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.mat/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -293,12 +293,12 @@
 
     /* data array, by increasing column */
     raster =
-	G_calloc((G_window_rows() + 1) * (G_window_cols() + 1),
+	G_calloc((Rast_window_rows() + 1) * (Rast_window_cols() + 1),
 		 Rast_cell_size(map_type));
 
     G_debug(1, "mem alloc is %d bytes\n",	/* I think _cols()+1 is unneeded? */
-	    Rast_cell_size(map_type) * (G_window_rows() +
-				       1) * (G_window_cols() + 1));
+	    Rast_cell_size(map_type) * (Rast_window_rows() +
+				       1) * (Rast_window_cols() + 1));
 
     G_verbose_message(_("Reading in map ... "));
 
@@ -306,7 +306,7 @@
     for (row = 0, ptr = raster; row < mrows; row++,
 	 ptr =
 	 G_incr_void_ptr(ptr,
-			 (G_window_cols() + 1) * Rast_cell_size(map_type))) {
+			 (Rast_window_cols() + 1) * Rast_cell_size(map_type))) {
 	Rast_get_row(fd, ptr, row, map_type);
 	G_percent(row, mrows, 2);
     }

Modified: grass/trunk/raster/r.out.mpeg/main.c
===================================================================
--- grass/trunk/raster/r.out.mpeg/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.mpeg/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -175,8 +175,8 @@
 
     G_debug(1, "encoder = [%s]", encoder);
 
-    vrows = G_window_rows();
-    vcols = G_window_cols();
+    vrows = Rast_window_rows();
+    vcols = Rast_window_cols();
     nrows = vrows;
     ncols = vcols;
 
@@ -259,7 +259,7 @@
     pg = G_malloc(size);
     pb = G_malloc(size);
 
-    tsiz = G_window_cols();
+    tsiz = Rast_window_cols();
 
     tr = (unsigned char *)G_malloc(tsiz);
     tg = (unsigned char *)G_malloc(tsiz);

Modified: grass/trunk/raster/r.out.pov/main.c
===================================================================
--- grass/trunk/raster/r.out.pov/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.pov/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -173,8 +173,8 @@
 
     cell = Rast_allocate_c_buf();
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     if (nrows > YMAX || ncols > XMAX)
 	G_fatal_error(_("Raster map is too big! Exceeds %d columns or %d rows"),
 		      XMAX, YMAX);

Modified: grass/trunk/raster/r.out.vrml/main.c
===================================================================
--- grass/trunk/raster/r.out.vrml/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.vrml/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -196,8 +196,8 @@
     Zrange = (w->rows - 1) * w->ns_res;
     Xrange = (w->cols - 1) * w->ew_res;
 
-    transX = -(G_col_to_easting(0.5, w));
-    transZ = -(G_row_to_northing(0.5, w));
+    transX = -(Rast_col_to_easting(0.5, w));
+    transZ = -(Rast_row_to_northing(0.5, w));
     transY = -min;
 
     if (Zrange >= Xrange && Zrange >= Yrange) {	/* northing biggest */

Modified: grass/trunk/raster/r.out.vrml/put_grid.c
===================================================================
--- grass/trunk/raster/r.out.vrml/put_grid.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.out.vrml/put_grid.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -49,12 +49,12 @@
 		G_percent(row, rows - 1, 10);
 
 	    Rast_get_f_row(elevfd, tf, row);
-	    coordz = G_row_to_northing((double)row, w);
+	    coordz = Rast_row_to_northing((double)row, w);
 	    do_coordcnv(&coordz, 'z');
 
 	    /* write a row */
 	    for (col = 0; col < cols; col++) {
-		coordx = G_col_to_easting((double)col, w);
+		coordx = Rast_col_to_easting((double)col, w);
 		do_coordcnv(&coordx, 'x');
 
 		/* HACK: no nulls in vrml grid */

Modified: grass/trunk/raster/r.param.scale/process.c
===================================================================
--- grass/trunk/raster/r.param.scale/process.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.param.scale/process.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -65,8 +65,8 @@
     G_get_window(&region);	/* Fill out the region structure (the   */
     /* geographical limits etc.)            */
 
-    nrows = G_window_rows();	/* Find out the number of rows and      */
-    ncols = G_window_cols();	/* columns of the raster.               */
+    nrows = Rast_window_rows();	/* Find out the number of rows and      */
+    ncols = Rast_window_cols();	/* columns of the raster.               */
 
 
     if ((region.ew_res / region.ns_res >= 1.01) ||	/* If EW and NS resolns are    */

Modified: grass/trunk/raster/r.patch/main.c
===================================================================
--- grass/trunk/raster/r.patch/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.patch/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -112,8 +112,8 @@
     presult = Rast_allocate_buf(out_type);
     patch = Rast_allocate_buf(out_type);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     G_verbose_message(_("Percent complete..."));
     for (row = 0; row < nrows; row++) {

Modified: grass/trunk/raster/r.proj/bordwalk.c
===================================================================
--- grass/trunk/raster/r.proj/bordwalk.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.proj/bordwalk.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -192,14 +192,14 @@
 
     /* adjust to edges */
 
-    idx = (int)floor(G_easting_to_col(xmin, to_hd));
-    xmin = G_col_to_easting(idx + 0.0, to_hd);
-    idx = (int)floor(G_easting_to_col(xmax, to_hd));
-    xmax = G_col_to_easting(idx + 1.0, to_hd);
-    idx = (int)floor(G_northing_to_row(ymin, to_hd));
-    ymin = G_row_to_northing(idx + 1.0, to_hd);
-    idx = (int)floor(G_northing_to_row(ymax, to_hd));
-    ymax = G_row_to_northing(idx + 0.0, to_hd);
+    idx = (int)floor(Rast_easting_to_col(xmin, to_hd));
+    xmin = Rast_col_to_easting(idx + 0.0, to_hd);
+    idx = (int)floor(Rast_easting_to_col(xmax, to_hd));
+    xmax = Rast_col_to_easting(idx + 1.0, to_hd);
+    idx = (int)floor(Rast_northing_to_row(ymin, to_hd));
+    ymin = Rast_row_to_northing(idx + 1.0, to_hd);
+    idx = (int)floor(Rast_northing_to_row(ymax, to_hd));
+    ymax = Rast_row_to_northing(idx + 0.0, to_hd);
 
     to_hd->west = (xmin < to_hd->west) ? to_hd->west : xmin;
     to_hd->east = (xmax > to_hd->east) ? to_hd->east : xmax;

Modified: grass/trunk/raster/r.proj/main.c
===================================================================
--- grass/trunk/raster/r.proj/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.proj/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -395,9 +395,9 @@
     outcellhd.west = outcellhd.south = HUGE_VAL;
     outcellhd.east = outcellhd.north = -HUGE_VAL;
     for (row = 0; row < incellhd.rows; row++) {
-	ycoord1 = G_row_to_northing((double)(row + 0.5), &incellhd);
+	ycoord1 = Rast_row_to_northing((double)(row + 0.5), &incellhd);
 	for (col = 0; col < incellhd.cols; col++) {
-	    xcoord1 = G_col_to_easting((double)(col + 0.5), &incellhd);
+	    xcoord1 = Rast_col_to_easting((double)(col + 0.5), &incellhd);
 	    pj_do_proj(&xcoord1, &ycoord1, &iproj, &oproj);
 	    if (xcoord1 > outcellhd.east)
 		outcellhd.east = xcoord1;

Modified: grass/trunk/raster/r.proj/readcell.c
===================================================================
--- grass/trunk/raster/r.proj/readcell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.proj/readcell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -27,8 +27,8 @@
     int nblocks;
     int i;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     ny = (nrows + BDIM - 1) / BDIM;
     nx = (ncols + BDIM - 1) / BDIM;

Modified: grass/trunk/raster/r.quantile/main.c
===================================================================
--- grass/trunk/raster/r.quantile/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.quantile/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -318,8 +318,8 @@
 
     slot_size = (max - min) / num_slots;
 
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     get_slot_counts(infile);
 

Modified: grass/trunk/raster/r.random/count.c
===================================================================
--- grass/trunk/raster/r.random/count.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.random/count.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -52,8 +52,8 @@
 	theState->cmax.data.v =
 	    (void *)G_malloc(Rast_cell_size(theState->cmax.type));
     }
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     theState->nCells = nrows * ncols;
     theState->nNulls = 0;

Modified: grass/trunk/raster/r.random/random.c
===================================================================
--- grass/trunk/raster/r.random/random.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.random/random.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -34,8 +34,8 @@
 
     G_get_window(&window);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open the data files, input raster should be set-up already */
     if ((infd = theState->fd_old) < 0)

Modified: grass/trunk/raster/r.random.cells/init.c
===================================================================
--- grass/trunk/raster/r.random.cells/init.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.random.cells/init.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -21,8 +21,8 @@
 
     G_debug(2, "Init()");
 
-    Rs = G_window_rows();
-    Cs = G_window_cols();
+    Rs = Rast_window_rows();
+    Cs = Rast_window_cols();
     G_get_set_window(&Region);
     EW = Region.ew_res;
     NS = Region.ns_res;

Modified: grass/trunk/raster/r.random.surface/init.c
===================================================================
--- grass/trunk/raster/r.random.surface/init.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.random.surface/init.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -22,8 +22,8 @@
 
     G_debug(2, "Init");
 
-    Rs = G_window_rows();
-    Cs = G_window_cols();
+    Rs = Rast_window_rows();
+    Cs = Rast_window_cols();
     Surface = (double **)G_malloc(Rs * sizeof(double *));
     for (row = 0; row < Rs; row++)
 	Surface[row] = (double *)G_malloc(Cs * sizeof(double));

Modified: grass/trunk/raster/r.recode/recode.c
===================================================================
--- grass/trunk/raster/r.recode/recode.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.recode/recode.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -30,14 +30,14 @@
     if (align_wind) {
 	G_get_window(&window);
 	Rast_get_cellhd(name, "", &cellhd);
-	G_align_window(&window, &cellhd);
+	Rast_align_window(&window, &cellhd);
 	Rast_set_window(&window);
     }
 
     G_get_set_window(&window);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* open the input file for reading */
     in_fd = Rast_open_old(name, "");

Modified: grass/trunk/raster/r.region/main.c
===================================================================
--- grass/trunk/raster/r.region/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.region/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -210,7 +210,7 @@
 	window.west = box.W;
 	window.east = box.E;
 
-	G_align_window(&window, &cellhd);
+	Rast_align_window(&window, &cellhd);
 
 	Vect_close(&Map);
     }
@@ -308,7 +308,7 @@
 
 	Rast_get_cellhd(name, "", &temp_window);
 
-	G_align_window(&window, &temp_window);
+	Rast_align_window(&window, &temp_window);
     }
 
     window.rows = cellhd.rows;

Modified: grass/trunk/raster/r.resamp.interp/main.c
===================================================================
--- grass/trunk/raster/r.resamp.interp/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.resamp.interp/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -104,14 +104,14 @@
 
     /* enlarge source window */
     {
-	double north = G_row_to_northing(0.5, &dst_w);
-	double south = G_row_to_northing(dst_w.rows - 0.5, &dst_w);
-	int r0 = (int)floor(G_northing_to_row(north, &src_w) - 0.5) - 1;
-	int r1 = (int)floor(G_northing_to_row(south, &src_w) - 0.5) + 3;
-	double west = G_col_to_easting(0.5, &dst_w);
-	double east = G_col_to_easting(dst_w.cols - 0.5, &dst_w);
-	int c0 = (int)floor(G_easting_to_col(west, &src_w) - 0.5) - 1;
-	int c1 = (int)floor(G_easting_to_col(east, &src_w) - 0.5) + 3;
+	double north = Rast_row_to_northing(0.5, &dst_w);
+	double south = Rast_row_to_northing(dst_w.rows - 0.5, &dst_w);
+	int r0 = (int)floor(Rast_northing_to_row(north, &src_w) - 0.5) - 1;
+	int r1 = (int)floor(Rast_northing_to_row(south, &src_w) - 0.5) + 3;
+	double west = Rast_col_to_easting(0.5, &dst_w);
+	double east = Rast_col_to_easting(dst_w.cols - 0.5, &dst_w);
+	int c0 = (int)floor(Rast_easting_to_col(west, &src_w) - 0.5) - 1;
+	int c1 = (int)floor(Rast_easting_to_col(east, &src_w) - 0.5) + 3;
 
 	src_w.south -= src_w.ns_res * (r1 - src_w.rows);
 	src_w.north += src_w.ns_res * (-r0);
@@ -146,8 +146,8 @@
     switch (neighbors) {
     case 1:			/* nearest */
 	for (row = 0; row < dst_w.rows; row++) {
-	    double north = G_row_to_northing(row + 0.5, &dst_w);
-	    double maprow_f = G_northing_to_row(north, &src_w) - 0.5;
+	    double north = Rast_row_to_northing(row + 0.5, &dst_w);
+	    double maprow_f = Rast_northing_to_row(north, &src_w) - 0.5;
 	    int maprow0 = (int)floor(maprow_f + 0.5);
 
 	    G_percent(row, dst_w.rows, 2);
@@ -156,8 +156,8 @@
 	    read_rows(infile, maprow0);
 
 	    for (col = 0; col < dst_w.cols; col++) {
-		double east = G_col_to_easting(col + 0.5, &dst_w);
-		double mapcol_f = G_easting_to_col(east, &src_w) - 0.5;
+		double east = Rast_col_to_easting(col + 0.5, &dst_w);
+		double mapcol_f = Rast_easting_to_col(east, &src_w) - 0.5;
 		int mapcol0 = (int)floor(mapcol_f + 0.5);
 
 		double c = bufs[0][mapcol0];
@@ -177,8 +177,8 @@
 
     case 2:			/* bilinear */
 	for (row = 0; row < dst_w.rows; row++) {
-	    double north = G_row_to_northing(row + 0.5, &dst_w);
-	    double maprow_f = G_northing_to_row(north, &src_w) - 0.5;
+	    double north = Rast_row_to_northing(row + 0.5, &dst_w);
+	    double maprow_f = Rast_northing_to_row(north, &src_w) - 0.5;
 	    int maprow0 = (int)floor(maprow_f);
 	    double v = maprow_f - maprow0;
 
@@ -188,8 +188,8 @@
 	    read_rows(infile, maprow0);
 
 	    for (col = 0; col < dst_w.cols; col++) {
-		double east = G_col_to_easting(col + 0.5, &dst_w);
-		double mapcol_f = G_easting_to_col(east, &src_w) - 0.5;
+		double east = Rast_col_to_easting(col + 0.5, &dst_w);
+		double mapcol_f = Rast_easting_to_col(east, &src_w) - 0.5;
 		int mapcol0 = (int)floor(mapcol_f);
 		int mapcol1 = mapcol0 + 1;
 		double u = mapcol_f - mapcol0;
@@ -216,8 +216,8 @@
 
     case 4:			/* bicubic */
 	for (row = 0; row < dst_w.rows; row++) {
-	    double north = G_row_to_northing(row + 0.5, &dst_w);
-	    double maprow_f = G_northing_to_row(north, &src_w) - 0.5;
+	    double north = Rast_row_to_northing(row + 0.5, &dst_w);
+	    double maprow_f = Rast_northing_to_row(north, &src_w) - 0.5;
 	    int maprow1 = (int)floor(maprow_f);
 	    int maprow0 = maprow1 - 1;
 	    double v = maprow_f - maprow1;
@@ -228,8 +228,8 @@
 	    read_rows(infile, maprow0);
 
 	    for (col = 0; col < dst_w.cols; col++) {
-		double east = G_col_to_easting(col + 0.5, &dst_w);
-		double mapcol_f = G_easting_to_col(east, &src_w) - 0.5;
+		double east = Rast_col_to_easting(col + 0.5, &dst_w);
+		double mapcol_f = Rast_easting_to_col(east, &src_w) - 0.5;
 		int mapcol1 = (int)floor(mapcol_f);
 		int mapcol0 = mapcol1 - 1;
 		int mapcol2 = mapcol1 + 1;

Modified: grass/trunk/raster/r.resamp.stats/main.c
===================================================================
--- grass/trunk/raster/r.resamp.stats/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.resamp.stats/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -98,15 +98,15 @@
     row_map = G_malloc((dst_w.rows + 1) * sizeof(int));
 
     for (col = 0; col <= dst_w.cols; col++) {
-	double x = G_col_to_easting(col, &dst_w);
+	double x = Rast_col_to_easting(col, &dst_w);
 
-	col_map[col] = (int)floor(G_easting_to_col(x, &src_w) + 0.5);
+	col_map[col] = (int)floor(Rast_easting_to_col(x, &src_w) + 0.5);
     }
 
     for (row = 0; row <= dst_w.rows; row++) {
-	double y = G_row_to_northing(row, &dst_w);
+	double y = Rast_row_to_northing(row, &dst_w);
 
-	row_map[row] = (int)floor(G_northing_to_row(y, &src_w) + 0.5);
+	row_map[row] = (int)floor(Rast_northing_to_row(y, &src_w) + 0.5);
     }
 
     for (row = 0; row < dst_w.rows; row++) {
@@ -169,15 +169,15 @@
     row_map = G_malloc((dst_w.rows + 1) * sizeof(double));
 
     for (col = 0; col <= dst_w.cols; col++) {
-	double x = G_col_to_easting(col, &dst_w);
+	double x = Rast_col_to_easting(col, &dst_w);
 
-	col_map[col] = G_easting_to_col(x, &src_w);
+	col_map[col] = Rast_easting_to_col(x, &src_w);
     }
 
     for (row = 0; row <= dst_w.rows; row++) {
-	double y = G_row_to_northing(row, &dst_w);
+	double y = Rast_row_to_northing(row, &dst_w);
 
-	row_map[row] = G_northing_to_row(y, &src_w);
+	row_map[row] = Rast_northing_to_row(y, &src_w);
     }
 
     for (row = 0; row < dst_w.rows; row++) {
@@ -313,10 +313,10 @@
 
     /* enlarge source window */
     {
-	int r0 = (int)floor(G_northing_to_row(dst_w.north, &src_w));
-	int r1 = (int)ceil(G_northing_to_row(dst_w.south, &src_w));
-	int c0 = (int)floor(G_easting_to_col(dst_w.west, &src_w));
-	int c1 = (int)ceil(G_easting_to_col(dst_w.east, &src_w));
+	int r0 = (int)floor(Rast_northing_to_row(dst_w.north, &src_w));
+	int r1 = (int)ceil(Rast_northing_to_row(dst_w.south, &src_w));
+	int c0 = (int)floor(Rast_easting_to_col(dst_w.west, &src_w));
+	int c1 = (int)ceil(Rast_easting_to_col(dst_w.east, &src_w));
 
 	src_w.south -= src_w.ns_res * (r1 - src_w.rows);
 	src_w.north += src_w.ns_res * (-r0);

Modified: grass/trunk/raster/r.resample/main.c
===================================================================
--- grass/trunk/raster/r.resample/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.resample/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -99,8 +99,8 @@
 
     /* raster buffer is big enough to hold data */
     rast = Rast_allocate_buf(data_type);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     if (ncols <= 1)
 	rast = G_realloc(rast, 2 * Rast_cell_size(data_type));
     /* we need the buffer at least 2 cells large */

Modified: grass/trunk/raster/r.rescale/get_range.c
===================================================================
--- grass/trunk/raster/r.rescale/get_range.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.rescale/get_range.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -19,8 +19,8 @@
 	Rast_set_window(&cellhd);
 	cell = Rast_allocate_c_buf();
 	fd = Rast_open_old(name, "");
-	nrows = G_window_rows();
-	ncols = G_window_cols();
+	nrows = Rast_window_rows();
+	ncols = Rast_window_cols();
 	G_message(_("Reading %s ..."), name);
 	for (row = 0; row < nrows; row++) {
 	    G_percent(row, nrows, 2);

Modified: grass/trunk/raster/r.rescale.eq/get_stats.c
===================================================================
--- grass/trunk/raster/r.rescale.eq/get_stats.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.rescale.eq/get_stats.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -11,8 +11,8 @@
     int row, nrows, ncols;
 
     fd = Rast_open_old(name, "");
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     cell = Rast_allocate_c_buf();
 
     Rast_init_cell_stats(statf);

Modified: grass/trunk/raster/r.ros/main.c
===================================================================
--- grass/trunk/raster/r.ros/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.ros/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -399,8 +399,8 @@
     G_get_window(&window);
 
     /*  find number of rows and columns in window    */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     fuel = Rast_allocate_c_buf();
     mois_1h = Rast_allocate_c_buf();

Modified: grass/trunk/raster/r.series/main.c
===================================================================
--- grass/trunk/raster/r.series/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.series/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -224,8 +224,8 @@
     values = G_malloc(num_inputs * sizeof(DCELL));
     values_tmp = G_malloc(num_inputs * sizeof(DCELL));
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* process the data */
     G_verbose_message(_("Percent complete..."));

Modified: grass/trunk/raster/r.slope.aspect/main.c
===================================================================
--- grass/trunk/raster/r.slope.aspect/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.slope.aspect/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -368,7 +368,7 @@
     if (!flag.a->answer) {
 	G_get_window(&window);
 	Rast_get_cellhd(elev_name, "", &cellhd);
-	G_align_window(&window, &cellhd);
+	Rast_align_window(&window, &cellhd);
 	Rast_set_window(&window);
     }
 
@@ -391,8 +391,8 @@
 
     G_get_set_window(&window);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     if (((window.west == (window.east - 360.))
 	 || (window.east == (window.west - 360.))) &&
@@ -414,11 +414,11 @@
 	G_warning(_("Converting units to meters, factor=%.6f"), factor);
 
     G_begin_distance_calculations();
-    north = G_row_to_northing(0.5, &window);
-    ns_med = G_row_to_northing(1.5, &window);
-    south = G_row_to_northing(2.5, &window);
-    east = G_col_to_easting(2.5, &window);
-    west = G_col_to_easting(0.5, &window);
+    north = Rast_row_to_northing(0.5, &window);
+    ns_med = Rast_row_to_northing(1.5, &window);
+    south = Rast_row_to_northing(2.5, &window);
+    east = Rast_col_to_easting(2.5, &window);
+    west = Rast_col_to_easting(0.5, &window);
     V = G_distance(east, north, east, south) * 4 / zfactor;
     H = G_distance(east, ns_med, west, ns_med) * 4 / zfactor;
     /*    ____________________________
@@ -451,7 +451,7 @@
     if (slope_name != NULL) {
 	slope_fd = opennew(slope_name, out_type);
 	slp_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(slp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(slp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(slope_fd, slp_raster, data_type);
     }
     else {
@@ -462,7 +462,7 @@
     if (aspect_name != NULL) {
 	aspect_fd = opennew(aspect_name, out_type);
 	asp_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(asp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(asp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(aspect_fd, asp_raster, data_type);
     }
     else {
@@ -473,7 +473,7 @@
     if (pcurv_name != NULL) {
 	pcurv_fd = opennew(pcurv_name, out_type);
 	pcurv_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(pcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(pcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(pcurv_fd, pcurv_raster, data_type);
     }
     else {
@@ -484,7 +484,7 @@
     if (tcurv_name != NULL) {
 	tcurv_fd = opennew(tcurv_name, out_type);
 	tcurv_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(tcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(tcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(tcurv_fd, tcurv_raster, data_type);
     }
     else {
@@ -495,7 +495,7 @@
     if (dx_name != NULL) {
 	dx_fd = opennew(dx_name, out_type);
 	dx_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dx_fd, dx_raster, data_type);
     }
     else {
@@ -506,7 +506,7 @@
     if (dy_name != NULL) {
 	dy_fd = opennew(dy_name, out_type);
 	dy_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dy_fd, dy_raster, data_type);
     }
     else {
@@ -517,7 +517,7 @@
     if (dxx_name != NULL) {
 	dxx_fd = opennew(dxx_name, out_type);
 	dxx_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dxx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxx_fd, dxx_raster, data_type);
     }
     else {
@@ -528,7 +528,7 @@
     if (dyy_name != NULL) {
 	dyy_fd = opennew(dyy_name, out_type);
 	dyy_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dyy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dyy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dyy_fd, dyy_raster, data_type);
     }
     else {
@@ -539,7 +539,7 @@
     if (dxy_name != NULL) {
 	dxy_fd = opennew(dxy_name, out_type);
 	dxy_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dxy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxy_fd, dxy_raster, data_type);
     }
     else {
@@ -553,16 +553,16 @@
 
     if (Wrap) {
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[1] + 1, 0);
-	elev_cell[1][0] = elev_cell[1][G_window_cols() - 1];
-	elev_cell[1][G_window_cols() + 1] = elev_cell[1][2];
+	elev_cell[1][0] = elev_cell[1][Rast_window_cols() - 1];
+	elev_cell[1][Rast_window_cols() + 1] = elev_cell[1][2];
     }
     else
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[1], 0);
 
     if (Wrap) {
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[2] + 1, 1);
-	elev_cell[2][0] = elev_cell[2][G_window_cols() - 1];
-	elev_cell[2][G_window_cols() + 1] = elev_cell[2][2];
+	elev_cell[2][0] = elev_cell[2][Rast_window_cols() - 1];
+	elev_cell[2][Rast_window_cols() + 1] = elev_cell[2][2];
     }
     else
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[2], 1);
@@ -572,11 +572,11 @@
     for (row = 2; row < nrows; row++) {
 	/*  if projection is Lat/Lon, recalculate  V and H   */
 	if (G_projection() == PROJECTION_LL) {
-	    north = G_row_to_northing((row - 2 + 0.5), &window);
-	    ns_med = G_row_to_northing((row - 1 + 0.5), &window);
-	    south = G_row_to_northing((row + 0.5), &window);
-	    east = G_col_to_easting(2.5, &window);
-	    west = G_col_to_easting(0.5, &window);
+	    north = Rast_row_to_northing((row - 2 + 0.5), &window);
+	    ns_med = Rast_row_to_northing((row - 1 + 0.5), &window);
+	    south = Rast_row_to_northing((row + 0.5), &window);
+	    east = Rast_col_to_easting(2.5, &window);
+	    west = Rast_col_to_easting(0.5, &window);
 	    V = G_distance(east, north, east, south) * 4 / zfactor;
 	    H = G_distance(east, ns_med, west, ns_med) * 4 / zfactor;
 	    /*        ____________________________
@@ -606,8 +606,8 @@
 
 	if (Wrap) {
 	    Rast_get_d_row_nomask(elevation_fd, elev_cell[2] + 1, row);
-	    elev_cell[2][0] = elev_cell[2][G_window_cols() - 1];
-	    elev_cell[2][G_window_cols() + 1] = elev_cell[2][2];
+	    elev_cell[2][0] = elev_cell[2][Rast_window_cols() - 1];
+	    elev_cell[2][Rast_window_cols() + 1] = elev_cell[2][2];
 	}
 	else
 	    Rast_get_d_row_nomask(elevation_fd, elev_cell[2], row);
@@ -998,7 +998,7 @@
 	DCELL min, max;
 	struct FPRange range;
 
-	Rast_set_null_value(asp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(asp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(aspect_fd, asp_raster, data_type);
 	Rast_close(aspect_fd);
 
@@ -1103,7 +1103,7 @@
 	val2 = 90;
 	Rast_add_c_color_rule(&val1, 255, 0, 0, &val2, 0, 0, 0, &colors);
 	
-	Rast_set_null_value(slp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(slp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(slope_fd, slp_raster, data_type);
 	Rast_close(slope_fd);
 
@@ -1233,7 +1233,7 @@
     }
 
     if (pcurv_fd >= 0) {
-	Rast_set_null_value(pcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(pcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(pcurv_fd, pcurv_raster, data_type);
 	Rast_close(pcurv_fd);
 
@@ -1260,7 +1260,7 @@
     }
 
     if (tcurv_fd >= 0) {
-	Rast_set_null_value(tcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(tcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(tcurv_fd, tcurv_raster, data_type);
 	Rast_close(tcurv_fd);
 
@@ -1287,7 +1287,7 @@
     }
 
     if (dx_fd >= 0) {
-	Rast_set_null_value(dx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dx_fd, dx_raster, data_type);
 	Rast_close(dx_fd);
 
@@ -1312,7 +1312,7 @@
     }
 
     if (dy_fd >= 0) {
-	Rast_set_null_value(dy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dy_fd, dy_raster, data_type);
 	Rast_close(dy_fd);
 
@@ -1337,7 +1337,7 @@
     }
 
     if (dxx_fd >= 0) {
-	Rast_set_null_value(dxx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxx_fd, dxx_raster, data_type);
 	Rast_close(dxx_fd);
 
@@ -1362,7 +1362,7 @@
     }
 
     if (dyy_fd >= 0) {
-	Rast_set_null_value(dyy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dyy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dyy_fd, dyy_raster, data_type);
 	Rast_close(dyy_fd);
 
@@ -1387,7 +1387,7 @@
     }
 
     if (dxy_fd >= 0) {
-	Rast_set_null_value(dxy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxy_fd, dxy_raster, data_type);
 	Rast_close(dxy_fd);
 

Modified: grass/trunk/raster/r.spread/main.c
===================================================================
--- grass/trunk/raster/r.spread/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.spread/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -334,8 +334,8 @@
 
     /*  find number of rows and columns in window    */
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /*transfor measurement unit from meters to centimeters due to ROS unit
      *if the input ROSs are in m/min units, cancell the following*/

Modified: grass/trunk/raster/r.spread/ram2out.c
===================================================================
--- grass/trunk/raster/r.spread/ram2out.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.spread/ram2out.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -16,11 +16,11 @@
     extern int nrows, ncols;
     extern struct Cell_head window;
     double north, west;
-    double G_row_to_northing(), G_col_to_easting();
+    double Rast_row_to_northing(), G_col_to_easting();
     int row, col;
 
-    north = G_row_to_northing(0.5, &window);
-    west = G_col_to_easting(0.5, &window);
+    north = Rast_row_to_northing(0.5, &window);
+    west = Rast_col_to_easting(0.5, &window);
     /*  Copy maps in ram to output maps, casting into integers */
     G_message("Writing output: %s, x_output: %s, y_output: %s ... ",
 	      out_layer, x_out_layer, y_out_layer);

Modified: grass/trunk/raster/r.spreadpath/main.c
===================================================================
--- grass/trunk/raster/r.spreadpath/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.spreadpath/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -162,8 +162,8 @@
     path_mapset = G_find_raster(path_layer, search_mapset);
 
     /*  find number of rows and cols in window    */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     cell = Rast_allocate_c_buf();
 

Modified: grass/trunk/raster/r.statistics2/main.c
===================================================================
--- grass/trunk/raster/r.statistics2/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.statistics2/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -185,8 +185,8 @@
     mincat = range.min;
     ncats = range.max - range.min + 1;
 
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     switch (method) {
     case COUNT:

Modified: grass/trunk/raster/r.statistics3/main.c
===================================================================
--- grass/trunk/raster/r.statistics3/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.statistics3/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -495,8 +495,8 @@
     for (i = 0; i < num_cats; i++)
 	basecats[i].slots = G_calloc(num_slots, sizeof(unsigned int));
 
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     get_slot_counts(base_fd, cover_fd);
 

Modified: grass/trunk/raster/r.stats/main.c
===================================================================
--- grass/trunk/raster/r.stats/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.stats/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -220,8 +220,8 @@
     averaged = flag.A->answer;
     raw_output = flag.r->answer;
     as_int = flag.i->answer;
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     fd = NULL;
     nfiles = 0;

Modified: grass/trunk/raster/r.stats/raw_stats.c
===================================================================
--- grass/trunk/raster/r.stats/raw_stats.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.stats/raw_stats.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -10,7 +10,7 @@
     char str1[50];
     register int i;
     int row, col, nulls_found;
-    double G_row_to_northing(), G_col_to_easting();
+    double Rast_row_to_northing(), G_col_to_easting();
     struct Cell_head window;
     char nbuf[100], ebuf[100];
     RASTER_MAP_TYPE *map_type;
@@ -44,7 +44,7 @@
 	}
 
 	if (with_coordinates)
-	    G_format_northing(G_row_to_northing(row + .5, &window), nbuf, 
+	    G_format_northing(Rast_row_to_northing(row + .5, &window), nbuf, 
 			      G_projection() == PROJECTION_LL ? -1 : 0);
 
 	for (col = 0; col < ncols; col++) {
@@ -69,7 +69,7 @@
 		}
 	    }
 	    if (with_coordinates) {
-		G_format_easting(G_col_to_easting(col + .5, &window), ebuf,
+		G_format_easting(Rast_col_to_easting(col + .5, &window), ebuf,
 				 G_projection() == PROJECTION_LL ? -1 : 0);
 		fprintf(stdout, "%s%s%s%s", ebuf, fs, nbuf, fs);
 	    }

Modified: grass/trunk/raster/r.sun/main.c
===================================================================
--- grass/trunk/raster/r.sun/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.sun/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -1159,10 +1159,10 @@
 
     Rast_set_window(&cellhd);
 
-    if (m != G_window_rows())
-	G_fatal_error("OOPS: rows changed from %d to %d", m, G_window_rows());
-    if (n != G_window_cols())
-	G_fatal_error("OOPS: cols changed from %d to %d", n, G_window_cols());
+    if (m != Rast_window_rows())
+	G_fatal_error("OOPS: rows changed from %d to %d", m, Rast_window_rows());
+    if (n != Rast_window_cols())
+	G_fatal_error("OOPS: cols changed from %d to %d", n, Rast_window_cols());
 
     for (iarc = 0; iarc < m; iarc++) {
 	i = m - iarc - 1;

Modified: grass/trunk/raster/r.sunmask/main.c
===================================================================
--- grass/trunk/raster/r.sunmask/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.sunmask/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -490,8 +490,8 @@
 	    /*              outbuf.c[col1]=1; */
 	    Rast_set_null_value(&outbuf.c[col1], 1, CELL_TYPE);
 	    OK = 1;
-	    east = G_col_to_easting(col1 + 0.5, &window);
-	    north = G_row_to_northing(row1 + 0.5, &window);
+	    east = Rast_col_to_easting(col1 + 0.5, &window);
+	    north = Rast_row_to_northing(row1 + 0.5, &window);
 	    east1 = east;
 	    north1 = north;
 	    if (dvalue == 0.0 && !zeros)
@@ -510,9 +510,9 @@
 		    if ((maxh) > (dmax - dvalue))
 			OK = 0;
 		    else {
-			dcol = G_easting_to_col(east, &window);
-			if (drow != G_northing_to_row(north, &window)) {
-			    drow = G_northing_to_row(north, &window);
+			dcol = Rast_easting_to_col(east, &window);
+			if (drow != Rast_northing_to_row(north, &window)) {
+			    drow = Rast_northing_to_row(north, &window);
 			    Rast_get_row(elev_fd, tmpbuf.v, (int)drow,
 					 data_type);
 			}

Modified: grass/trunk/raster/r.support/histo.c
===================================================================
--- grass/trunk/raster/r.support/histo.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.support/histo.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -23,8 +23,8 @@
     Rast_set_window(&cellhd);
     fd = Rast_open_old(name, "");
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     cell = Rast_allocate_c_buf();
 
     Rast_init_cell_stats(&statf);

Modified: grass/trunk/raster/r.support.stats/histo.c
===================================================================
--- grass/trunk/raster/r.support.stats/histo.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.support.stats/histo.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -39,8 +39,8 @@
     Rast_set_window(&cellhd);
     fd = Rast_open_old(name, "");
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     cell = Rast_allocate_c_buf();
 
     Rast_init_cell_stats(&statf);

Modified: grass/trunk/raster/r.surf.contour/main.c
===================================================================
--- grass/trunk/raster/r.surf.contour/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.contour/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -87,8 +87,8 @@
     if (!con_mapset)
 	G_fatal_error("Contour raster map [%s] not found", con_name);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     i_val_l_f = nrows + ncols;
     con = read_cell(con_name, con_mapset);
     alt_row = (CELL *) G_malloc(ncols * sizeof(CELL));

Modified: grass/trunk/raster/r.surf.contour/read_cell.c
===================================================================
--- grass/trunk/raster/r.surf.contour/read_cell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.contour/read_cell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -4,8 +4,8 @@
 
 CELL **read_cell(const char *name, const char *mapset)
 {
-    int nrows = G_window_rows();
-    int ncols = G_window_cols();
+    int nrows = Rast_window_rows();
+    int ncols = Rast_window_cols();
     CELL *buf, **idx;
     int fd;
     int row;

Modified: grass/trunk/raster/r.surf.fractal/process.c
===================================================================
--- grass/trunk/raster/r.surf.fractal/process.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.fractal/process.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -38,8 +38,8 @@
 
     /*------------------------------------------------------------------*/
 
-    nrows = G_window_rows();	/* Find out the number of rows and */
-    ncols = G_window_cols();	/* columns of the raster view.     */
+    nrows = Rast_window_rows();	/* Find out the number of rows and */
+    ncols = Rast_window_cols();	/* columns of the raster view.     */
 
     nn = G_math_max_pow2(MAX(nrows, ncols));	/* Find smallest power of 2 that   */
     /* largest side of raster will fit. */

Modified: grass/trunk/raster/r.surf.fractal/write_rast.c
===================================================================
--- grass/trunk/raster/r.surf.fractal/write_rast.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.fractal/write_rast.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -40,8 +40,8 @@
 
     /* of the input raster.                 */
 
-    nrows = G_window_rows();	/* Find out the number of rows and      */
-    ncols = G_window_cols();	/* columns of the raster view.          */
+    nrows = Rast_window_rows();	/* Find out the number of rows and      */
+    ncols = Rast_window_cols();	/* columns of the raster view.          */
 
     row_out = Rast_allocate_d_buf();
 

Modified: grass/trunk/raster/r.surf.gauss/gaussurf.c
===================================================================
--- grass/trunk/raster/r.surf.gauss/gaussurf.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.gauss/gaussurf.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -38,8 +38,8 @@
 
     fd_out = Rast_open_new(out, DCELL_TYPE);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     row_out = Rast_allocate_d_buf();
 

Modified: grass/trunk/raster/r.surf.idw/main.c
===================================================================
--- grass/trunk/raster/r.surf.idw/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.idw/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -136,8 +136,8 @@
     G_get_window(&window);
 
     /*  find number of rows and columns in window                   */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* create distance squared or latitude lookup tables */
     /* initialize function pointers */

Modified: grass/trunk/raster/r.surf.idw2/read_cell.c
===================================================================
--- grass/trunk/raster/r.surf.idw2/read_cell.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.idw2/read_cell.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -17,7 +17,7 @@
 
     /* Set window to align with input raster map */
     Rast_get_cellhd(name, "", &cellhd);
-    G_align_window(&window, &cellhd);
+    Rast_align_window(&window, &cellhd);
     Rast_set_window(&window);
 
     cell = Rast_allocate_c_buf();

Modified: grass/trunk/raster/r.surf.random/randsurf.c
===================================================================
--- grass/trunk/raster/r.surf.random/randsurf.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.surf.random/randsurf.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -26,8 +26,8 @@
 	/****** OPEN CELL FILES AND GET CELL DETAILS ******/
     fd_out = Rast_open_new(out, int_map ? CELL_TYPE : DCELL_TYPE);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     if (int_map)
 	row_out_C = Rast_allocate_c_buf();

Modified: grass/trunk/raster/r.terraflow/main.cc
===================================================================
--- grass/trunk/raster/r.terraflow/main.cc	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.terraflow/main.cc	2010-02-01 17:53:15 UTC (rev 40771)
@@ -467,8 +467,8 @@
 
   check_args();
 
-  int nr = G_window_rows();
-  int nc = G_window_cols();
+  int nr = Rast_window_rows();
+  int nc = Rast_window_cols();
   if ((nr > dimension_type_max) || (nc > dimension_type_max)) {
     G_fatal_error(_("[nrows=%d, ncols=%d] dimension_type overflow -- "
 	"change dimension_type and recompile"), nr, nc);

Modified: grass/trunk/raster/r.texture/main.c
===================================================================
--- grass/trunk/raster/r.texture/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.texture/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -222,8 +222,8 @@
     /* Allocate output buffer, use FCELL data_type */
     outrast = Rast_allocate_buf(out_data_type);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* Load raster map. */
 

Modified: grass/trunk/raster/r.thin/io.c
===================================================================
--- grass/trunk/raster/r.thin/io.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.thin/io.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -93,8 +93,8 @@
     strcpy(cell, name);
     cell_file = Rast_open_old(cell, "");
 
-    n_rows = G_window_rows();
-    n_cols = G_window_cols();
+    n_rows = Rast_window_rows();
+    n_cols = Rast_window_cols();
     G_message(_("File %s -- %d rows X %d columns"), name, n_rows, n_cols);
     n_cols += (PAD << 1);
 
@@ -157,8 +157,8 @@
     row_count = n_rows - (PAD << 1);
     col_count = n_cols - (PAD << 1);
     G_message(_("Output file %d rows X %d columns"), row_count, col_count);
-    G_message(_("Window %d rows X %d columns"), G_window_rows(),
-	      G_window_cols());
+    G_message(_("Window %d rows X %d columns"), Rast_window_rows(),
+	      Rast_window_cols());
 
     for (row = 0, k = PAD; row < row_count; row++, k++) {
 	buf = get_a_row(k);

Modified: grass/trunk/raster/r.to.rast3/main.c
===================================================================
--- grass/trunk/raster/r.to.rast3/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.to.rast3/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -213,8 +213,8 @@
     G3d_getWindow(&region);
 
     /*Check if the g3d-region is equal to the 2d rows and cols */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     G_debug(2, "Check the 2d and 3d region settings");
 

Modified: grass/trunk/raster/r.to.rast3elev/main.c
===================================================================
--- grass/trunk/raster/r.to.rast3elev/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.to.rast3elev/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -402,8 +402,8 @@
     G3d_getWindow(&region);
 
     /*Check if the g3d-region is equal to the 2d rows and cols */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     G_debug(2, "Checking 2d and 3d region");
 

Modified: grass/trunk/raster/r.to.vect/points.c
===================================================================
--- grass/trunk/raster/r.to.vect/points.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.to.vect/points.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -39,7 +39,7 @@
     for (row = 0; row < cell_head.rows; row++) {
 	G_percent(row, n_rows, 2);
 
-	y = G_row_to_northing((double)(row + .5), &cell_head);
+	y = Rast_row_to_northing((double)(row + .5), &cell_head);
 
 	switch (data_type) {
 	case CELL_TYPE:
@@ -57,7 +57,7 @@
 	    int cat, val;
 	    double dval;
 
-	    x = G_col_to_easting((double)(col + .5), &cell_head);
+	    x = Rast_col_to_easting((double)(col + .5), &cell_head);
 
 	    switch (data_type) {
 	    case CELL_TYPE:

Modified: grass/trunk/raster/r.univar/r.univar_main.c
===================================================================
--- grass/trunk/raster/r.univar/r.univar_main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.univar/r.univar_main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -162,7 +162,7 @@
 static void
 process_raster(univar_stat * stats, int fd, const struct Cell_head *region)
 {
-    /* use G_window_rows(), G_window_cols() here? */
+    /* use Rast_window_rows(), Rast_window_cols() here? */
     const int rows = region->rows;
     const int cols = region->cols;
     int first = (stats->n < 1);

Modified: grass/trunk/raster/r.uslek/main.c
===================================================================
--- grass/trunk/raster/r.uslek/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.uslek/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -100,8 +100,8 @@
     infd_pomat = Rast_open_old(pomat, "");
     inrast_pomat = Rast_allocate_d_buf();
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

Modified: grass/trunk/raster/r.usler/main.c
===================================================================
--- grass/trunk/raster/r.usler/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.usler/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -86,8 +86,8 @@
     inrast_annual_pmm = Rast_allocate_d_buf();
     
     /***************************************************/ 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     outrast = Rast_allocate_d_buf();
     
     /* Create New raster files */ 

Modified: grass/trunk/raster/r.volume/centroids.c
===================================================================
--- grass/trunk/raster/r.volume/centroids.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.volume/centroids.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -46,8 +46,8 @@
 
     /* do rows and columns through window and mask */
     /*  to do counting */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
     for (row = 0; row < rows; row++) {
 	Rast_get_c_row(fd, cell_buf, row);	/* get a row */
 	for (col = 0; col < cols; col++) {

Modified: grass/trunk/raster/r.walk/main.c
===================================================================
--- grass/trunk/raster/r.walk/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.walk/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -437,8 +437,8 @@
     move_dir_layer = opt11->answer;
 
     /* Find number of rows and columns in window */
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     /* Open cost cell layer for reading */
     dtm_mapset = G_find_raster2(dtm_layer, "");
@@ -730,8 +730,8 @@
 		continue;
 	    got_one = 1;
 
-	    col = (int)G_easting_to_col(site->east, &window);
-	    row = (int)G_northing_to_row(site->north, &window);
+	    col = (int)Rast_easting_to_col(site->east, &window);
+	    row = (int)Rast_northing_to_row(site->north, &window);
 
 	    new_start_pt =
 		(struct start_pt *)(G_malloc(sizeof(struct start_pt)));
@@ -777,8 +777,8 @@
 		continue;
 	    have_stop_points = 1;
 
-	    col = (int)G_easting_to_col(site->east, &window);
-	    row = (int)G_northing_to_row(site->north, &window);
+	    col = (int)Rast_easting_to_col(site->east, &window);
+	    row = (int)Rast_northing_to_row(site->north, &window);
 
 	    new_start_pt =
 		(struct start_pt *)(G_malloc(sizeof(struct start_pt)));

Modified: grass/trunk/raster/r.water.outlet/main.c
===================================================================
--- grass/trunk/raster/r.water.outlet/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.water.outlet/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -122,8 +122,8 @@
     G_get_set_window(&window);
     dr_f = ba_f = N_f = E_f = errr = 0;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     total = nrows * ncols;
     nrows_less_one = nrows - 1;
     ncols_less_one = ncols - 1;

Modified: grass/trunk/raster/r.watershed/ram/init_vars.c
===================================================================
--- grass/trunk/raster/r.watershed/ram/init_vars.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/ram/init_vars.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -116,8 +116,8 @@
        }
      */
     G_get_set_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     total_cells = nrows * ncols;
     if (max_length <= d_zero)
 	max_length = 10 * nrows * window.ns_res + 10 * ncols * window.ew_res;

Modified: grass/trunk/raster/r.watershed/seg/bseg_open.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/bseg_open.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/bseg_open.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -21,8 +21,8 @@
 	G_warning("bseg_open(): unable to create segment file");
 	return -2;
     }
-    if (0 > (errflag = segment_format(fd, G_window_rows(),
-				      G_window_cols(), srows, scols,
+    if (0 > (errflag = segment_format(fd, Rast_window_rows(),
+				      Rast_window_cols(), srows, scols,
 				      sizeof(char)))) {
 	close(fd);
 	unlink(filename);

Modified: grass/trunk/raster/r.watershed/seg/bseg_read.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/bseg_read.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/bseg_read.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -15,8 +15,8 @@
     bseg->mapset = NULL;
 
     map_fd = Rast_open_old(map_name, mapset);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     buffer = Rast_allocate_c_buf();
     for (row = 0; row < nrows; row++) {
 	Rast_get_c_row(map_fd, buffer, row);

Modified: grass/trunk/raster/r.watershed/seg/bseg_write.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/bseg_write.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/bseg_write.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -11,8 +11,8 @@
     char value;
 
     map_fd = Rast_open_c_new(map_name);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     buffer = Rast_allocate_c_buf();
     for (row = 0; row < nrows; row++) {
 	G_percent(row, nrows, 1);

Modified: grass/trunk/raster/r.watershed/seg/cseg_open.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/cseg_open.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/cseg_open.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -22,7 +22,7 @@
     }
     if (0 >
 	(errflag =
-	 segment_format(fd, G_window_rows(), G_window_cols(), srows, scols,
+	 segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
 			sizeof(CELL)))) {
 	close(fd);
 	unlink(filename);

Modified: grass/trunk/raster/r.watershed/seg/cseg_read.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/cseg_read.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/cseg_read.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -15,7 +15,7 @@
     cseg->mapset = NULL;
 
     map_fd = Rast_open_old(map_name, mapset);
-    nrows = G_window_rows();
+    nrows = Rast_window_rows();
     buffer = Rast_allocate_c_buf();
     for (row = 0; row < nrows; row++) {
 	Rast_get_c_row(map_fd, buffer, row);

Modified: grass/trunk/raster/r.watershed/seg/cseg_write.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/cseg_write.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/cseg_write.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -10,7 +10,7 @@
     CELL *buffer;
 
     map_fd = Rast_open_c_new(map_name);
-    nrows = G_window_rows();
+    nrows = Rast_window_rows();
     buffer = Rast_allocate_c_buf();
     segment_flush(&(cseg->seg));
     for (row = 0; row < nrows; row++) {

Modified: grass/trunk/raster/r.watershed/seg/dseg_open.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/dseg_open.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/dseg_open.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -23,7 +23,7 @@
     }
     if (0 >
 	(errflag =
-	 segment_format(fd, G_window_rows(), G_window_cols(), srows, scols,
+	 segment_format(fd, Rast_window_rows(), Rast_window_cols(), srows, scols,
 			sizeof(double)))) {
 	close(fd);
 	unlink(filename);

Modified: grass/trunk/raster/r.watershed/seg/dseg_read.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/dseg_read.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/dseg_read.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -15,8 +15,8 @@
     dseg->mapset = NULL;
 
     map_fd = Rast_open_old(map_name, mapset);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     dbuffer = Rast_allocate_d_buf();
     for (row = 0; row < nrows; row++) {
 	Rast_get_d_row(map_fd, dbuffer, row);

Modified: grass/trunk/raster/r.watershed/seg/dseg_write.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/dseg_write.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/dseg_write.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -10,8 +10,8 @@
     double *dbuffer;
 
     map_fd = Rast_open_new(map_name, DCELL_TYPE);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     dbuffer = Rast_allocate_d_buf();
     segment_flush(&(dseg->seg));
     for (row = 0; row < nrows; row++) {

Modified: grass/trunk/raster/r.watershed/seg/init_vars.c
===================================================================
--- grass/trunk/raster/r.watershed/seg/init_vars.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/seg/init_vars.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -132,8 +132,8 @@
        }
      */
     G_get_set_window(&window);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     if (max_length <= d_zero)
 	max_length = 10 * nrows * window.ns_res + 10 * ncols * window.ew_res;
     if (window.ew_res < window.ns_res)

Modified: grass/trunk/raster/r.watershed/shed/read.c
===================================================================
--- grass/trunk/raster/r.watershed/shed/read.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/shed/read.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -14,8 +14,8 @@
     char *mapset;
     B_FACTS *facts;
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
     buf = Rast_allocate_c_buf();
     bas_buf = Rast_allocate_c_buf();
     mapset = G_find_raster(haf_name, "");

Modified: grass/trunk/raster/r.watershed/shed/valid.c
===================================================================
--- grass/trunk/raster/r.watershed/shed/valid.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.watershed/shed/valid.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -16,8 +16,8 @@
 
     window = &(output->window);
     /*
-       nrows = G_window_rows ();
-       ncols = G_window_cols ();
+       nrows = Rast_window_rows ();
+       ncols = Rast_window_cols ();
      */
     if (NULL == (mapset = G_find_raster(accum_name, ""))) {
 	free_output(output);

Modified: grass/trunk/raster/r.what/main.c
===================================================================
--- grass/trunk/raster/r.what/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/r.what/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -304,8 +304,8 @@
 			}
 
 			/* convert north, east to row and col */
-			drow = G_northing_to_row(north, &window);
-			dcol = G_easting_to_col(east, &window);
+			drow = Rast_northing_to_row(north, &window);
+			dcol = Rast_easting_to_col(east, &window);
 
 			/* a special case.
 			 *   if north falls at southern edge, or east falls on eastern edge,

Modified: grass/trunk/raster/simwe/simlib/output.c
===================================================================
--- grass/trunk/raster/simwe/simlib/output.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster/simwe/simlib/output.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -156,12 +156,12 @@
 
     Rast_set_window(&cellhd);
 
-    if (my != G_window_rows())
+    if (my != Rast_window_rows())
 	G_fatal_error("OOPS: rows changed from %d to %d\n", mx,
-		      G_window_rows());
-    if (mx != G_window_cols())
+		      Rast_window_rows());
+    if (mx != Rast_window_cols())
 	G_fatal_error("OOPS: cols changed from %d to %d\n", my,
-		      G_window_cols());
+		      Rast_window_cols());
 
     for (iarc = 0; iarc < my; iarc++) {
 	i = my - iarc - 1;
@@ -615,12 +615,12 @@
 
     Rast_set_window(&cellhd);
 
-    if (my != G_window_rows())
+    if (my != Rast_window_rows())
 	G_fatal_error("OOPS: rows changed from %d to %d\n", mx,
-		      G_window_rows());
-    if (mx != G_window_cols())
+		      Rast_window_rows());
+    if (mx != Rast_window_cols())
 	G_fatal_error("OOPS: cols changed from %d to %d\n", my,
-		      G_window_cols());
+		      Rast_window_cols());
 
     for (iarc = 0; iarc < my; iarc++) {
 	i = my - iarc - 1;

Modified: grass/trunk/raster3d/r3.cross.rast/main.c
===================================================================
--- grass/trunk/raster3d/r3.cross.rast/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster3d/r3.cross.rast/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -279,8 +279,8 @@
     G3d_getWindow(&region);
 
     /*Check if the g3d-region is equal to the 2d rows and cols */
-    rows = G_window_rows();
-    cols = G_window_cols();
+    rows = Rast_window_rows();
+    cols = Rast_window_cols();
 
     /*If not equal, set the 2D windows correct */
     if (rows != region.rows || cols != region.cols) {

Modified: grass/trunk/raster3d/r3.out.vtk/main.c
===================================================================
--- grass/trunk/raster3d/r3.out.vtk/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster3d/r3.out.vtk/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -440,8 +440,8 @@
     if (param.structgrid->answer) {
 
 	/*Check if the g3d-region is equal to the 2d rows and cols */
-	rows = G_window_rows();
-	cols = G_window_cols();
+	rows = Rast_window_rows();
+	cols = Rast_window_cols();
 
 	/*If not equal, set the 2D windows correct */
 	if (rows != region.rows || cols != region.cols) {

Modified: grass/trunk/raster3d/r3.to.rast/main.c
===================================================================
--- grass/trunk/raster3d/r3.to.rast/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/raster3d/r3.to.rast/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -246,8 +246,8 @@
 	G3d_getWindow(&region);
 
 	/*Check if the g3d-region is equal to the 2d rows and cols */
-	rows = G_window_rows();
-	cols = G_window_cols();
+	rows = Rast_window_rows();
+	cols = Rast_window_cols();
 
 	/*If not equal, set the 3D window correct */
 	if (rows != region.rows || cols != region.cols) {

Modified: grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c
===================================================================
--- grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/swig/perl/R_slope_aspect/r_slope_aspect/r_slope_aspect.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -419,8 +419,8 @@
 
     G_get_set_window(&window);
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     if (((window.west == (window.east - 360.))
 	 || (window.east == (window.west - 360.))) &&
@@ -442,11 +442,11 @@
 	G_warning("Converting units to meters, factor=%.6f", factor);
 
     G_begin_distance_calculations();
-    north = G_row_to_northing(0.5, &window);
-    ns_med = G_row_to_northing(1.5, &window);
-    south = G_row_to_northing(2.5, &window);
-    east = G_col_to_easting(2.5, &window);
-    west = G_col_to_easting(0.5, &window);
+    north = Rast_row_to_northing(0.5, &window);
+    ns_med = Rast_row_to_northing(1.5, &window);
+    south = Rast_row_to_northing(2.5, &window);
+    east = Rast_col_to_easting(2.5, &window);
+    west = Rast_col_to_easting(0.5, &window);
     V = G_distance(east, north, east, south) * 4 / zfactor;
     H = G_distance(east, ns_med, west, ns_med) * 4 / zfactor;
     /*    ____________________________
@@ -481,7 +481,7 @@
     if (slope_name != NULL) {
 	slope_fd = opennew(slope_name, out_type);
 	slp_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(slp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(slp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(slope_fd, slp_raster, data_type);
     }
     else {
@@ -492,7 +492,7 @@
     if (aspect_name != NULL) {
 	aspect_fd = opennew(aspect_name, out_type);
 	asp_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(asp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(asp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(aspect_fd, asp_raster, data_type);
     }
     else {
@@ -503,7 +503,7 @@
     if (pcurv_name != NULL) {
 	pcurv_fd = opennew(pcurv_name, out_type);
 	pcurv_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(pcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(pcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(pcurv_fd, pcurv_raster, data_type);
     }
     else {
@@ -514,7 +514,7 @@
     if (tcurv_name != NULL) {
 	tcurv_fd = opennew(tcurv_name, out_type);
 	tcurv_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(tcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(tcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(tcurv_fd, tcurv_raster, data_type);
     }
     else {
@@ -525,7 +525,7 @@
     if (dx_name != NULL) {
 	dx_fd = opennew(dx_name, out_type);
 	dx_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dx_fd, dx_raster, data_type);
     }
     else {
@@ -536,7 +536,7 @@
     if (dy_name != NULL) {
 	dy_fd = opennew(dy_name, out_type);
 	dy_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dy_fd, dy_raster, data_type);
     }
     else {
@@ -547,7 +547,7 @@
     if (dxx_name != NULL) {
 	dxx_fd = opennew(dxx_name, out_type);
 	dxx_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dxx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxx_fd, dxx_raster, data_type);
     }
     else {
@@ -558,7 +558,7 @@
     if (dyy_name != NULL) {
 	dyy_fd = opennew(dyy_name, out_type);
 	dyy_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dyy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dyy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dyy_fd, dyy_raster, data_type);
     }
     else {
@@ -569,7 +569,7 @@
     if (dxy_name != NULL) {
 	dxy_fd = opennew(dxy_name, out_type);
 	dxy_raster = Rast_allocate_buf(data_type);
-	Rast_set_null_value(dxy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxy_fd, dxy_raster, data_type);
     }
     else {
@@ -583,16 +583,16 @@
 
     if (Wrap) {
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[1] + 1, 0);
-	elev_cell[1][0] = elev_cell[1][G_window_cols() - 1];
-	elev_cell[1][G_window_cols() + 1] = elev_cell[1][2];
+	elev_cell[1][0] = elev_cell[1][Rast_window_cols() - 1];
+	elev_cell[1][Rast_window_cols() + 1] = elev_cell[1][2];
     }
     else
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[1], 0);
 
     if (Wrap) {
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[2] + 1, 1);
-	elev_cell[2][0] = elev_cell[2][G_window_cols() - 1];
-	elev_cell[2][G_window_cols() + 1] = elev_cell[2][2];
+	elev_cell[2][0] = elev_cell[2][Rast_window_cols() - 1];
+	elev_cell[2][Rast_window_cols() + 1] = elev_cell[2][2];
     }
     else
 	Rast_get_d_row_nomask(elevation_fd, elev_cell[2], 1);
@@ -601,11 +601,11 @@
     for (row = 2; row < nrows; row++) {
 	/*  if projection is Lat/Lon, recalculate  V and H   */
 	if (G_projection() == PROJECTION_LL) {
-	    north = G_row_to_northing((row - 2 + 0.5), &window);
-	    ns_med = G_row_to_northing((row - 1 + 0.5), &window);
-	    south = G_row_to_northing((row + 0.5), &window);
-	    east = G_col_to_easting(2.5, &window);
-	    west = G_col_to_easting(0.5, &window);
+	    north = Rast_row_to_northing((row - 2 + 0.5), &window);
+	    ns_med = Rast_row_to_northing((row - 1 + 0.5), &window);
+	    south = Rast_row_to_northing((row + 0.5), &window);
+	    east = Rast_col_to_easting(2.5, &window);
+	    west = Rast_col_to_easting(0.5, &window);
 	    V = G_distance(east, north, east, south) * 4 / zfactor;
 	    H = G_distance(east, ns_med, west, ns_med) * 4 / zfactor;
 	    /*        ____________________________
@@ -635,8 +635,8 @@
 
 	if (Wrap) {
 	    Rast_get_d_row_nomask(elevation_fd, elev_cell[2] + 1, row);
-	    elev_cell[2][0] = elev_cell[2][G_window_cols() - 1];
-	    elev_cell[2][G_window_cols() + 1] = elev_cell[2][2];
+	    elev_cell[2][0] = elev_cell[2][Rast_window_cols() - 1];
+	    elev_cell[2][Rast_window_cols() + 1] = elev_cell[2][2];
 	}
 	else
 	    Rast_get_d_row_nomask(elevation_fd, elev_cell[2], row);
@@ -1027,7 +1027,7 @@
 	DCELL min, max;
 	struct FPRange range;
 
-	Rast_set_null_value(asp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(asp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(aspect_fd, asp_raster, data_type);
 	Rast_close(aspect_fd);
 
@@ -1130,7 +1130,7 @@
 	val2 = 90;
 	Rast_add_c_color_rule(&val1, 255, 0, 0, &val2, 0, 0, 0, &colors);
 
-	Rast_set_null_value(slp_raster, G_window_cols(), data_type);
+	Rast_set_null_value(slp_raster, Rast_window_cols(), data_type);
 	Rast_put_row(slope_fd, slp_raster, data_type);
 	Rast_close(slope_fd);
 
@@ -1258,7 +1258,7 @@
     }
 
     if (pcurv_fd >= 0) {
-	Rast_set_null_value(pcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(pcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(pcurv_fd, pcurv_raster, data_type);
 	Rast_close(pcurv_fd);
 
@@ -1284,7 +1284,7 @@
     }
 
     if (tcurv_fd >= 0) {
-	Rast_set_null_value(tcurv_raster, G_window_cols(), data_type);
+	Rast_set_null_value(tcurv_raster, Rast_window_cols(), data_type);
 	Rast_put_row(tcurv_fd, tcurv_raster, data_type);
 	Rast_close(tcurv_fd);
 
@@ -1310,7 +1310,7 @@
     }
 
     if (dx_fd >= 0) {
-	Rast_set_null_value(dx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dx_fd, dx_raster, data_type);
 	Rast_close(dx_fd);
 
@@ -1334,7 +1334,7 @@
     }
 
     if (dy_fd >= 0) {
-	Rast_set_null_value(dy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dy_fd, dy_raster, data_type);
 	Rast_close(dy_fd);
 
@@ -1358,7 +1358,7 @@
     }
 
     if (dxx_fd >= 0) {
-	Rast_set_null_value(dxx_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxx_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxx_fd, dxx_raster, data_type);
 	Rast_close(dxx_fd);
 
@@ -1382,7 +1382,7 @@
     }
 
     if (dyy_fd >= 0) {
-	Rast_set_null_value(dyy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dyy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dyy_fd, dyy_raster, data_type);
 	Rast_close(dyy_fd);
 
@@ -1406,7 +1406,7 @@
     }
 
     if (dxy_fd >= 0) {
-	Rast_set_null_value(dxy_raster, G_window_cols(), data_type);
+	Rast_set_null_value(dxy_raster, Rast_window_cols(), data_type);
 	Rast_put_row(dxy_fd, dxy_raster, data_type);
 	Rast_close(dxy_fd);
 

Modified: grass/trunk/vector/lidar/lidarlib/raster.c
===================================================================
--- grass/trunk/vector/lidar/lidarlib/raster.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/lidar/lidarlib/raster.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -214,8 +214,8 @@
     G_get_window(&Original);
     for (row = 0; row < nrows; row++) {
 	for (col = 0; col < ncols; col++) {
-	    X = G_col_to_easting((double)(col) + 0.5, &Original);
-	    Y = G_row_to_northing((double)(row) + 0.5, &Original);
+	    X = Rast_col_to_easting((double)(col) + 0.5, &Original);
+	    Y = Rast_row_to_northing((double)(row) + 0.5, &Original);
 
 	    if (Vect_point_in_box(X, Y, mean, &General)) {	/* Here, mean is just for asking if obs point is in box */
 

Modified: grass/trunk/vector/lidar/lidarlib/zones.c
===================================================================
--- grass/trunk/vector/lidar/lidarlib/zones.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/lidar/lidarlib/zones.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -271,8 +271,8 @@
 
     G_get_window(&Original);
     Rast_set_window(&Original);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     raster = Rast_allocate_buf(DCELL_TYPE);
 
@@ -374,8 +374,8 @@
 
     G_get_window(&Original);
     Rast_set_window(&Original);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     for (row = 0; row < nrows; row++) {
 	for (col = 0; col < ncols; col++) {

Modified: grass/trunk/vector/lidar/v.lidar.correction/main.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.correction/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/lidar/v.lidar.correction/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -190,8 +190,8 @@
      *  subregion will be overlaped by its neibourgh subregions. This overlapping
      *  is calculated as OVERLAP_PASS times the east-west resolution. */
 
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     ew_resol = original_reg.ew_res;
     ns_resol = original_reg.ns_res;

Modified: grass/trunk/vector/lidar/v.lidar.growing/main.c
===================================================================
--- grass/trunk/vector/lidar/v.lidar.growing/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/lidar/v.lidar.growing/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -236,8 +236,8 @@
 
 	    /*Setting the active region */
 	    Rast_set_window(&elaboration_reg);
-	    nrows = G_window_rows();
-	    ncols = G_window_cols();
+	    nrows = Rast_window_rows();
+	    ncols = Rast_window_cols();
 
 	    G_debug(1, _("Rows = %d"), nrows);
 	    G_debug(1, _("Columns = %d"), ncols);
@@ -276,10 +276,10 @@
 		     (points->y[0] == original_reg.north))) {
 
 		    row =
-			(int)(G_northing_to_row
+			(int)(Rast_northing_to_row
 			      (points->y[0], &elaboration_reg));
 		    col =
-			(int)(G_easting_to_col
+			(int)(Rast_easting_to_col
 			      (points->x[0], &elaboration_reg));
 
 		    while (1) {
@@ -365,10 +365,10 @@
 							       north))) {
 
 		    row =
-			(int)(G_northing_to_row
+			(int)(Rast_northing_to_row
 			      (points_first->y[0], &elaboration_reg));
 		    col =
-			(int)(G_easting_to_col
+			(int)(Rast_easting_to_col
 			      (points_first->x[0], &elaboration_reg));
 
 		    if (fabs
@@ -473,10 +473,10 @@
 		     (points->y[0] == original_reg.north))) {
 
 		    row =
-			(int)(G_northing_to_row
+			(int)(Rast_northing_to_row
 			      (points->y[0], &elaboration_reg));
 		    col =
-			(int)(G_easting_to_col
+			(int)(Rast_easting_to_col
 			      (points->x[0], &elaboration_reg));
 
 		    if (raster_matrix[row][col].clas == PRE_TERRAIN) {

Modified: grass/trunk/vector/lidar/v.surf.bspline/main.c
===================================================================
--- grass/trunk/vector/lidar/v.surf.bspline/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/lidar/v.surf.bspline/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -358,8 +358,8 @@
     G_debug(1, "Interpolation()");
 
     if (map) {
-	nrows = G_window_rows();
-	ncols = G_window_cols();
+	nrows = Rast_window_rows();
+	ncols = Rast_window_cols();
 
 	if (!G_alloc_matrix(nrows, ncols))
 	    G_fatal_error(_("Interpolation: The region resolution is too high: "

Modified: grass/trunk/vector/v.kernel/main.c
===================================================================
--- grass/trunk/vector/v.kernel/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/v.kernel/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -405,8 +405,8 @@
 		    continue;
 		}
 
-		N = G_row_to_northing(row + 0.5, &window);
-		E = G_col_to_easting(col + 0.5, &window);
+		N = Rast_row_to_northing(row + 0.5, &window);
+		E = Rast_col_to_easting(col + 0.5, &window);
 
 		compute_distance(N, E, &In, sigma, term, &gaussian, dmax);
 		output_cell[col] = multip * gaussian;

Modified: grass/trunk/vector/v.neighbors/main.c
===================================================================
--- grass/trunk/vector/v.neighbors/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/v.neighbors/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -85,8 +85,8 @@
     field = Vect_get_field_number(&In, field_opt->answer);
 
     G_get_set_window(&region);
-    nrows = G_window_rows();
-    ncols = G_window_cols();
+    nrows = Rast_window_rows();
+    ncols = Rast_window_cols();
 
     result = Rast_allocate_buf(CELL_TYPE);
     Points = Vect_new_line_struct();
@@ -105,7 +105,7 @@
 
 	G_percent(row, nrows, 2);
 
-	y = G_row_to_northing(row + 0.5, &region);
+	y = Rast_row_to_northing(row + 0.5, &region);
 	box.N = y + radius;
 	box.S = y - radius;
 
@@ -116,7 +116,7 @@
 	    int i, count;
 	    CELL value;
 
-	    x = G_col_to_easting(col + 0.5, &region);
+	    x = Rast_col_to_easting(col + 0.5, &region);
 
 	    box.E = x + radius;
 	    box.W = x - radius;

Modified: grass/trunk/vector/v.to.rast/support.c
===================================================================
--- grass/trunk/vector/v.to.rast/support.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/v.to.rast/support.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -427,11 +427,11 @@
 	    Rast_init_cell_stats(&stats);
 	    Rast_set_cats_title("Categories", &rast_cats);
 
-	    rows = G_window_rows();
+	    rows = Rast_window_rows();
 
 	    for (row = 0; row < rows; row++) {
 		Rast_get_row(fd, rowbuf, row, map_type);
-		Rast_update_cell_stats(rowbuf, G_window_cols(), &stats);
+		Rast_update_cell_stats(rowbuf, Rast_window_cols(), &stats);
 	    }
 
 	    Rast_rewind_cell_stats(&stats);

Modified: grass/trunk/vector/v.what.rast/main.c
===================================================================
--- grass/trunk/vector/v.what.rast/main.c	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/vector/v.what.rast/main.c	2010-02-01 17:53:15 UTC (rev 40771)
@@ -193,8 +193,8 @@
 	G_debug(4, "    cat = %d", cat);
 
 	/* Add point to cache */
-	drow = G_northing_to_row(Points->y[0], &window);
-	dcol = G_easting_to_col(Points->x[0], &window);
+	drow = Rast_northing_to_row(Points->y[0], &window);
+	dcol = Rast_easting_to_col(Points->x[0], &window);
 
 	/* a special case.
 	 *   if north falls at southern edge, or east falls on eastern edge,

Modified: grass/trunk/visualization/xganim/main.cc
===================================================================
--- grass/trunk/visualization/xganim/main.cc	2010-02-01 15:36:31 UTC (rev 40770)
+++ grass/trunk/visualization/xganim/main.cc	2010-02-01 17:53:15 UTC (rev 40771)
@@ -109,8 +109,8 @@
     }
     fprintf(stderr, "\n");
 
-    vrows = G_window_rows();
-    vcols = G_window_cols();
+    vrows = Rast_window_rows();
+    vcols = Rast_window_cols();
     nrows = vrows;
     ncols = vcols;
 
@@ -190,7 +190,7 @@
 
     dcell = Rast_allocate_d_buf();
 
-    tsiz = G_window_cols();
+    tsiz = Rast_window_cols();
 
     /* allocate memory */
     tr   = (unsigned char *) G_malloc(tsiz * sizeof(char));



More information about the grass-commit mailing list