Junio C Hamano | e0173ad | 2007-04-28 23:38:52 -0700 | [diff] [blame] | 1 | #ifndef PROGRESS_H |
| 2 | #define PROGRESS_H |
Nicolas Pitre | 96a02f8 | 2007-04-18 14:27:45 -0400 | [diff] [blame] | 3 | |
| 4 | struct progress { |
Nicolas Pitre | 13aaf14 | 2007-04-20 14:10:07 -0400 | [diff] [blame] | 5 | const char *prefix; |
Nicolas Pitre | 96a02f8 | 2007-04-18 14:27:45 -0400 | [diff] [blame] | 6 | unsigned total; |
| 7 | unsigned last_percent; |
Nicolas Pitre | 180a9f2 | 2007-04-20 15:05:27 -0400 | [diff] [blame] | 8 | unsigned delay; |
| 9 | unsigned delayed_percent_treshold; |
| 10 | const char *delayed_title; |
Nicolas Pitre | 96a02f8 | 2007-04-18 14:27:45 -0400 | [diff] [blame] | 11 | }; |
| 12 | |
| 13 | int display_progress(struct progress *progress, unsigned n); |
Nicolas Pitre | 13aaf14 | 2007-04-20 14:10:07 -0400 | [diff] [blame] | 14 | void start_progress(struct progress *progress, const char *title, |
| 15 | const char *prefix, unsigned total); |
Nicolas Pitre | 180a9f2 | 2007-04-20 15:05:27 -0400 | [diff] [blame] | 16 | void start_progress_delay(struct progress *progress, const char *title, |
| 17 | const char *prefix, unsigned total, |
| 18 | unsigned percent_treshold, unsigned delay); |
Nicolas Pitre | 96a02f8 | 2007-04-18 14:27:45 -0400 | [diff] [blame] | 19 | void stop_progress(struct progress *progress); |
| 20 | |
| 21 | #endif |