progress: Add machine readable flag.
[libguestfs.git] / fish / progress.h
1 /* libguestfs - mini library for progress bars.
2  * Copyright (C) 2010-2011 Red Hat Inc.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18
19 #include <config.h>
20
21 #ifndef PROGRESS_H
22 #define PROGRESS_H
23
24 struct progress_bar;
25
26 /* Initialize the progress bar mini library.
27  *
28  * Function returns a handle, or NULL if there was an error.
29  */
30 #define PROGRESS_BAR_MACHINE_READABLE 1
31 extern struct progress_bar *progress_bar_init (unsigned flags);
32
33 /* This should be called at the start of each command. */
34 extern void progress_bar_reset (struct progress_bar *);
35
36 /* This should be called from the progress bar callback.  It displays
37  * the progress bar.
38  */
39 extern void progress_bar_set (struct progress_bar *, uint64_t position, uint64_t total);
40
41 /* Free up progress bar handle and resources. */
42 extern void progress_bar_free (struct progress_bar *);
43
44 #endif /* PROGRESS_H */