libite
|
Macros | |
#define | SPINNER_THROB ".oOo" |
#define | SPINNER_PULSAR ".oO°Oo." |
#define | SPINNER_ARROW "v<^>" |
#define | SPINNER_STAR ".oO@*" |
#define | SPINNER_DEFAULT "|/-\\" |
Functions | |
void | progress (int percent, int max_width) |
Advanced ASCII progress bar with spinner. More... | |
void | progress_simple (int percent) |
Alternative progress bar on systems where progress() doesn't work. More... | |
void progress | ( | int | percent, |
int | max_width | ||
) |
Advanced ASCII progress bar with spinner.
percent | Start first call with this set to 0, end with 100 |
max_width | Max width of progress bar, in total characters. |
This function draws an advanced ASCII progressbar at the current line. It always start from the first column.
The progress bar will hide the cursor if started with percent
0 and show it again at the end, when called with percent
100.
While being called with the same percentage the spinner will spin, to show the user the process hasn't frozen.
If the output TTY cannot interpret control characters, like \r
, it is advised to instead used the progress_simple() function.
void progress_simple | ( | int | percent | ) |
Alternative progress bar on systems where progress() doesn't work.
percent | Start first call with this set to 0, end with 100 |