put_window.c

Go to the documentation of this file.
00001 /*
00002  **********************************************************************
00003  *
00004  * G_put_window (window)
00005  *      write the current mapset window
00006  **********************************************************************
00007  *
00008  * G__put_window (window, dir, name)
00009  *      write the window 'name' in 'mapset'
00010  *      returns -1  error
00011  *               1  ok
00012  *********************************************************************/
00013 
00014 #include <stdlib.h>
00015 #include <grass/gis.h>
00016 
00032 int G_put_window (struct Cell_head *window )
00033 {
00034     char *wind = getenv("WIND_OVERRIDE");
00035 
00036     return wind
00037         ? G__put_window (window, "windows", wind)
00038         : G__put_window (window, "", "WIND");
00039 }
00040 
00041 int G__put_window ( struct Cell_head *window , char *dir, char *name)
00042 {
00043     FILE *fd ;
00044 
00045     if (!(fd = G_fopen_new(dir, name)))
00046         return -1 ;
00047 
00048     G__write_Cell_head3 (fd, window, 0);
00049     fclose (fd);
00050 
00051     return 1;
00052 }

Generated on Wed Dec 19 14:59:06 2007 for GRASS by  doxygen 1.5.4