mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-28 05:50:06 +01:00
lib: add a function to return the XDG_CONFIG_DIR
This commit is contained in:
parent
6c3a8d2f83
commit
2e88a115d1
2 changed files with 19 additions and 0 deletions
16
lib/wp/wp.c
16
lib/wp/wp.c
|
|
@ -97,6 +97,22 @@ wp_get_xdg_state_dir (void)
|
|||
return xdg_dir;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the full path to the Wireplumber XDG_CONFIG_DIR subdirectory
|
||||
* \returns The XDG_CONFIG_DIR subdirectory
|
||||
*/
|
||||
const gchar *
|
||||
wp_get_xdg_config_dir (void)
|
||||
{
|
||||
static gchar xdg_dir[PATH_MAX] = {0};
|
||||
if (xdg_dir[0] == '\0') {
|
||||
g_autofree gchar *path = g_build_filename (g_get_user_config_dir (),
|
||||
"wireplumber", NULL);
|
||||
g_strlcpy (xdg_dir, path, sizeof (xdg_dir));
|
||||
}
|
||||
return xdg_dir;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Gets the Wireplumber configuration directory
|
||||
* \returns The Wireplumber configuration directory
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ const gchar * wp_get_module_dir (void);
|
|||
WP_API
|
||||
const gchar * wp_get_xdg_state_dir (void);
|
||||
|
||||
WP_API
|
||||
const gchar * wp_get_xdg_config_dir (void);
|
||||
|
||||
WP_API
|
||||
const gchar * wp_get_config_dir (void);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue