Fix: src.ctf.fs: initialize the other_entry variable
[babeltrace.git] / src / plugins / text / details / colors.h
CommitLineData
55478183
PP
1#ifndef BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H
2#define BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H
3
4/*
5 * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a copy
8 * of this software and associated documentation files (the "Software"), to deal
9 * in the Software without restriction, including without limitation the rights
10 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 * copies of the Software, and to permit persons to whom the Software is
12 * furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be included in
15 * all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE.
24 */
25
26#include "common/common.h"
27
28#include "write.h"
29
30static inline
31const char *color_reset(struct details_write_ctx *ctx)
32{
33 const char *code = "";
34
35 if (ctx->details_comp->cfg.with_color) {
04609487 36 code = bt_common_color_reset();
55478183
PP
37 }
38
39 return code;
40}
41
42static inline
43const char *color_bold(struct details_write_ctx *ctx)
44{
45 const char *code = "";
46
47 if (ctx->details_comp->cfg.with_color) {
04609487 48 code = bt_common_color_bold();
55478183
PP
49 }
50
51 return code;
52}
53
54static inline
55const char *color_fg_default(struct details_write_ctx *ctx)
56{
57 const char *code = "";
58
59 if (ctx->details_comp->cfg.with_color) {
04609487 60 code = bt_common_color_fg_default();
55478183
PP
61 }
62
63 return code;
64}
65
66static inline
67const char *color_fg_red(struct details_write_ctx *ctx)
68{
69 const char *code = "";
70
71 if (ctx->details_comp->cfg.with_color) {
04609487 72 code = bt_common_color_fg_red();
55478183
PP
73 }
74
75 return code;
76}
77
78static inline
79const char *color_fg_green(struct details_write_ctx *ctx)
80{
81 const char *code = "";
82
83 if (ctx->details_comp->cfg.with_color) {
04609487 84 code = bt_common_color_fg_green();
55478183
PP
85 }
86
87 return code;
88}
89
90static inline
91const char *color_fg_yellow(struct details_write_ctx *ctx)
92{
93 const char *code = "";
94
95 if (ctx->details_comp->cfg.with_color) {
04609487 96 code = bt_common_color_fg_yellow();
55478183
PP
97 }
98
99 return code;
100}
101
102static inline
103const char *color_fg_blue(struct details_write_ctx *ctx)
104{
105 const char *code = "";
106
107 if (ctx->details_comp->cfg.with_color) {
04609487 108 code = bt_common_color_fg_blue();
55478183
PP
109 }
110
111 return code;
112}
113
114static inline
115const char *color_fg_magenta(struct details_write_ctx *ctx)
116{
117 const char *code = "";
118
119 if (ctx->details_comp->cfg.with_color) {
04609487 120 code = bt_common_color_fg_magenta();
55478183
PP
121 }
122
123 return code;
124}
125
126static inline
127const char *color_fg_cyan(struct details_write_ctx *ctx)
128{
129 const char *code = "";
130
131 if (ctx->details_comp->cfg.with_color) {
04609487 132 code = bt_common_color_fg_cyan();
55478183
PP
133 }
134
135 return code;
136}
137
138static inline
139const char *color_fg_light_gray(struct details_write_ctx *ctx)
140{
141 const char *code = "";
142
143 if (ctx->details_comp->cfg.with_color) {
04609487
PP
144 code = bt_common_color_fg_light_gray();
145 }
146
147 return code;
148}
149
150static inline
151const char *color_fg_bright_red(struct details_write_ctx *ctx)
152{
153 const char *code = "";
154
155 if (ctx->details_comp->cfg.with_color) {
156 code = bt_common_color_fg_bright_red();
157 }
158
159 return code;
160}
161
162static inline
163const char *color_fg_bright_green(struct details_write_ctx *ctx)
164{
165 const char *code = "";
166
167 if (ctx->details_comp->cfg.with_color) {
168 code = bt_common_color_fg_bright_green();
169 }
170
171 return code;
172}
173
174static inline
175const char *color_fg_bright_yellow(struct details_write_ctx *ctx)
176{
177 const char *code = "";
178
179 if (ctx->details_comp->cfg.with_color) {
180 code = bt_common_color_fg_bright_yellow();
181 }
182
183 return code;
184}
185
186static inline
187const char *color_fg_bright_blue(struct details_write_ctx *ctx)
188{
189 const char *code = "";
190
191 if (ctx->details_comp->cfg.with_color) {
192 code = bt_common_color_fg_bright_blue();
193 }
194
195 return code;
196}
197
198static inline
199const char *color_fg_bright_magenta(struct details_write_ctx *ctx)
200{
201 const char *code = "";
202
203 if (ctx->details_comp->cfg.with_color) {
204 code = bt_common_color_fg_bright_magenta();
205 }
206
207 return code;
208}
209
210static inline
211const char *color_fg_bright_cyan(struct details_write_ctx *ctx)
212{
213 const char *code = "";
214
215 if (ctx->details_comp->cfg.with_color) {
216 code = bt_common_color_fg_bright_cyan();
217 }
218
219 return code;
220}
221
222static inline
223const char *color_fg_bright_light_gray(struct details_write_ctx *ctx)
224{
225 const char *code = "";
226
227 if (ctx->details_comp->cfg.with_color) {
228 code = bt_common_color_fg_bright_light_gray();
55478183
PP
229 }
230
231 return code;
232}
233
234static inline
235const char *color_bg_default(struct details_write_ctx *ctx)
236{
237 const char *code = "";
238
239 if (ctx->details_comp->cfg.with_color) {
04609487 240 code = bt_common_color_bg_default();
55478183
PP
241 }
242
243 return code;
244}
245
246static inline
247const char *color_bg_red(struct details_write_ctx *ctx)
248{
249 const char *code = "";
250
251 if (ctx->details_comp->cfg.with_color) {
04609487 252 code = bt_common_color_bg_red();
55478183
PP
253 }
254
255 return code;
256}
257
258static inline
259const char *color_bg_green(struct details_write_ctx *ctx)
260{
261 const char *code = "";
262
263 if (ctx->details_comp->cfg.with_color) {
04609487 264 code = bt_common_color_bg_green();
55478183
PP
265 }
266
267 return code;
268}
269
270static inline
271const char *color_bg_yellow(struct details_write_ctx *ctx)
272{
273 const char *code = "";
274
275 if (ctx->details_comp->cfg.with_color) {
04609487 276 code = bt_common_color_bg_yellow();
55478183
PP
277 }
278
279 return code;
280}
281
282static inline
283const char *color_bg_blue(struct details_write_ctx *ctx)
284{
285 const char *code = "";
286
287 if (ctx->details_comp->cfg.with_color) {
04609487 288 code = bt_common_color_bg_blue();
55478183
PP
289 }
290
291 return code;
292}
293
294static inline
295const char *color_bg_magenta(struct details_write_ctx *ctx)
296{
297 const char *code = "";
298
299 if (ctx->details_comp->cfg.with_color) {
04609487 300 code = bt_common_color_bg_magenta();
55478183
PP
301 }
302
303 return code;
304}
305
306static inline
307const char *color_bg_cyan(struct details_write_ctx *ctx)
308{
309 const char *code = "";
310
311 if (ctx->details_comp->cfg.with_color) {
04609487 312 code = bt_common_color_bg_cyan();
55478183
PP
313 }
314
315 return code;
316}
317
318static inline
319const char *color_bg_light_gray(struct details_write_ctx *ctx)
320{
321 const char *code = "";
322
323 if (ctx->details_comp->cfg.with_color) {
04609487 324 code = bt_common_color_bg_light_gray();
55478183
PP
325 }
326
327 return code;
328}
329
330#endif /* BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H */
This page took 0.057577 seconds and 4 git commands to generate.