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_start ( )

Referenced by diagnostic_build_prefix().

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.  
     From now on, be well-formed or you're gone.  
           Empty name without val (empty cap)
           won't match and will be ignored.  
           If name unknown, go on for forward compatibility.  

References free(), color_cap::free_val, 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. 

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.