mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2025-12-26 20:20:07 +01:00
tools/demo-client, demo-server: use the new color print functions
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c169e10af7
commit
22930d0d2b
2 changed files with 6 additions and 12 deletions
|
|
@ -51,15 +51,12 @@ static inline void
|
|||
_printf_(1, 2)
|
||||
colorprint(const char *format, ...)
|
||||
{
|
||||
static const char *color = ANSI_BG_RGB(230, 0, 230);
|
||||
static const char *reset = ansi_colorcode[RESET];
|
||||
|
||||
static uint64_t color = 0;
|
||||
run_only_once {
|
||||
if (!isatty(STDOUT_FILENO))
|
||||
color = reset = "";
|
||||
color = rgb(1, 1, 1) | rgb_bg(230, 0, 230);
|
||||
}
|
||||
|
||||
printf("%sEI socket client:%s ", color, reset);
|
||||
cprintf(color, "EI socket client: ");
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
|
|
|
|||
|
|
@ -72,15 +72,12 @@ static inline void
|
|||
_printf_(1, 2)
|
||||
colorprint(const char *format, ...)
|
||||
{
|
||||
static const char *color = ANSI_BG_RGB(255, 127, 0);
|
||||
static const char *reset = ansi_colorcode[RESET];
|
||||
|
||||
static uint64_t color = 0;
|
||||
run_only_once {
|
||||
if (!isatty(STDOUT_FILENO))
|
||||
color = reset = "";
|
||||
color = rgb(1, 1, 1) | rgb_bg(255, 127, 0);
|
||||
}
|
||||
|
||||
printf("%sEIS socket server:%s ", color, reset);
|
||||
cprintf(color, "EIS socket server: ");
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
vprintf(format, args);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue