]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
15bd9a28 LP |
2 | #pragma once |
3 | ||
b8faf2ec LP |
4 | #include <stdbool.h> |
5 | ||
6 | #include "macro.h" | |
7 | ||
15bd9a28 LP |
8 | /* Manager status */ |
9 | ||
10 | typedef enum ShowStatus { | |
7a293242 YW |
11 | SHOW_STATUS_NO, |
12 | SHOW_STATUS_AUTO, | |
13 | SHOW_STATUS_TEMPORARY, | |
14 | SHOW_STATUS_YES, | |
bee38b5c | 15 | _SHOW_STATUS_MAX, |
7a293242 | 16 | _SHOW_STATUS_INVALID = -1, |
15bd9a28 LP |
17 | } ShowStatus; |
18 | ||
a885727a LP |
19 | typedef enum ShowStatusFlags { |
20 | SHOW_STATUS_ELLIPSIZE = 1 << 0, | |
21 | SHOW_STATUS_EPHEMERAL = 1 << 1, | |
22 | } ShowStatusFlags; | |
23 | ||
36cf4507 ZJS |
24 | typedef enum StatusUnitFormat { |
25 | STATUS_UNIT_FORMAT_NAME, | |
26 | STATUS_UNIT_FORMAT_DESCRIPTION, | |
27 | _STATUS_UNIT_FORMAT_MAX, | |
28 | _STATUS_UNIT_FORMAT_INVALID = -1, | |
29 | } StatusUnitFormat; | |
30 | ||
7a293242 YW |
31 | ShowStatus show_status_from_string(const char *v) _const_; |
32 | const char* show_status_to_string(ShowStatus s) _pure_; | |
15bd9a28 | 33 | int parse_show_status(const char *v, ShowStatus *ret); |
b8faf2ec | 34 | |
36cf4507 ZJS |
35 | StatusUnitFormat status_unit_format_from_string(const char *v) _const_; |
36 | const char* status_unit_format_to_string(StatusUnitFormat s) _pure_; | |
37 | ||
a885727a LP |
38 | int status_vprintf(const char *status, ShowStatusFlags flags, const char *format, va_list ap) _printf_(3,0); |
39 | int status_printf(const char *status, ShowStatusFlags flags, const char *format, ...) _printf_(3,4); |