+ * Destroys the default config
+ */
+void config_destroy_default(void)
+{
+ char *path = config_get_default_path();
+ if (path == NULL) {
+ return;
+ }
+ config_destroy(path);
+}
+
+/*
+ * Returns 1 if config exists, 0 otherwise
+ */
+int config_exists(const char *path)
+{
+ int ret;
+ struct stat info;
+
+ ret = stat(path, &info);
+ if (ret < 0) {
+ return 0;
+ }
+ return S_ISREG(info.st_mode) || S_ISDIR(info.st_mode);
+}
+
+/*
+ * Returns the session name from the config file.
+ * The caller is responsible for freeing the returned string.
+ * On error, NULL is returned.