2017-11-25 04:21:35 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2015-04-28 18:18:21 +08:00
|
|
|
#ifndef __COLOR_H__
|
|
|
|
#define __COLOR_H__ 1
|
|
|
|
|
2018-08-18 00:38:45 +08:00
|
|
|
#include <stdbool.h>
|
|
|
|
|
2015-04-28 18:18:21 +08:00
|
|
|
enum color_attr {
|
|
|
|
COLOR_IFNAME,
|
|
|
|
COLOR_MAC,
|
|
|
|
COLOR_INET,
|
|
|
|
COLOR_INET6,
|
|
|
|
COLOR_OPERSTATE_UP,
|
2016-03-23 02:35:13 +08:00
|
|
|
COLOR_OPERSTATE_DOWN,
|
2017-10-13 21:57:19 +08:00
|
|
|
COLOR_NONE
|
2015-04-28 18:18:21 +08:00
|
|
|
};
|
|
|
|
|
2018-08-18 00:38:45 +08:00
|
|
|
enum color_opt {
|
|
|
|
COLOR_OPT_NEVER = 0,
|
|
|
|
COLOR_OPT_AUTO = 1,
|
|
|
|
COLOR_OPT_ALWAYS = 2
|
|
|
|
};
|
|
|
|
|
2018-08-18 00:38:46 +08:00
|
|
|
bool check_enable_color(int color, int json);
|
2018-08-18 00:38:45 +08:00
|
|
|
bool matches_color(const char *arg, int *val);
|
2015-04-28 18:18:21 +08:00
|
|
|
int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...);
|
2016-03-23 02:35:13 +08:00
|
|
|
enum color_attr ifa_family_color(__u8 ifa_family);
|
|
|
|
enum color_attr oper_state_color(__u8 state);
|
2015-04-28 18:18:21 +08:00
|
|
|
|
|
|
|
#endif
|