Fix CLI to work with multiple ports and dynamically added ports
[babeltrace.git] / include / babeltrace / common-internal.h
1 #ifndef BABELTRACE_COMMON_INTERNAL_H
2 #define BABELTRACE_COMMON_INTERNAL_H
3
4 #include <babeltrace/babeltrace-internal.h>
5
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"
24
25 struct bt_common_lttng_live_url_parts {
26 GString *proto;
27 GString *hostname;
28 GString *target_hostname;
29 GString *session_name;
30
31 /* -1 means default port */
32 int port;
33 };
34
35 BT_HIDDEN
36 bool bt_common_is_setuid_setgid(void);
37
38 BT_HIDDEN
39 const char *bt_common_get_system_plugin_path(void);
40
41 BT_HIDDEN
42 char *bt_common_get_home_plugin_path(void);
43
44 BT_HIDDEN
45 int bt_common_append_plugin_path_dirs(const char *paths, GPtrArray *dirs);
46
47 BT_HIDDEN
48 bool bt_common_colors_supported(void);
49
50 BT_HIDDEN
51 const char *bt_common_color_reset(void);
52
53 BT_HIDDEN
54 const char *bt_common_color_bold(void);
55
56 BT_HIDDEN
57 const char *bt_common_color_fg_default(void);
58
59 BT_HIDDEN
60 const char *bt_common_color_fg_red(void);
61
62 BT_HIDDEN
63 const char *bt_common_color_fg_green(void);
64
65 BT_HIDDEN
66 const char *bt_common_color_fg_yellow(void);
67
68 BT_HIDDEN
69 const char *bt_common_color_fg_blue(void);
70
71 BT_HIDDEN
72 const char *bt_common_color_fg_magenta(void);
73
74 BT_HIDDEN
75 const char *bt_common_color_fg_cyan(void);
76
77 BT_HIDDEN
78 const char *bt_common_color_fg_light_gray(void);
79
80 BT_HIDDEN
81 const char *bt_common_color_bg_default(void);
82
83 BT_HIDDEN
84 const char *bt_common_color_bg_red(void);
85
86 BT_HIDDEN
87 const char *bt_common_color_bg_green(void);
88
89 BT_HIDDEN
90 const char *bt_common_color_bg_yellow(void);
91
92 BT_HIDDEN
93 const char *bt_common_color_bg_blue(void);
94
95 BT_HIDDEN
96 const char *bt_common_color_bg_magenta(void);
97
98 BT_HIDDEN
99 const char *bt_common_color_bg_cyan(void);
100
101 BT_HIDDEN
102 const char *bt_common_color_bg_light_gray(void);
103
104 BT_HIDDEN
105 GString *bt_common_string_until(const char *input, const char *escapable_chars,
106 const char *end_chars, size_t *end_pos);
107
108 BT_HIDDEN
109 GString *bt_common_shell_quote(const char *input, bool with_single_quotes);
110
111 BT_HIDDEN
112 bool bt_common_string_is_printable(const char *input);
113
114 BT_HIDDEN
115 void bt_common_destroy_lttng_live_url_parts(
116 struct bt_common_lttng_live_url_parts *parts);
117
118 BT_HIDDEN
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);
121
122 BT_HIDDEN
123 void bt_common_normalize_star_glob_pattern(char *pattern);
124
125 BT_HIDDEN
126 bool bt_common_star_glob_match(const char *pattern, size_t pattern_len,
127 const char *candidate, size_t candidate_len);
128
129 #endif /* BABELTRACE_COMMON_INTERNAL_H */
This page took 0.033067 seconds and 5 git commands to generate.