mirror of
https://gitlab.freedesktop.org/libinput/libei.git
synced 2026-05-08 23:18:03 +02: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)
|
_printf_(1, 2)
|
||||||
colorprint(const char *format, ...)
|
colorprint(const char *format, ...)
|
||||||
{
|
{
|
||||||
static const char *color = ANSI_BG_RGB(230, 0, 230);
|
static uint64_t color = 0;
|
||||||
static const char *reset = ansi_colorcode[RESET];
|
|
||||||
|
|
||||||
run_only_once {
|
run_only_once {
|
||||||
if (!isatty(STDOUT_FILENO))
|
color = rgb(1, 1, 1) | rgb_bg(230, 0, 230);
|
||||||
color = reset = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%sEI socket client:%s ", color, reset);
|
cprintf(color, "EI socket client: ");
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
vprintf(format, args);
|
vprintf(format, args);
|
||||||
|
|
|
||||||
|
|
@ -72,15 +72,12 @@ static inline void
|
||||||
_printf_(1, 2)
|
_printf_(1, 2)
|
||||||
colorprint(const char *format, ...)
|
colorprint(const char *format, ...)
|
||||||
{
|
{
|
||||||
static const char *color = ANSI_BG_RGB(255, 127, 0);
|
static uint64_t color = 0;
|
||||||
static const char *reset = ansi_colorcode[RESET];
|
|
||||||
|
|
||||||
run_only_once {
|
run_only_once {
|
||||||
if (!isatty(STDOUT_FILENO))
|
color = rgb(1, 1, 1) | rgb_bg(255, 127, 0);
|
||||||
color = reset = "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%sEIS socket server:%s ", color, reset);
|
cprintf(color, "EIS socket server: ");
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
vprintf(format, args);
|
vprintf(format, args);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue