23 static int (*ext_percent)(int);
67 x = (d <= 0 || s <= 0) ? 100 : (
int)(100 * n / d);
73 if (n <= 0 || n >= d ||
x >
st->prev + s) {
81 fprintf(stderr,
"%4d%%\b\b\b\b\b",
x);
86 fprintf(stderr,
"%d\n",
x);
88 fprintf(stderr,
"%d..",
x);
92 fprintf(stderr,
"\n");
94 fprintf(stderr,
"GRASS_INFO_PERCENT: %d\n",
x);
107 fprintf(stderr,
"\n");
168 if (n == s && n == 1) {
170 fprintf(stderr,
"\n");
172 fprintf(stderr,
"\r");
178 fprintf(stderr,
"%ld..", n);
180 fprintf(stderr,
"GRASS_INFO_PROGRESS: %ld\n", n);
182 fprintf(stderr,
"%10ld\b\b\b\b\b\b\b\b\b\b", n);
194 ext_percent = percent_routine;
int G_verbose(void)
Get current verbosity level.
int G_info_format(void)
Get current message format.
#define G_INFO_FORMAT_GUI
#define G_INFO_FORMAT_PLAIN
#define G_INFO_FORMAT_STANDARD
#define G_INFO_FORMAT_SILENT
void G_percent_reset(void)
Reset G_percent() to 0%; do not add newline.
void G_unset_percent_routine(void)
After this call subsequent percentage progress messages will be handled in the default method.
void G_percent(long n, long d, int s)
Print percent complete messages.
void G_set_percent_routine(int(*percent_routine)(int))
Establishes percent_routine as the routine that will handle the printing of percentage progress messa...
void G_progress(long n, int s)
Print progress info messages.