put_cellhd.c

Go to the documentation of this file.
00001 /**********************************************************************
00002  *
00003  *  G_put_cellhd (name, cellhd)
00004  *      char *name                   name of map
00005  *      struct Cell_head *cellhd    structure holding cell header info
00006  *
00007  *  Writes the cell file header information associated with map layer "map"
00008  *  into current mapset from the structure "cellhd".
00009  *
00010  *  returns:     0  if successful
00011  *              -1  on fail
00012  *
00013  ***********************************************************************/
00014 
00015 #include "gis.h"
00016 #include "glocale.h"
00017 
00018 int G_put_cellhd (char *name, struct Cell_head *cellhd)
00019 {
00020     FILE *fd ;
00021 
00022     if (!(fd = G_fopen_new ("cellhd", name)))
00023     {
00024         char buf[1024];
00025 
00026         sprintf (buf, _("Unable to create header file for [%s]"), name);
00027         G_warning (buf);
00028         return -1;
00029     }
00030 
00031     G__write_Cell_head (fd, cellhd, 1);
00032     fclose (fd);
00033 
00034     return 0;
00035 }

Generated on Mon Jan 1 19:49:25 2007 for GRASS by  doxygen 1.5.1