summaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 56bbb0c..c1a3b10 100644
--- a/src/util.c
+++ b/src/util.c
@@ -353,6 +353,18 @@ char *util_get_data_dir(void)
}
/**
+ * Retrieves the cache directory path according to current used profile.
+ * Returned string must be freed.
+ */
+char *util_get_cache_dir(void)
+{
+ char *path = g_build_filename(g_get_user_cache_dir(), PROJECT, vb.profile, NULL);
+ create_dir_if_not_exists(path);
+
+ return path;
+}
+
+/**
* Retrieves the length bytes from given file.
*
* The memory of returned string have to be freed with g_free().