|
cctools
|
Go to the source code of this file.
Data Structures | |
| struct | ProgressBarPart |
| A part of a progress bar. More... | |
| struct | ProgressBar |
| Progress bar object. More... | |
Functions | |
| struct ProgressBar * | progress_bar_init (const char *label) |
| Create a progress bar. More... | |
| void | progress_bar_set_update_interval (struct ProgressBar *bar, double update_interval_sec) |
| Set the update interval for the progress bar. More... | |
| struct ProgressBarPart * | progress_bar_create_part (const char *label, uint64_t total) |
| Create a new part. More... | |
| void | progress_bar_bind_part (struct ProgressBar *bar, struct ProgressBarPart *part) |
| Bind a part to the progress bar. More... | |
| void | progress_bar_set_part_total (struct ProgressBar *bar, struct ProgressBarPart *part, uint64_t new_total) |
| Set the total for a part. More... | |
| void | progress_bar_update_part (struct ProgressBar *bar, struct ProgressBarPart *part, uint64_t increment) |
| Update the current value for a part, redraw if needed. More... | |
| void | progress_bar_set_start_time (struct ProgressBar *bar, timestamp_t start_time) |
| Set the start time for the progress bar. More... | |
| void | progress_bar_finish (struct ProgressBar *bar) |
| Finish the progress bar: draw once and print a newline. More... | |
| void | progress_bar_delete (struct ProgressBar *bar) |
| Delete the progress bar and free all parts. More... | |
Terminal progress bar API with multiple parts.
| struct ProgressBar* progress_bar_init | ( | const char * | label | ) |
Create a progress bar.
| label | Progress bar label (internally duplicated). |
| void progress_bar_set_update_interval | ( | struct ProgressBar * | bar, |
| double | update_interval_sec | ||
| ) |
Set the update interval for the progress bar.
| bar | Progress bar. |
| update_interval_sec | Update interval in seconds. |
| struct ProgressBarPart* progress_bar_create_part | ( | const char * | label, |
| uint64_t | total | ||
| ) |
Create a new part.
| label | Part label (internally duplicated). |
| total | Total units for the part. |
| void progress_bar_bind_part | ( | struct ProgressBar * | bar, |
| struct ProgressBarPart * | part | ||
| ) |
Bind a part to the progress bar.
| bar | Progress bar. |
| part | Part to bind. |
| void progress_bar_set_part_total | ( | struct ProgressBar * | bar, |
| struct ProgressBarPart * | part, | ||
| uint64_t | new_total | ||
| ) |
Set the total for a part.
| bar | Progress bar. |
| part | Part to update. |
| new_total | New total units. |
| void progress_bar_update_part | ( | struct ProgressBar * | bar, |
| struct ProgressBarPart * | part, | ||
| uint64_t | increment | ||
| ) |
Update the current value for a part, redraw if needed.
| bar | Progress bar. |
| part | Part to advance. |
| increment | Amount to add. |
| void progress_bar_set_start_time | ( | struct ProgressBar * | bar, |
| timestamp_t | start_time | ||
| ) |
Set the start time for the progress bar.
| bar | Progress bar. |
| start_time | Start timestamp. |
| void progress_bar_finish | ( | struct ProgressBar * | bar | ) |
Finish the progress bar: draw once and print a newline.
| bar | Progress bar. |
| void progress_bar_delete | ( | struct ProgressBar * | bar | ) |
Delete the progress bar and free all parts.
| bar | Progress bar. |