GCC Middle and Back End API Reference
diagnostic-color.h
Go to the documentation of this file.
1 /* Copyright (C) 2013 Free Software Foundation, Inc.
2  Contributed by Manuel Lopez-Ibanez <manu@gcc.gnu.org>
3 
4 This file is part of GCC.
5 
6 GCC is free software; you can redistribute it and/or modify it under
7 the terms of the GNU General Public License as published by the Free
8 Software Foundation; either version 3, or (at your option) any later
9 version.
10 
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 for more details.
15 
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19 
20 /* Based on code from: */
21 /* grep.c - main driver file for grep.
22  Copyright (C) 1992, 1997-2002, 2004-2013 Free Software Foundation, Inc.
23 
24  This program is free software; you can redistribute it and/or modify
25  it under the terms of the GNU General Public License as published by
26  the Free Software Foundation; either version 3, or (at your option)
27  any later version.
28 
29  This program is distributed in the hope that it will be useful,
30  but WITHOUT ANY WARRANTY; without even the implied warranty of
31  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32  GNU General Public License for more details.
33 
34  You should have received a copy of the GNU General Public License
35  along with this program; if not, write to the Free Software
36  Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
37  02110-1301, USA.
38 
39  Written July 1992 by Mike Haertel. */
40 
41 #ifndef GCC_DIAGNOSTIC_COLOR_H
42 #define GCC_DIAGNOSTIC_COLOR_H
43 
44 /* How often diagnostics are prefixed by their locations:
45  o DIAGNOSTICS_SHOW_PREFIX_NEVER: never - not yet supported;
46  o DIAGNOSTICS_SHOW_PREFIX_ONCE: emit only once;
47  o DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE: emit each time a physical
48  line is started. */
49 typedef enum
50 {
55 
56 const char *colorize_start (bool, const char *, size_t);
57 const char *colorize_stop (bool);
59 
60 inline const char *
61 colorize_start (bool show_color, const char *name)
62 {
63  return colorize_start (show_color, name, strlen (name));
64 }
65 
66 #endif /* ! GCC_DIAGNOSTIC_COLOR_H */