NeoMutt  2020-06-26-89-g172cd3
Teaching an old dog new tricks
DOXYGEN
progress.h
Go to the documentation of this file.
1 
24 #ifndef MUTT_PROGRESS_H
25 #define MUTT_PROGRESS_H
26 
27 #include <stdbool.h>
28 #include <stdint.h>
29 #include <stdio.h>
30 
31 /* These Config Variables are only used in progress.c */
32 extern short C_TimeInc;
33 extern short C_ReadInc;
34 extern short C_WriteInc;
35 extern short C_NetInc;
36 
41 {
45 };
46 
50 struct Progress
51 {
52  char msg[1024];
53  char sizestr[24];
54  size_t pos;
55  size_t size;
56  size_t inc;
57  uint64_t timestamp;
58  bool is_bytes;
59 };
60 
61 void mutt_progress_init(struct Progress *progress, const char *msg, enum ProgressType type, size_t size);
62 void mutt_progress_update(struct Progress *progress, size_t pos, int percent);
63 
64 #endif /* MUTT_PROGRESS_H */
Progress tracks bytes, according to C_NetInc.
Definition: progress.h:44
ProgressType
What kind of operation is this progress tracking?
Definition: progress.h:40
size_t size
Definition: progress.h:55
bool is_bytes
Definition: progress.h:58
void mutt_progress_update(struct Progress *progress, size_t pos, int percent)
Update the state of the progress bar.
Definition: progress.c:212
Progress tracks elements, according to C_WriteInc.
Definition: progress.h:43
A progress bar.
Definition: progress.h:50
Progress tracks elements, according to C_ReadInc.
Definition: progress.h:42
size_t pos
Definition: progress.h:54
void mutt_progress_init(struct Progress *progress, const char *msg, enum ProgressType type, size_t size)
Set up a progress bar.
Definition: progress.c:153
size_t inc
Definition: progress.h:56
char msg[1024]
Definition: progress.h:52
uint64_t timestamp
Definition: progress.h:57
short C_NetInc
Config: (socket) Update the progress bar after this many KB sent/received (0 to disable) ...
Definition: progress.c:46
char sizestr[24]
Definition: progress.h:53
short C_WriteInc
Config: Update the progress bar after this many records written (0 to disable)
Definition: progress.c:45
short C_ReadInc
Config: Update the progress bar after this many records read (0 to disable)
Definition: progress.c:44
short C_TimeInc
Config: Frequency of progress bar updates (milliseconds)
Definition: progress.c:43