blob: 29ec8efffefb7ec9e0ac1936304257cc8c5ff9ef [file] [log] [blame]
Arnaldo Carvalho de Melo34cea7f2010-08-08 19:56:47 -03001#ifndef _PERF_UI_PROGRESS_H_
2#define _PERF_UI_PROGRESS_H_ 1
3
Arnaldo Carvalho de Meloca59bcb2011-10-25 13:29:11 -02004#include <../types.h>
Arnaldo Carvalho de Melo34cea7f2010-08-08 19:56:47 -03005
Arnaldo Carvalho de Melo4d3001f2013-10-23 15:40:38 -03006void ui_progress__finish(void);
7
8struct ui_progress {
9 const char *title;
10 u64 curr, next, step, total;
11};
12
13void ui_progress__init(struct ui_progress *p, u64 total, const char *title);
14void ui_progress__update(struct ui_progress *p, u64 adv);
15
Arnaldo Carvalho de Melo4779a2e2013-10-23 14:08:48 -030016struct ui_progress_ops {
Arnaldo Carvalho de Melo4d3001f2013-10-23 15:40:38 -030017 void (*update)(struct ui_progress *p);
Namhyung Kima5580f32012-11-13 22:30:34 +090018 void (*finish)(void);
Namhyung Kim688f2f52012-11-13 22:30:32 +090019};
20
Arnaldo Carvalho de Melo4779a2e2013-10-23 14:08:48 -030021extern struct ui_progress_ops *ui_progress__ops;
Namhyung Kim688f2f52012-11-13 22:30:32 +090022
Arnaldo Carvalho de Melo34cea7f2010-08-08 19:56:47 -030023#endif