| 1 |
/* SPDX-License-Identifier: LGPL-2.1-or-later */ |
| 2 |
#pragma once |
| 3 |
|
| 4 |
#include "shared-forward.h" |
| 5 |
|
| 6 |
typedef enum PromptFlags { |
| 7 |
PROMPT_MAY_SKIP = 1 << 0, /* Question may be skipped */ |
| 8 |
PROMPT_SHOW_MENU = 1 << 1, /* Show menu list on "list" */ |
| 9 |
PROMPT_SHOW_MENU_NOW = 1 << 2, /* Show menu list right away, rather than only on request */ |
| 10 |
PROMPT_HIDE_MENU_HINT = 1 << 3, /* Don't show hint regarding "list" */ |
| 11 |
PROMPT_HIDE_SKIP_HINT = 1 << 4, /* Don't show hint regarding skipping */ |
| 12 |
PROMPT_SILENT_VALIDATE = 1 << 5, /* The validation log message logs on its own, don't log again */ |
| 13 |
} PromptFlags; |
| 14 |
|
| 15 |
int prompt_loop(const char *text, |
| 16 |
Glyph emoji, |
| 17 |
const char *prefill, |
| 18 |
char **menu, |
| 19 |
char **accepted, |
| 20 |
unsigned ellipsize_percentage, |
| 21 |
size_t n_columns, |
| 22 |
size_t column_width, |
| 23 |
int (*is_valid)(const char *name, void *userdata), |
| 24 |
int (*refresh)(char ***ret_menu, char ***ret_accepted, void *userdata), |
| 25 |
void *userdata, |
| 26 |
PromptFlags flags, |
| 27 |
char **ret); |
| 28 |
|
| 29 |
int chrome_show(const char *top, const char *bottom); |
| 30 |
void chrome_hide(void); |
| 31 |
|
| 32 |
int mute_console(sd_varlink **ret_link); |