summaryrefslogtreecommitdiff
path: root/config.h
diff options
context:
space:
mode:
Diffstat (limited to 'config.h')
-rw-r--r--config.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/config.h b/config.h
new file mode 100644
index 0000000..939d86b
--- /dev/null
+++ b/config.h
@@ -0,0 +1,10 @@
+#include <toml.h>
+
+static inline void config_getscopes(const char *scope_path, char **scopes)
+{
+ FILE *fp = fopen(scope_path, "r");
+ toml_table_t* toml = toml_parse_file(fp, NULL, 0);
+ fclose(fp);
+ *scopes = toml_string_in(toml, "scopes").u.s;
+ toml_free(toml);
+}