Move to kernel style SPDX license identifiers
[babeltrace.git] / src / plugins / text / details / colors.h
CommitLineData
55478183 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
55478183 3 *
0235b0db 4 * Copyright 2019 Philippe Proulx <pproulx@efficios.com>
55478183
PP
5 */
6
0235b0db
MJ
7#ifndef BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H
8#define BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H
9
55478183
PP
10#include "common/common.h"
11
12#include "write.h"
13
14static inline
15const char *color_reset(struct details_write_ctx *ctx)
16{
17 const char *code = "";
18
19 if (ctx->details_comp->cfg.with_color) {
04609487 20 code = bt_common_color_reset();
55478183
PP
21 }
22
23 return code;
24}
25
26static inline
27const char *color_bold(struct details_write_ctx *ctx)
28{
29 const char *code = "";
30
31 if (ctx->details_comp->cfg.with_color) {
04609487 32 code = bt_common_color_bold();
55478183
PP
33 }
34
35 return code;
36}
37
38static inline
39const char *color_fg_default(struct details_write_ctx *ctx)
40{
41 const char *code = "";
42
43 if (ctx->details_comp->cfg.with_color) {
04609487 44 code = bt_common_color_fg_default();
55478183
PP
45 }
46
47 return code;
48}
49
50static inline
51const char *color_fg_red(struct details_write_ctx *ctx)
52{
53 const char *code = "";
54
55 if (ctx->details_comp->cfg.with_color) {
04609487 56 code = bt_common_color_fg_red();
55478183
PP
57 }
58
59 return code;
60}
61
62static inline
63const char *color_fg_green(struct details_write_ctx *ctx)
64{
65 const char *code = "";
66
67 if (ctx->details_comp->cfg.with_color) {
04609487 68 code = bt_common_color_fg_green();
55478183
PP
69 }
70
71 return code;
72}
73
74static inline
75const char *color_fg_yellow(struct details_write_ctx *ctx)
76{
77 const char *code = "";
78
79 if (ctx->details_comp->cfg.with_color) {
04609487 80 code = bt_common_color_fg_yellow();
55478183
PP
81 }
82
83 return code;
84}
85
86static inline
87const char *color_fg_blue(struct details_write_ctx *ctx)
88{
89 const char *code = "";
90
91 if (ctx->details_comp->cfg.with_color) {
04609487 92 code = bt_common_color_fg_blue();
55478183
PP
93 }
94
95 return code;
96}
97
98static inline
99const char *color_fg_magenta(struct details_write_ctx *ctx)
100{
101 const char *code = "";
102
103 if (ctx->details_comp->cfg.with_color) {
04609487 104 code = bt_common_color_fg_magenta();
55478183
PP
105 }
106
107 return code;
108}
109
110static inline
111const char *color_fg_cyan(struct details_write_ctx *ctx)
112{
113 const char *code = "";
114
115 if (ctx->details_comp->cfg.with_color) {
04609487 116 code = bt_common_color_fg_cyan();
55478183
PP
117 }
118
119 return code;
120}
121
122static inline
123const char *color_fg_light_gray(struct details_write_ctx *ctx)
124{
125 const char *code = "";
126
127 if (ctx->details_comp->cfg.with_color) {
04609487
PP
128 code = bt_common_color_fg_light_gray();
129 }
130
131 return code;
132}
133
134static inline
135const char *color_fg_bright_red(struct details_write_ctx *ctx)
136{
137 const char *code = "";
138
139 if (ctx->details_comp->cfg.with_color) {
140 code = bt_common_color_fg_bright_red();
141 }
142
143 return code;
144}
145
146static inline
147const char *color_fg_bright_green(struct details_write_ctx *ctx)
148{
149 const char *code = "";
150
151 if (ctx->details_comp->cfg.with_color) {
152 code = bt_common_color_fg_bright_green();
153 }
154
155 return code;
156}
157
158static inline
159const char *color_fg_bright_yellow(struct details_write_ctx *ctx)
160{
161 const char *code = "";
162
163 if (ctx->details_comp->cfg.with_color) {
164 code = bt_common_color_fg_bright_yellow();
165 }
166
167 return code;
168}
169
170static inline
171const char *color_fg_bright_blue(struct details_write_ctx *ctx)
172{
173 const char *code = "";
174
175 if (ctx->details_comp->cfg.with_color) {
176 code = bt_common_color_fg_bright_blue();
177 }
178
179 return code;
180}
181
182static inline
183const char *color_fg_bright_magenta(struct details_write_ctx *ctx)
184{
185 const char *code = "";
186
187 if (ctx->details_comp->cfg.with_color) {
188 code = bt_common_color_fg_bright_magenta();
189 }
190
191 return code;
192}
193
194static inline
195const char *color_fg_bright_cyan(struct details_write_ctx *ctx)
196{
197 const char *code = "";
198
199 if (ctx->details_comp->cfg.with_color) {
200 code = bt_common_color_fg_bright_cyan();
201 }
202
203 return code;
204}
205
206static inline
207const char *color_fg_bright_light_gray(struct details_write_ctx *ctx)
208{
209 const char *code = "";
210
211 if (ctx->details_comp->cfg.with_color) {
212 code = bt_common_color_fg_bright_light_gray();
55478183
PP
213 }
214
215 return code;
216}
217
218static inline
219const char *color_bg_default(struct details_write_ctx *ctx)
220{
221 const char *code = "";
222
223 if (ctx->details_comp->cfg.with_color) {
04609487 224 code = bt_common_color_bg_default();
55478183
PP
225 }
226
227 return code;
228}
229
230static inline
231const char *color_bg_red(struct details_write_ctx *ctx)
232{
233 const char *code = "";
234
235 if (ctx->details_comp->cfg.with_color) {
04609487 236 code = bt_common_color_bg_red();
55478183
PP
237 }
238
239 return code;
240}
241
242static inline
243const char *color_bg_green(struct details_write_ctx *ctx)
244{
245 const char *code = "";
246
247 if (ctx->details_comp->cfg.with_color) {
04609487 248 code = bt_common_color_bg_green();
55478183
PP
249 }
250
251 return code;
252}
253
254static inline
255const char *color_bg_yellow(struct details_write_ctx *ctx)
256{
257 const char *code = "";
258
259 if (ctx->details_comp->cfg.with_color) {
04609487 260 code = bt_common_color_bg_yellow();
55478183
PP
261 }
262
263 return code;
264}
265
266static inline
267const char *color_bg_blue(struct details_write_ctx *ctx)
268{
269 const char *code = "";
270
271 if (ctx->details_comp->cfg.with_color) {
04609487 272 code = bt_common_color_bg_blue();
55478183
PP
273 }
274
275 return code;
276}
277
278static inline
279const char *color_bg_magenta(struct details_write_ctx *ctx)
280{
281 const char *code = "";
282
283 if (ctx->details_comp->cfg.with_color) {
04609487 284 code = bt_common_color_bg_magenta();
55478183
PP
285 }
286
287 return code;
288}
289
290static inline
291const char *color_bg_cyan(struct details_write_ctx *ctx)
292{
293 const char *code = "";
294
295 if (ctx->details_comp->cfg.with_color) {
04609487 296 code = bt_common_color_bg_cyan();
55478183
PP
297 }
298
299 return code;
300}
301
302static inline
303const char *color_bg_light_gray(struct details_write_ctx *ctx)
304{
305 const char *code = "";
306
307 if (ctx->details_comp->cfg.with_color) {
04609487 308 code = bt_common_color_bg_light_gray();
55478183
PP
309 }
310
311 return code;
312}
313
314#endif /* BABELTRACE_PLUGINS_TEXT_DETAILS_COLORS_H */
This page took 0.057751 seconds and 4 git commands to generate.