NeoMutt  2021-02-05-89-gabe350
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 */
ProgressType
ProgressType
What kind of operation is this progress tracking?
Definition: progress.h:40
MUTT_PROGRESS_NET
@ MUTT_PROGRESS_NET
Progress tracks bytes, according to $net_inc
Definition: progress.h:44
C_ReadInc
short C_ReadInc
Config: Update the progress bar after this many records read (0 to disable)
Definition: progress.c:44
Progress::is_bytes
bool is_bytes
Definition: progress.h:58
MUTT_PROGRESS_WRITE
@ MUTT_PROGRESS_WRITE
Progress tracks elements, according to $write_inc
Definition: progress.h:43
C_WriteInc
short C_WriteInc
Config: Update the progress bar after this many records written (0 to disable)
Definition: progress.c:45
Progress::sizestr
char sizestr[24]
Definition: progress.h:53
Progress
A progress bar.
Definition: progress.h:50
Progress::inc
size_t inc
Definition: progress.h:56
MUTT_PROGRESS_READ
@ MUTT_PROGRESS_READ
Progress tracks elements, according to $read_inc
Definition: progress.h:42
Progress::timestamp
uint64_t timestamp
Definition: progress.h:57
mutt_progress_update
void mutt_progress_update(struct Progress *progress, size_t pos, int percent)
Update the state of the progress bar.
Definition: progress.c:212
Progress::msg
char msg[1024]
Definition: progress.h:52
Progress::size
size_t size
Definition: progress.h:55
C_NetInc
short C_NetInc
Config: (socket) Update the progress bar after this many KB sent/received (0 to disable)
Definition: progress.c:46
C_TimeInc
short C_TimeInc
Config: Frequency of progress bar updates (milliseconds)
Definition: progress.c:43
mutt_progress_init
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
Progress::pos
size_t pos
Definition: progress.h:54