[GRASS-SVN] r34166 - in grass/branches/develbranch_6: include lib/gis

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Nov 6 07:04:40 EST 2008


Author: neteler
Date: 2008-11-06 07:04:39 -0500 (Thu, 06 Nov 2008)
New Revision: 34166

Modified:
   grass/branches/develbranch_6/include/gis.h
   grass/branches/develbranch_6/lib/gis/error.c
   grass/branches/develbranch_6/lib/gis/percent.c
Log:
added G_INFO_FORMAT_PLAIN (merge from trunk, r34164)

Modified: grass/branches/develbranch_6/include/gis.h
===================================================================
--- grass/branches/develbranch_6/include/gis.h	2008-11-06 11:58:18 UTC (rev 34165)
+++ grass/branches/develbranch_6/include/gis.h	2008-11-06 12:04:39 UTC (rev 34166)
@@ -202,6 +202,7 @@
 #define G_INFO_FORMAT_STANDARD 0	/* GRASS_MESSAGE_FORMAT=standard or not defined */
 #define G_INFO_FORMAT_GUI      1	/* GRASS_MESSAGE_FORMAT=gui */
 #define G_INFO_FORMAT_SILENT   2	/* GRASS_MESSAGE_FORMAT=silent */
+#define G_INFO_FORMAT_PLAIN    3	/* GRASS_MESSAGE_FORMAT=plain */
 
 /* Icon types */
 #define G_ICON_CROSS  0

Modified: grass/branches/develbranch_6/lib/gis/error.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/error.c	2008-11-06 11:58:18 UTC (rev 34165)
+++ grass/branches/develbranch_6/lib/gis/error.c	2008-11-06 12:04:39 UTC (rev 34166)
@@ -332,6 +332,7 @@
 	logfile = getenv("GIS_ERROR_LOG");
 	if (!logfile) {
 	    char buf[GPATH_MAX];
+
 	    sprintf(buf, "%s/GIS_ERROR_LOG", G__home());
 	    logfile = G_store(buf);
 	}
@@ -495,6 +496,8 @@
 	    grass_info_format = G_INFO_FORMAT_GUI;
 	else if (fstr && G_strcasecmp(fstr, "silent") == 0)
 	    grass_info_format = G_INFO_FORMAT_SILENT;
+	else if (fstr && G_strcasecmp(fstr, "plain") == 0)
+	    grass_info_format = G_INFO_FORMAT_BATCH;
 	else
 	    grass_info_format = G_INFO_FORMAT_STANDARD;
     }

Modified: grass/branches/develbranch_6/lib/gis/percent.c
===================================================================
--- grass/branches/develbranch_6/lib/gis/percent.c	2008-11-06 11:58:18 UTC (rev 34165)
+++ grass/branches/develbranch_6/lib/gis/percent.c	2008-11-06 12:04:39 UTC (rev 34166)
@@ -111,15 +111,25 @@
 		fprintf(out, "%4d%%\b\b\b\b\b", x);
 	    }
 	}
-	else {			/* GUI */
-	    if (out != NULL) {
-		if (first) {
-		    fprintf(out, "\n");
+	else {
+	    if (format == G_INFO_FORMAT_BATCH) {
+		if (out != NULL) {
+		    if (x == 100)
+			fprintf(out, "%d\n", x);
+		    else
+			fprintf(out, "%d..", x);
 		}
-		fprintf(out, "GRASS_INFO_PERCENT: %d\n", x);
-		fflush(out);
 	    }
-	    first = 0;
+	    else {		/* GUI */
+		if (out != NULL) {
+		    if (first) {
+			fprintf(out, "\n");
+		    }
+		    fprintf(out, "GRASS_INFO_PERCENT: %d\n", x);
+		    fflush(out);
+		}
+		first = 0;
+	    }
 	}
     }
 



More information about the grass-commit mailing list