summaryrefslogtreecommitdiff
path: root/minecctl/misc.h
blob: 02c01eae25fd9050c03c11f7e1accac8b42dcab3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef foomischfoo
#define foomischfoo

int open_subdir(int dfd, const char *subdir, bool nofail);

int open_xdg_dir(const char *envname, const char *altpath, bool nofail);

static inline int open_xdg_data_dir(bool nofail)
{
	return open_xdg_dir("XDG_DATA_HOME", ".local/share", nofail);
}

static inline int open_xdg_cfg_dir(bool nofail)
{
	return open_xdg_dir("XDG_CONFIG_HOME", ".config", nofail);
}

void set_use_colors();

char **strv_copy(char *const *strv);

char **strv_from_strs(const char *first, ...);

char *strv_join(char *const *strv);

void strv_free(char **strv);

int connect_any(struct list_head *addrs, struct saddr **rsaddr,
		const char **error);

char *ask_password();

#endif