GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-d6dec75dd4
put_window.c File Reference

GIS Library - Modify window (i.e. GRASS region) More...

#include <stdlib.h>
#include <grass/gis.h>
#include "gis_local_proto.h"
Include dependency graph for put_window.c:

Go to the source code of this file.

Functions

int G_put_window (const struct Cell_head *window)
 Writes the region (window) More...
 
int G_put_element_window (const struct Cell_head *window, const char *dir, const char *name)
 Write the region. More...
 

Detailed Description

GIS Library - Modify window (i.e. GRASS region)

(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

Definition in file put_window.c.

Function Documentation

◆ G_put_element_window()

int G_put_element_window ( const struct Cell_head window,
const char *  dir,
const char *  name 
)

Write the region.

Writes the region file (WIND) in the user's current mapset from region.

Warning: Since this routine actually changes the region, it should only be called by modules which the user knows will change the region. It is probably fair to say that only the g.region should call this routine.

Parameters
[in,out]windowpointer to Cell_head
dirdirectory name
namefile name
Returns
1 on success
-1 on error (no diagnostic message is printed)
See also
G_put_window()

Definition at line 74 of file put_window.c.

Referenced by G_make_mapset().

◆ G_put_window()

int G_put_window ( const struct Cell_head window)

Writes the region (window)

Writes the region file (WIND) in the user's current mapset or when environmental variable WIND_OVERRIDE is set, it writes the region to file specified by WIND_OVERRIDE variable.

When WIND_OVERRIDE is set the current process and child processes are affected. Otherwise the whole GRASS session is affected.

Warning
When environmental variable WIND_OVERRIDE is not set, this routine actually changes the region. So in this case it should only be called by modules which the user knows will change the region. It is probably fair to say that only the g.region should call this routine unless WIND_OVERRIDE is set.

This function does not adjust the window before setting the region so you should call G_adjust_Cell_head() before calling this function.

Parameters
[in,out]windowpointer to Cell_head
Returns
1 on success
-1 on error (no diagnostic message is printed)
See also
G_get_window(), G_set_window(), python.core.use_temp_region()

Definition at line 46 of file put_window.c.