1 #ifndef BABELTRACE_COMMON_INTERNAL_H
2 #define BABELTRACE_COMMON_INTERNAL_H
5 #include <babeltrace/babeltrace-internal.h>
7 #define BT_COMMON_COLOR_RESET "\033[0m"
8 #define BT_COMMON_COLOR_BOLD "\033[1m"
9 #define BT_COMMON_COLOR_FG_DEFAULT "\033[39m"
10 #define BT_COMMON_COLOR_FG_RED "\033[31m"
11 #define BT_COMMON_COLOR_FG_GREEN "\033[32m"
12 #define BT_COMMON_COLOR_FG_YELLOW "\033[33m"
13 #define BT_COMMON_COLOR_FG_BLUE "\033[34m"
14 #define BT_COMMON_COLOR_FG_MAGENTA "\033[35m"
15 #define BT_COMMON_COLOR_FG_CYAN "\033[36m"
16 #define BT_COMMON_COLOR_FG_LIGHT_GRAY "\033[37m"
17 #define BT_COMMON_COLOR_BG_DEFAULT "\033[49m"
18 #define BT_COMMON_COLOR_BG_RED "\033[41m"
19 #define BT_COMMON_COLOR_BG_GREEN "\033[42m"
20 #define BT_COMMON_COLOR_BG_YELLOW "\033[43m"
21 #define BT_COMMON_COLOR_BG_BLUE "\033[44m"
22 #define BT_COMMON_COLOR_BG_MAGENTA "\033[45m"
23 #define BT_COMMON_COLOR_BG_CYAN "\033[46m"
24 #define BT_COMMON_COLOR_BG_LIGHT_GRAY "\033[47m"
26 struct bt_common_lttng_live_url_parts
{
29 GString
*target_hostname
;
30 GString
*session_name
;
32 /* -1 means default port */
37 bool bt_common_is_setuid_setgid(void);
40 const char *bt_common_get_system_plugin_path(void);
43 char *bt_common_get_home_plugin_path(void);
46 int bt_common_append_plugin_path_dirs(const char *paths
, GPtrArray
*dirs
);
49 bool bt_common_colors_supported(void);
52 const char *bt_common_color_reset(void);
55 const char *bt_common_color_bold(void);
58 const char *bt_common_color_fg_default(void);
61 const char *bt_common_color_fg_red(void);
64 const char *bt_common_color_fg_green(void);
67 const char *bt_common_color_fg_yellow(void);
70 const char *bt_common_color_fg_blue(void);
73 const char *bt_common_color_fg_magenta(void);
76 const char *bt_common_color_fg_cyan(void);
79 const char *bt_common_color_fg_light_gray(void);
82 const char *bt_common_color_bg_default(void);
85 const char *bt_common_color_bg_red(void);
88 const char *bt_common_color_bg_green(void);
91 const char *bt_common_color_bg_yellow(void);
94 const char *bt_common_color_bg_blue(void);
97 const char *bt_common_color_bg_magenta(void);
100 const char *bt_common_color_bg_cyan(void);
103 const char *bt_common_color_bg_light_gray(void);
106 GString
*bt_common_string_until(const char *input
, const char *escapable_chars
,
107 const char *end_chars
, size_t *end_pos
);
110 GString
*bt_common_shell_quote(const char *input
, bool with_single_quotes
);
113 bool bt_common_string_is_printable(const char *input
);
116 void bt_common_destroy_lttng_live_url_parts(
117 struct bt_common_lttng_live_url_parts
*parts
);
120 struct bt_common_lttng_live_url_parts
bt_common_parse_lttng_live_url(
121 const char *url
, char *error_buf
, size_t error_buf_size
);
124 void bt_common_normalize_star_glob_pattern(char *pattern
);
127 bool bt_common_star_glob_match(const char *pattern
, size_t pattern_len
,
128 const char *candidate
, size_t candidate_len
);
130 #endif /* BABELTRACE_COMMON_INTERNAL_H */