2007-04-19 02:27:45 +08:00
|
|
|
#ifndef __progress_h__
|
|
|
|
#define __progress_h__
|
|
|
|
|
|
|
|
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-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
|