GRASS GIS 7 Programmer's Manual  7.5.svn(2017)-r71924
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
put_cellhd.c
Go to the documentation of this file.
1 /*!
2  * \file lib/raster/put_cellhd.c
3  *
4  * \brief Raster Library - Write raster header.
5  *
6  * (C) 2001-2009 by the GRASS Development Team
7  *
8  * This program is free software under the GNU General Public License
9  * (>=v2). Read the file COPYING that comes with GRASS for details.
10  *
11  * \author Original author CERL
12  */
13 
14 #include <grass/gis.h>
15 #include <grass/glocale.h>
16 
17 /*!
18  \brief Writes the raster file header.
19 
20  Writes the cell file header information associated with map layer "map"
21  into current mapset from the structure "cellhd".
22 
23  \param name name of map
24  \param cellhd structure holding cell header info
25 
26  \return void
27  */
28 void Rast_put_cellhd(const char *name, struct Cell_head *cellhd)
29 {
30  FILE *fp;
31 
32  fp = G_fopen_new("cellhd", name);
33  if (!fp)
34  G_fatal_error(_("Unable to create header file for <%s>"), name);
35 
36  G__write_Cell_head(fp, cellhd, 1);
37  fclose(fp);
38 }
2D/3D raster map header (used also for region)
Definition: gis.h:390
void G_fatal_error(const char *msg,...)
Print a fatal error message to stderr.
Definition: gis/error.c:159
void G__write_Cell_head(FILE *fd, const struct Cell_head *cellhd, int is_cellhd)
Write cell header or window.
Definition: wr_cellhd.c:30
fclose(fd)
void Rast_put_cellhd(const char *name, struct Cell_head *cellhd)
Writes the raster file header.
Definition: put_cellhd.c:28
FILE * G_fopen_new(const char *element, const char *name)
Open a new database file.
Definition: gis/open.c:220
#define _(str)
Definition: glocale.h:13
const char * name
Definition: named_colr.c:7