1 // SPDX-License-Identifier: GPL-2.0
11 char ui_helpline__current[512];
13 static void nop_helpline__pop(void)
17 static void nop_helpline__push(const char *msg __maybe_unused)
21 static int nop_helpline__show(const char *fmt __maybe_unused,
22 va_list ap __maybe_unused)
27 static struct ui_helpline default_helpline_fns = {
28 .pop = nop_helpline__pop,
29 .push = nop_helpline__push,
30 .show = nop_helpline__show,
33 struct ui_helpline *helpline_fns = &default_helpline_fns;
35 void ui_helpline__pop(void)
40 void ui_helpline__push(const char *msg)
42 helpline_fns->push(msg);
45 void ui_helpline__vpush(const char *fmt, va_list ap)
49 if (vasprintf(&s, fmt, ap) < 0)
50 vfprintf(stderr, fmt, ap);
57 void ui_helpline__fpush(const char *fmt, ...)
62 ui_helpline__vpush(fmt, ap);
66 void ui_helpline__puts(const char *msg)
69 ui_helpline__push(msg);
72 int ui_helpline__vshow(const char *fmt, va_list ap)
74 return helpline_fns->show(fmt, ap);
77 void ui_helpline__printf(const char *fmt, ...)
83 ui_helpline__vpush(fmt, ap);