Loading...
Searching...
No Matches
progress_bar.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 Inria
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
19#ifndef PROGRESS_BAR_H
20#define PROGRESS_BAR_H
21
22#include <stdlib.h>
23#include <inttypes.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
32#ifndef CONFIG_PROGRESS_BAR_LENGTH
33#define CONFIG_PROGRESS_BAR_LENGTH (25U)
34#endif
35
39#ifndef CONFIG_PROGRESS_BAR_FULL_CHARACTER
40#define CONFIG_PROGRESS_BAR_FULL_CHARACTER "█"
41#endif
42
46#ifndef CONFIG_PROGRESS_BAR_EMPTY_CHARACTER
47#define CONFIG_PROGRESS_BAR_EMPTY_CHARACTER " "
48#endif
49
53#ifndef CONFIG_PROGRESS_BAR_PREFIX_CHARACTER
54#define CONFIG_PROGRESS_BAR_PREFIX_CHARACTER "|"
55#endif
56
60#ifndef CONFIG_PROGRESS_BAR_SUFFIX_CHARACTER
61#define CONFIG_PROGRESS_BAR_SUFFIX_CHARACTER "|"
62#endif
63
67#ifndef CONFIG_PROGRESS_BAR_PREFIX_MAX_LENGTH
68#define CONFIG_PROGRESS_BAR_PREFIX_MAX_LENGTH (32U)
69#endif
70
74#ifndef CONFIG_PROGRESS_BAR_SUFFIX_MAX_LENGTH
75#define CONFIG_PROGRESS_BAR_SUFFIX_MAX_LENGTH (32U)
76#endif
77
89
97void progress_bar_print(char *prefix, char *suffix, uint8_t value);
98
105
118
125void progress_bar_update_multi(progress_bar_t *progress_bar_list, uint8_t len);
126
127#ifdef __cplusplus
128}
129#endif
130
132#endif /* PROGRESS_BAR_H */
Adds include for missing inttype definitions.
void progress_bar_print(char *prefix, char *suffix, uint8_t value)
Print a progress bar in the terminal.
void progress_bar_prepare_multi(uint8_t len)
Prepare the output for displaying multiple progress bars.
#define CONFIG_PROGRESS_BAR_PREFIX_MAX_LENGTH
Progress bar prefix max length.
void progress_bar_update(progress_bar_t *progress_bar)
Update the progress bar display in the terminal.
#define CONFIG_PROGRESS_BAR_SUFFIX_MAX_LENGTH
Progress bar suffix max length.
void progress_bar_update_multi(progress_bar_t *progress_bar_list, uint8_t len)
Update all progress bar displays of the given progress bars list.
Progress bar descriptor.
uint8_t value
Current value of the progress bar.