183828Sdfr/* Copyright (C) 2013-2015 Free Software Foundation, Inc.
283828Sdfr   Contributed by Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3164010Smarcel
483828SdfrThis file is part of GCC.
583828Sdfr
683828SdfrGCC is free software; you can redistribute it and/or modify it under
783828Sdfrthe terms of the GNU General Public License as published by the Free
883828SdfrSoftware Foundation; either version 3, or (at your option) any later
983828Sdfrversion.
1083828Sdfr
1183828SdfrGCC is distributed in the hope that it will be useful, but WITHOUT ANY
1283828SdfrWARRANTY; without even the implied warranty of MERCHANTABILITY or
1383828SdfrFITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
1483828Sdfrfor more details.
1583828Sdfr
1683828SdfrYou should have received a copy of the GNU General Public License
1783828Sdfralong with GCC; see the file COPYING3.  If not see
1883828Sdfr<http://www.gnu.org/licenses/>.  */
1983828Sdfr
2083828Sdfr/* Based on code from: */
2183828Sdfr/* grep.c - main driver file for grep.
2283828Sdfr   Copyright (C) 1992-2015 Free Software Foundation, Inc.
2383828Sdfr
2483828Sdfr   This program is free software; you can redistribute it and/or modify
2583828Sdfr   it under the terms of the GNU General Public License as published by
2683828Sdfr   the Free Software Foundation; either version 3, or (at your option)
2783828Sdfr   any later version.
28124140Sobrien
29124140Sobrien   This program is distributed in the hope that it will be useful,
30124140Sobrien   but WITHOUT ANY WARRANTY; without even the implied warranty of
3183828Sdfr   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
3283828Sdfr   GNU General Public License for more details.
3383828Sdfr
3483828Sdfr   You should have received a copy of the GNU General Public License
3583828Sdfr   along with this program; if not, write to the Free Software
3683828Sdfr   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
3783828Sdfr   02110-1301, USA.
3883828Sdfr
39164010Smarcel   Written July 1992 by Mike Haertel.  */
40164010Smarcel
4183828Sdfr#ifndef GCC_DIAGNOSTIC_COLOR_H
4283828Sdfr#define GCC_DIAGNOSTIC_COLOR_H
4383828Sdfr
44164010Smarcel/* Whether to add color to diagnostics:
4583828Sdfr   o DIAGNOSTICS_COLOR_NO: never
46164010Smarcel   o DIAGNOSTICS_COLOR_YES: always
47164010Smarcel   o DIAGNOSTICS_COLOR_AUTO: depending on the output stream.  */
48164010Smarceltypedef enum
49164010Smarcel{
50164010Smarcel  DIAGNOSTICS_COLOR_NO       = 0,
51164010Smarcel  DIAGNOSTICS_COLOR_YES      = 1,
52164010Smarcel  DIAGNOSTICS_COLOR_AUTO     = 2
53292625Semaste} diagnostic_color_rule_t;
54164010Smarcel
55164010Smarcelconst char *colorize_start (bool, const char *, size_t);
56164010Smarcelconst char *colorize_stop (bool);
57164010Smarcelbool colorize_init (diagnostic_color_rule_t);
58164010Smarcel
59164010Smarcelinline const char *
60164010Smarcelcolorize_start (bool show_color, const char *name)
61164010Smarcel{
62164010Smarcel  return colorize_start (show_color, name, strlen (name));
63164010Smarcel}
64164010Smarcel
6593409Smarcel#endif /* ! GCC_DIAGNOSTIC_COLOR_H */
6693409Smarcel