blob: 5ae1a89e5a4669553e44d5bd0cc339c308c60c0f [file] [log] [blame]
Junio C Hamanoe0173ad2007-04-28 23:38:52 -07001#ifndef PROGRESS_H
2#define PROGRESS_H
Nicolas Pitre96a02f82007-04-18 14:27:45 -04003
4struct progress {
Nicolas Pitre13aaf142007-04-20 14:10:07 -04005 const char *prefix;
Nicolas Pitre96a02f82007-04-18 14:27:45 -04006 unsigned total;
7 unsigned last_percent;
Nicolas Pitre180a9f22007-04-20 15:05:27 -04008 unsigned delay;
9 unsigned delayed_percent_treshold;
10 const char *delayed_title;
Nicolas Pitre96a02f82007-04-18 14:27:45 -040011};
12
13int display_progress(struct progress *progress, unsigned n);
Nicolas Pitre13aaf142007-04-20 14:10:07 -040014void start_progress(struct progress *progress, const char *title,
15 const char *prefix, unsigned total);
Nicolas Pitre180a9f22007-04-20 15:05:27 -040016void start_progress_delay(struct progress *progress, const char *title,
17 const char *prefix, unsigned total,
18 unsigned percent_treshold, unsigned delay);
Nicolas Pitre96a02f82007-04-18 14:27:45 -040019void stop_progress(struct progress *progress);
20
21#endif