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