/* The compiled form of ansi_regex_text. */
-static regex_t ansi_regex;
+static compiled_regex ansi_regex (ansi_regex_text, REG_EXTENDED,
+ _("Error in ANSI terminal escape sequences regex"));
/* This maps 8-color palette to RGB triples. The values come from
plain linux terminal. */
{
regmatch_t subexps[NUM_SUBEXPRESSIONS];
- int match = regexec (&ansi_regex, buf, ARRAY_SIZE (subexps), subexps, 0);
+ int match = ansi_regex.exec (buf, ARRAY_SIZE (subexps), subexps, 0);
if (match == REG_NOMATCH)
{
*n_read = 0;
{
regmatch_t subexps[NUM_SUBEXPRESSIONS];
- int match = regexec (&ansi_regex, buf, ARRAY_SIZE (subexps), subexps, 0);
+ int match = ansi_regex.exec (buf, ARRAY_SIZE (subexps), subexps, 0);
if (match == REG_NOMATCH || buf[subexps[FINAL_SUBEXP].rm_so] != 'm')
return false;
return true;
}
-void _initialize_ui_style ();
-void
-_initialize_ui_style ()
-{
- int code = regcomp (&ansi_regex, ansi_regex_text, REG_EXTENDED);
- /* If the regular expression was incorrect, it was a programming
- error. */
- gdb_assert (code == 0);
-}
-
/* See ui-style.h. */
const std::vector<color_space> &