[GRASS-SVN] r64787 - grass-addons/grass7/imagery/i.spec.unmix

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 3 01:46:34 PST 2015


Author: neteler
Date: 2015-03-03 01:46:34 -0800 (Tue, 03 Mar 2015)
New Revision: 64787

Modified:
   grass-addons/grass7/imagery/i.spec.unmix/hist.c
Log:
i.spec.unmix Addon: updated hist.c using code from i.spec.sam

Modified: grass-addons/grass7/imagery/i.spec.unmix/hist.c
===================================================================
--- grass-addons/grass7/imagery/i.spec.unmix/hist.c	2015-03-03 09:20:56 UTC (rev 64786)
+++ grass-addons/grass7/imagery/i.spec.unmix/hist.c	2015-03-03 09:46:34 UTC (rev 64787)
@@ -1,15 +1,14 @@
-#include <stdio.h>
 #include <grass/gis.h>
 #include <grass/raster.h>
 
-
-void make_history(char *name, char *group, char *matrixfile)
+void make_history(const char *name, const char *group, const char*matrixfile)
 {
     struct History hist;
 
-    if (Rast_read_history(name, G_mapset(), &hist) >= 0) {
-	sprintf(hist.fields[1], "Group: %s", group);
-	sprintf(hist.fields[2], "Matrix file: %s", matrixfile);
-	Rast_write_history(name, &hist);
+    if(Rast_read_history (name, G_mapset(), &hist) >= 0)
+    {
+	Rast_format_history(&hist, HIST_DATSRC_1, "Group: %s", group);
+	Rast_format_history(&hist, HIST_DATSRC_2, "Matrix file: %s", matrixfile);
+	Rast_write_history (name, &hist);
     }
 }



More information about the grass-commit mailing list