#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | Progress |
A progress bar. More... | |
Enumerations | |
enum | ProgressType { MUTT_PROGRESS_READ, MUTT_PROGRESS_WRITE, MUTT_PROGRESS_NET } |
What kind of operation is this progress tracking? More... | |
Functions | |
void | mutt_progress_init (struct Progress *progress, const char *msg, enum ProgressType type, size_t size) |
Set up a progress bar. More... | |
void | mutt_progress_update (struct Progress *progress, size_t pos, int percent) |
Update the state of the progress bar. More... | |
Variables | |
short | C_TimeInc |
Config: Frequency of progress bar updates (milliseconds) More... | |
short | C_ReadInc |
Config: Update the progress bar after this many records read (0 to disable) More... | |
short | C_WriteInc |
Config: Update the progress bar after this many records written (0 to disable) More... | |
short | C_NetInc |
Config: (socket) Update the progress bar after this many KB sent/received (0 to disable) More... | |
Progress bar.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file progress.h.
enum ProgressType |
What kind of operation is this progress tracking?
Enumerator | |
---|---|
MUTT_PROGRESS_READ | Progress tracks elements, according to |
MUTT_PROGRESS_WRITE | Progress tracks elements, according to |
MUTT_PROGRESS_NET | Progress tracks bytes, according to |
Definition at line 40 of file progress.h.
void mutt_progress_init | ( | struct Progress * | progress, |
const char * | msg, | ||
enum ProgressType | type, | ||
size_t | size | ||
) |
Set up a progress bar.
progress | Progress bar |
msg | Message to display; this is copied into the Progress object |
type | Type, e.g. MUTT_PROGRESS_READ |
size | Total size of expected file / traffic |
Definition at line 153 of file progress.c.
void mutt_progress_update | ( | struct Progress * | progress, |
size_t | pos, | ||
int | percent | ||
) |
Update the state of the progress bar.
progress | Progress bar |
pos | Position, or count |
percent | Percentage complete |
If percent is -1, then the percentage will be calculated using pos and the size in progress.
If percent is positive, it is displayed as percentage, otherwise percentage is calculated from progress->size and pos if progress was initialized with positive size, otherwise no percentage is shown
Definition at line 212 of file progress.c.
short C_TimeInc |
Config: Frequency of progress bar updates (milliseconds)
Definition at line 43 of file progress.c.
short C_ReadInc |
Config: Update the progress bar after this many records read (0 to disable)
Definition at line 44 of file progress.c.
short C_WriteInc |
Config: Update the progress bar after this many records written (0 to disable)
Definition at line 45 of file progress.c.
short C_NetInc |
Config: (socket) Update the progress bar after this many KB sent/received (0 to disable)
Definition at line 46 of file progress.c.