GCC Middle and Back End API Reference
diagnostic-color.c File Reference
#include "config.h"
#include "system.h"
#include "diagnostic-color.h"
Include dependency graph for diagnostic-color.c:

Data Structures

struct  color_cap

Functions

const char * colorize_start ()
const char * colorize_stop ()
static bool parse_gcc_colors ()
bool colorize_init ()
static bool should_colorize ()

Variables

static struct color_cap color_dict []

Function Documentation

bool colorize_init ( )
const char* colorize_stop ( )
static bool parse_gcc_colors ( )
static
Parse GCC_COLORS.  The default would look like:
   GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01'
   No character escaping is needed or supported.   

References free(), color_cap::free_val, getenv(), memcpy(), color_cap::name, color_cap::name_len, strlen(), and color_cap::val.

static bool should_colorize ( )
static
Return true if we should use color when in auto mode, false otherwise.  

References getenv().


Variable Documentation

struct color_cap color_dict[]
static
Initial value:
{
{ "error", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_RED), 5, false },
{ "warning", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_MAGENTA),
7, false },
{ "note", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_CYAN), 4, false },
{ "caret", SGR_SEQ (COLOR_BOLD COLOR_SEPARATOR COLOR_FG_GREEN), 5, false },
{ "locus", SGR_SEQ (COLOR_BOLD), 5, false },
{ "quote", SGR_SEQ (COLOR_BOLD), 5, false },
{ NULL, NULL, 0, false }
}
For GCC_COLORS.