annotate gcc/diagnostic-color.h @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 1830386684a0
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
1 /* Copyright (C) 2013-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
2 Contributed by Manuel Lopez-Ibanez <manu@gcc.gnu.org>
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 This file is part of GCC.
kono
parents:
diff changeset
5
kono
parents:
diff changeset
6 GCC is free software; you can redistribute it and/or modify it under
kono
parents:
diff changeset
7 the terms of the GNU General Public License as published by the Free
kono
parents:
diff changeset
8 Software Foundation; either version 3, or (at your option) any later
kono
parents:
diff changeset
9 version.
kono
parents:
diff changeset
10
kono
parents:
diff changeset
11 GCC is distributed in the hope that it will be useful, but WITHOUT ANY
kono
parents:
diff changeset
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
kono
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
kono
parents:
diff changeset
14 for more details.
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
17 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
18 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
19
kono
parents:
diff changeset
20 /* Based on code from: */
kono
parents:
diff changeset
21 /* grep.c - main driver file for grep.
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
22 Copyright (C) 1992-2020 Free Software Foundation, Inc.
111
kono
parents:
diff changeset
23
kono
parents:
diff changeset
24 This program is free software; you can redistribute it and/or modify
kono
parents:
diff changeset
25 it under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
26 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
27 any later version.
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 This program is distributed in the hope that it will be useful,
kono
parents:
diff changeset
30 but WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
31 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
kono
parents:
diff changeset
32 GNU General Public License for more details.
kono
parents:
diff changeset
33
kono
parents:
diff changeset
34 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
35 along with this program; if not, write to the Free Software
kono
parents:
diff changeset
36 Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
kono
parents:
diff changeset
37 02110-1301, USA.
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 Written July 1992 by Mike Haertel. */
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 #ifndef GCC_DIAGNOSTIC_COLOR_H
kono
parents:
diff changeset
42 #define GCC_DIAGNOSTIC_COLOR_H
kono
parents:
diff changeset
43
kono
parents:
diff changeset
44 /* Whether to add color to diagnostics:
kono
parents:
diff changeset
45 o DIAGNOSTICS_COLOR_NO: never
kono
parents:
diff changeset
46 o DIAGNOSTICS_COLOR_YES: always
kono
parents:
diff changeset
47 o DIAGNOSTICS_COLOR_AUTO: depending on the output stream. */
kono
parents:
diff changeset
48 typedef enum
kono
parents:
diff changeset
49 {
kono
parents:
diff changeset
50 DIAGNOSTICS_COLOR_NO = 0,
kono
parents:
diff changeset
51 DIAGNOSTICS_COLOR_YES = 1,
kono
parents:
diff changeset
52 DIAGNOSTICS_COLOR_AUTO = 2
kono
parents:
diff changeset
53 } diagnostic_color_rule_t;
kono
parents:
diff changeset
54
kono
parents:
diff changeset
55 const char *colorize_start (bool, const char *, size_t);
kono
parents:
diff changeset
56 const char *colorize_stop (bool);
kono
parents:
diff changeset
57 bool colorize_init (diagnostic_color_rule_t);
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 inline const char *
kono
parents:
diff changeset
60 colorize_start (bool show_color, const char *name)
kono
parents:
diff changeset
61 {
kono
parents:
diff changeset
62 return colorize_start (show_color, name, strlen (name));
kono
parents:
diff changeset
63 }
kono
parents:
diff changeset
64
kono
parents:
diff changeset
65 #endif /* ! GCC_DIAGNOSTIC_COLOR_H */