GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
put_cellhd.c
Go to the documentation of this file.
1 
2 /**********************************************************************
3  *
4  * G_put_cellhd (name, cellhd)
5  * char *name name of map
6  * struct Cell_head *cellhd structure holding cell header info
7  *
8  * Writes the cell file header information associated with map layer "map"
9  * into current mapset from the structure "cellhd".
10  *
11  * returns: 0 if successful
12  * -1 on fail
13  *
14  ***********************************************************************/
15 
16 #include <grass/gis.h>
17 #include <grass/glocale.h>
18 
19 int G_put_cellhd(const char *name, struct Cell_head *cellhd)
20 {
21  FILE *fd;
22 
23  if (!(fd = G_fopen_new("cellhd", name))) {
24  char buf[1024];
25 
26  sprintf(buf, _("Unable to create header file for [%s]"), name);
27  G_warning(buf);
28  return -1;
29  }
30 
31  G__write_Cell_head(fd, cellhd, 1);
32  fclose(fd);
33 
34  return 0;
35 }
sprintf(buf2,"%s", G3D_CATS_ELEMENT)
FILE * fd
Definition: g3dcolor.c:368
string name
Definition: render.py:1314
int G_put_cellhd(const char *name, struct Cell_head *cellhd)
Definition: put_cellhd.c:19
int G__write_Cell_head(FILE *fd, const struct Cell_head *cellhd, int is_cellhd)
Write cell header or window.
Definition: wr_cellhd.c:30
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62
FILE * G_fopen_new(const char *element, const char *name)
Open a new database file.
Definition: gis/open.c:197
G_warning("category support for [%s] in mapset [%s] %s", name, mapset, type)
fclose(fd)