summaryrefslogtreecommitdiff
path: root/src/utils.c
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-06-19 23:17:58 +0200
committerHannes Schulze <haschu0103@outlook.de>2025-06-19 23:17:58 +0200
commit1af3d14f3f995645a0de08a54b244c19840709e9 (patch)
tree3c4098863d8a8fd004a2acc8912a23b6036ab4dd /src/utils.c
parent40efcf60a5f39674b5137f11de7bcfe37fb121b5 (diff)
init hs project
Diffstat (limited to 'src/utils.c')
-rw-r--r--src/utils.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/src/utils.c b/src/utils.c
deleted file mode 100644
index dae3e65..0000000
--- a/src/utils.c
+++ /dev/null
@@ -1,25 +0,0 @@
-#include "utils.h"
-#include <gio/gio.h>
-
-//
-// Return the path for a file in the user's XDG cache directory. The result should be freed using g_free.
-//
-// This will also ensure that the application's cache directory exists.
-//
-gchar* foobar_get_cache_path( gchar const* filename )
-{
- g_autoptr( GError ) error = NULL;
- g_autofree gchar* directory_path = g_strdup_printf( "%s/foobar", g_get_user_cache_dir( ) );
-
- if ( !g_file_test( directory_path, G_FILE_TEST_EXISTS ) )
- {
- g_autoptr( GFile ) cache_dir = g_file_new_for_path( directory_path );
- if ( !g_file_make_directory_with_parents( cache_dir, NULL, &error ) )
- {
- g_warning( "Unable to create cache directory: %s", error->message );
- return NULL;
- }
- }
-
- return g_strdup_printf( "%s/%s", directory_path, filename );
-}