2007-04-29 14:38:52 +08:00
|
|
|
#ifndef PROGRESS_H
|
|
|
|
#define PROGRESS_H
|
2007-04-19 02:27:45 +08:00
|
|
|
|
|
|
|
struct progress {
|
2007-04-21 02:10:07 +08:00
|
|
|
const char *prefix;
|
2007-04-19 02:27:45 +08:00
|
|
|
unsigned total;
|
|
|
|
unsigned last_percent;
|
2007-04-21 03:05:27 +08:00
|
|
|
unsigned delay;
|
|
|
|
unsigned delayed_percent_treshold;
|
|
|
|
const char *delayed_title;
|
2007-05-24 00:07:25 +08:00
|
|
|
int need_lf;
|
2007-04-19 02:27:45 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
int display_progress(struct progress *progress, unsigned n);
|
2007-04-21 02:10:07 +08:00
|
|
|
void start_progress(struct progress *progress, const char *title,
|
|
|
|
const char *prefix, unsigned total);
|
2007-04-21 03:05:27 +08:00
|
|
|
void start_progress_delay(struct progress *progress, const char *title,
|
|
|
|
const char *prefix, unsigned total,
|
|
|
|
unsigned percent_treshold, unsigned delay);
|
2007-04-19 02:27:45 +08:00
|
|
|
void stop_progress(struct progress *progress);
|
|
|
|
|
|
|
|
#endif
|