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