GCC Middle and Back End API Reference
|
#include "config.h"
#include "system.h"
#include "diagnostic-color.h"
#include "diagnostic-url.h"
#include "color-macros.h"
Data Structures | |
struct | color_cap |
Functions | |
const char * | colorize_start (bool show_color, const char *name, size_t name_len) |
const char * | colorize_stop (bool show_color) |
static bool | parse_gcc_colors (void) |
static bool | should_colorize (void) |
bool | colorize_init (diagnostic_color_rule_t rule) |
static diagnostic_url_format | parse_env_vars_for_urls () |
static bool | auto_enable_urls () |
diagnostic_url_format | determine_url_format (diagnostic_url_rule_t rule) |
Variables | |
static struct color_cap | color_dict [] |
Return true if we should use urls when in auto mode, false otherwise.
References ggc_alloc(), and should_colorize().
Referenced by determine_url_format().
bool colorize_init | ( | diagnostic_color_rule_t | rule | ) |
References DIAGNOSTICS_COLOR_AUTO, DIAGNOSTICS_COLOR_NO, DIAGNOSTICS_COLOR_YES, gcc_unreachable, parse_gcc_colors(), and should_colorize().
Referenced by diagnostic_context::color_init().
References color_dict, ggc_alloc(), color_cap::name, color_cap::name_len, NULL, and color_cap::val.
Referenced by colorize_start(), diagnostic_build_prefix(), file_name_as_prefix(), diagnostic_context::get_location_text(), pp_begin_quote(), pp_format(), diagnostic_context::print_any_cwe(), diagnostic_context::print_any_rules(), edited_file::print_diff(), edited_file::print_diff_hunk(), diagnostic_context::print_option_information(), and edited_file::print_run_of_changed_lines().
References SGR_RESET.
Referenced by diagnostic_build_prefix(), file_name_as_prefix(), diagnostic_context::get_location_text(), pp_end_quote(), pp_format(), diagnostic_context::print_any_cwe(), diagnostic_context::print_any_rules(), edited_file::print_diff(), edited_file::print_diff_hunk(), diagnostic_context::print_option_information(), and edited_file::print_run_of_changed_lines().
diagnostic_url_format determine_url_format | ( | diagnostic_url_rule_t | rule | ) |
Determine if URLs should be enabled, based on RULE, and, if so, which format to use. This reuses the logic for colorization.
References auto_enable_urls(), DIAGNOSTICS_URL_AUTO, DIAGNOSTICS_URL_NO, DIAGNOSTICS_URL_YES, gcc_unreachable, parse_env_vars_for_urls(), and URL_FORMAT_NONE.
Referenced by diagnostic_context::urls_init().
|
static |
Return URL_FORMAT_XXX which tells how we should emit urls when in always mode. We use GCC_URLS and if that is not defined TERM_URLS. If neither is defined the feature is enabled by default.
References ggc_alloc(), NULL, URL_FORMAT_BEL, URL_FORMAT_DEFAULT, URL_FORMAT_NONE, and URL_FORMAT_ST.
Referenced by determine_url_format().
Parse GCC_COLORS. The default would look like: GCC_COLORS='error=01;31:warning=01;35:note=01;36:\ range1=32:range2=34:locus=01:quote=01:path=01;36:\ fixit-insert=32:fixit-delete=31:'\ diff-filename=01:diff-hunk=32:diff-delete=31:diff-insert=32:\ type-diff=01;32' No character escaping is needed or supported.
References b, color_dict, CONST_CAST, free(), color_cap::free_val, ggc_alloc(), color_cap::name, color_cap::name_len, NULL, SGR_END, SGR_SEQ, SGR_START, and color_cap::val.
Referenced by colorize_init().
Return true if we should use color when in auto mode, false otherwise.
References ggc_alloc(), NULL, and STDERR_FILENO.
Referenced by auto_enable_urls(), and colorize_init().
For GCC_COLORS.
Referenced by colorize_start(), and parse_gcc_colors().