1 #ifndef BABELTRACE_COMMON_INTERNAL_H
2 #define BABELTRACE_COMMON_INTERNAL_H
4 #include <babeltrace/babeltrace-internal.h>
6 #define BT_COMMON_COLOR_RESET "\033[0m"
7 #define BT_COMMON_COLOR_BOLD "\033[1m"
8 #define BT_COMMON_COLOR_FG_DEFAULT "\033[39m"
9 #define BT_COMMON_COLOR_FG_RED "\033[31m"
10 #define BT_COMMON_COLOR_FG_GREEN "\033[32m"
11 #define BT_COMMON_COLOR_FG_YELLOW "\033[33m"
12 #define BT_COMMON_COLOR_FG_BLUE "\033[34m"
13 #define BT_COMMON_COLOR_FG_MAGENTA "\033[35m"
14 #define BT_COMMON_COLOR_FG_CYAN "\033[36m"
15 #define BT_COMMON_COLOR_FG_LIGHT_GRAY "\033[37m"
16 #define BT_COMMON_COLOR_BG_DEFAULT "\033[49m"
17 #define BT_COMMON_COLOR_BG_RED "\033[41m"
18 #define BT_COMMON_COLOR_BG_GREEN "\033[42m"
19 #define BT_COMMON_COLOR_BG_YELLOW "\033[43m"
20 #define BT_COMMON_COLOR_BG_BLUE "\033[44m"
21 #define BT_COMMON_COLOR_BG_MAGENTA "\033[45m"
22 #define BT_COMMON_COLOR_BG_CYAN "\033[46m"
23 #define BT_COMMON_COLOR_BG_LIGHT_GRAY "\033[47m"
25 struct bt_common_lttng_live_url_parts
{
28 GString
*target_hostname
;
29 GString
*session_name
;
31 /* -1 means default port */
36 bool bt_common_is_setuid_setgid(void);
39 const char *bt_common_get_system_plugin_path(void);
42 char *bt_common_get_home_plugin_path(void);
45 int bt_common_append_plugin_path_dirs(const char *paths
, GPtrArray
*dirs
);
48 bool bt_common_colors_supported(void);
51 const char *bt_common_color_reset(void);
54 const char *bt_common_color_bold(void);
57 const char *bt_common_color_fg_default(void);
60 const char *bt_common_color_fg_red(void);
63 const char *bt_common_color_fg_green(void);
66 const char *bt_common_color_fg_yellow(void);
69 const char *bt_common_color_fg_blue(void);
72 const char *bt_common_color_fg_magenta(void);
75 const char *bt_common_color_fg_cyan(void);
78 const char *bt_common_color_fg_light_gray(void);
81 const char *bt_common_color_bg_default(void);
84 const char *bt_common_color_bg_red(void);
87 const char *bt_common_color_bg_green(void);
90 const char *bt_common_color_bg_yellow(void);
93 const char *bt_common_color_bg_blue(void);
96 const char *bt_common_color_bg_magenta(void);
99 const char *bt_common_color_bg_cyan(void);
102 const char *bt_common_color_bg_light_gray(void);
105 GString
*bt_common_string_until(const char *input
, const char *escapable_chars
,
106 const char *end_chars
, size_t *end_pos
);
109 GString
*bt_common_shell_quote(const char *input
);
112 bool bt_common_string_is_printable(const char *input
);
115 void bt_common_destroy_lttng_live_url_parts(
116 struct bt_common_lttng_live_url_parts
*parts
);
119 struct bt_common_lttng_live_url_parts
bt_common_parse_lttng_live_url(
120 const char *url
, char *error_buf
, size_t error_buf_size
);
122 #endif /* BABELTRACE_COMMON_INTERNAL_H */