put_cellhd.c 901 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. #include <grass/gis.h>
  14. #include <grass/glocale.h>
  15. /*!
  16. \brief Writes the raster file header.
  17. Writes the cell file header information associated with map layer "map"
  18. into current mapset from the structure "cellhd".
  19. \param name name of map
  20. \param cellhd structure holding cell header info
  21. \return void
  22. */
  23. void Rast_put_cellhd(const char *name, struct Cell_head *cellhd)
  24. {
  25. FILE *fp;
  26. fp = G_fopen_new("cellhd", name);
  27. if (!fp)
  28. G_fatal_error(_("Unable to create header file for <%s>"), name);
  29. G__write_Cell_head(fp, cellhd, 1);
  30. fclose(fp);
  31. }