Skip to content

Commit

Permalink
Re-instate G_set_window()
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38024 15284696-431f-4ddb-bdfa-cd5b030d7da7
  • Loading branch information
glynnc committed Jun 22, 2009
1 parent cef093c commit 25761d3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/gisdefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ void G_fseek(FILE *, off_t, int);

/* set_window.c */
void G_get_set_window(struct Cell_head *);
int G_set_window(struct Cell_head *);

/* short_way.c */
void G_shortest_way(double *, double *);
Expand Down
31 changes: 31 additions & 0 deletions lib/gis/set_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,34 @@ void G_get_set_window(struct Cell_head *window)
G__init_window();
G_copy(window, &G__.window, sizeof(*window));
}

/*!
* \brief Establishes 'window' as the current working window.
*
* \param window window to become operative window
*
* \return -1 on error
* \return 1 on success
*/
int G_set_window(struct Cell_head *window)
{
const char *err;

/* adjust window, check for valid window */
/* adjust the real one, not a copy
G_copy (&twindow, window, sizeof(struct Cell_head));
window = &twindow;
*/

if ((err = G_adjust_Cell_head(window, 0, 0))) {
G_warning("G_set_window(): %s", err);
return -1;
}

/* copy the window to the current window */
G_copy((char *)&G__.window, (char *)window, sizeof(*window));

G__.window_set = 1;

return 1;
}

0 comments on commit 25761d3

Please sign in to comment.