iproute2/include/color.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: GPL-2.0 */
   2#ifndef __COLOR_H__
   3#define __COLOR_H__ 1
   4
   5#include <stdbool.h>
   6
   7enum color_attr {
   8        COLOR_IFNAME,
   9        COLOR_MAC,
  10        COLOR_INET,
  11        COLOR_INET6,
  12        COLOR_OPERSTATE_UP,
  13        COLOR_OPERSTATE_DOWN,
  14        COLOR_NONE
  15};
  16
  17enum color_opt {
  18        COLOR_OPT_NEVER = 0,
  19        COLOR_OPT_AUTO = 1,
  20        COLOR_OPT_ALWAYS = 2
  21};
  22
  23int default_color_opt(void);
  24bool check_enable_color(int color, int json);
  25bool matches_color(const char *arg, int *val);
  26int color_fprintf(FILE *fp, enum color_attr attr, const char *fmt, ...);
  27enum color_attr ifa_family_color(__u8 ifa_family);
  28enum color_attr oper_state_color(__u8 state);
  29
  30#endif
  31