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