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