support.c 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /****************************************************************************
  2. *
  3. * MODULE: r.carve
  4. *
  5. * AUTHOR(S): Original author Bill Brown, UIUC GIS Laboratory
  6. * Brad Douglas <rez touchofmadness com>
  7. *
  8. * PURPOSE: Takes vector stream data, converts it to 3D raster and
  9. * subtracts a specified depth
  10. *
  11. * COPYRIGHT: (C) 2006 by the GRASS Development Team
  12. *
  13. * This program is free software under the GNU General Public
  14. * License (>=v2). Read the file COPYING that comes with GRASS
  15. * for details.
  16. *
  17. ****************************************************************************/
  18. #include <string.h>
  19. #include <stdio.h>
  20. #include <grass/gis.h>
  21. #include <grass/raster.h>
  22. #include <grass/glocale.h>
  23. #include "enforce.h"
  24. /*
  25. * update_rast_history - Update a history file. Some of the digit file
  26. * information is placed in the history file.
  27. */
  28. void update_rast_history(struct parms *parm)
  29. {
  30. struct History hist;
  31. /* write command line to history */
  32. Rast_short_history(parm->outrast->answer, "raster", &hist);
  33. Rast_append_format_history(&hist, "%s version %.2f", G_program_name(), APP_VERSION);
  34. Rast_append_format_history(&hist, "stream width: %.2f", parm->swidth * 2);
  35. Rast_format_history(&hist, HIST_DATSRC_1, "raster elevation file: %s", parm->inrast->answer);
  36. Rast_format_history(&hist, HIST_DATSRC_2, "vector stream file: %s", parm->invect->answer);
  37. Rast_command_history(&hist);
  38. Rast_write_history(parm->outrast->answer, &hist);
  39. }