GRASS GIS 8 Programmer's Manual  8.5.0dev(2024)-36359e2344
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 }
void G__write_Cell_head(FILE *, const struct Cell_head *, int)
Write cell header or window.
Definition: wr_cellhd.c:28
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
FILE * G_fopen_new(const char *, const char *)
Open a new database file.
Definition: gis/open.c:219
#define _(str)
Definition: glocale.h:10
const char * name
Definition: named_colr.c:6
void Rast_put_cellhd(const char *name, struct Cell_head *cellhd)
Writes the raster file header.
Definition: put_cellhd.c:28
2D/3D raster map header (used also for region)
Definition: gis.h:440