Arnaldo Carvalho de Melo | 34cea7f | 2010-08-08 19:56:47 -0300 | [diff] [blame] | 1 | #ifndef _PERF_UI_PROGRESS_H_ |
| 2 | #define _PERF_UI_PROGRESS_H_ 1 |
| 3 | |
Arnaldo Carvalho de Melo | ca59bcb | 2011-10-25 13:29:11 -0200 | [diff] [blame] | 4 | #include <../types.h> |
Arnaldo Carvalho de Melo | 34cea7f | 2010-08-08 19:56:47 -0300 | [diff] [blame] | 5 | |
Arnaldo Carvalho de Melo | 4d3001f | 2013-10-23 15:40:38 -0300 | [diff] [blame^] | 6 | void ui_progress__finish(void); |
| 7 | |
| 8 | struct ui_progress { |
| 9 | const char *title; |
| 10 | u64 curr, next, step, total; |
| 11 | }; |
| 12 | |
| 13 | void ui_progress__init(struct ui_progress *p, u64 total, const char *title); |
| 14 | void ui_progress__update(struct ui_progress *p, u64 adv); |
| 15 | |
Arnaldo Carvalho de Melo | 4779a2e | 2013-10-23 14:08:48 -0300 | [diff] [blame] | 16 | struct ui_progress_ops { |
Arnaldo Carvalho de Melo | 4d3001f | 2013-10-23 15:40:38 -0300 | [diff] [blame^] | 17 | void (*update)(struct ui_progress *p); |
Namhyung Kim | a5580f3 | 2012-11-13 22:30:34 +0900 | [diff] [blame] | 18 | void (*finish)(void); |
Namhyung Kim | 688f2f5 | 2012-11-13 22:30:32 +0900 | [diff] [blame] | 19 | }; |
| 20 | |
Arnaldo Carvalho de Melo | 4779a2e | 2013-10-23 14:08:48 -0300 | [diff] [blame] | 21 | extern struct ui_progress_ops *ui_progress__ops; |
Namhyung Kim | 688f2f5 | 2012-11-13 22:30:32 +0900 | [diff] [blame] | 22 | |
Arnaldo Carvalho de Melo | 34cea7f | 2010-08-08 19:56:47 -0300 | [diff] [blame] | 23 | #endif |