[pulseaudio-discuss] [PATCH 8/9] core-util: Add pa_append_to_config_home_dir()

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sun Jun 8 06:33:00 PDT 2014


---
 src/pulsecore/core-util.c | 16 ++++++++++++++++
 src/pulsecore/core-util.h |  1 +
 2 files changed, 17 insertions(+)

diff --git a/src/pulsecore/core-util.c b/src/pulsecore/core-util.c
index 1852b1c..1f902f4 100644
--- a/src/pulsecore/core-util.c
+++ b/src/pulsecore/core-util.c
@@ -1678,6 +1678,22 @@ int pa_get_config_home_dir(char **_r) {
     return 0;
 }
 
+int pa_append_to_config_home_dir(const char *path, char **_r) {
+    int r;
+    char *config_home_dir;
+
+    pa_assert(path);
+    pa_assert(_r);
+
+    r = pa_get_config_home_dir(&config_home_dir);
+    if (r < 0)
+        return r;
+
+    *_r = pa_sprintf_malloc("%s" PA_PATH_SEP "%s", config_home_dir, path);
+    pa_xfree(config_home_dir);
+    return 0;
+}
+
 char *pa_get_binary_name_malloc(void) {
     char *t;
     size_t allocated = 128;
diff --git a/src/pulsecore/core-util.h b/src/pulsecore/core-util.h
index d2ab771..d717299 100644
--- a/src/pulsecore/core-util.h
+++ b/src/pulsecore/core-util.h
@@ -140,6 +140,7 @@ char *pa_get_state_dir(void);
 char *pa_get_home_dir_malloc(void);
 int pa_append_to_home_dir(const char *path, char **_r);
 int pa_get_config_home_dir(char **_r);
+int pa_append_to_config_home_dir(const char *path, char **_r);
 char *pa_get_binary_name_malloc(void);
 char *pa_runtime_path(const char *fn);
 char *pa_state_path(const char *fn, bool prepend_machine_id);
-- 
1.9.3



More information about the pulseaudio-discuss mailing list