aboutsummaryrefslogtreecommitdiffstats
path: root/src/common/config-parser.h
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-09 02:33:19 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2016-09-09 02:33:19 +0200
commit0dffa9a91ef47fc0ac6b96cb5e96e7e73b8018b8 (patch)
tree8e453d11902ecca74b2057c8924f1a60769f5cb9 /src/common/config-parser.h
parent634a5029931d3a68a44cf6de9c87fd8d547fe7a7 (diff)
downloadblogc-0dffa9a91ef47fc0ac6b96cb5e96e7e73b8018b8.tar.gz
blogc-0dffa9a91ef47fc0ac6b96cb5e96e7e73b8018b8.tar.bz2
blogc-0dffa9a91ef47fc0ac6b96cb5e96e7e73b8018b8.zip
common: added config-parser
Diffstat (limited to 'src/common/config-parser.h')
-rw-r--r--src/common/config-parser.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/common/config-parser.h b/src/common/config-parser.h
new file mode 100644
index 0000000..0d30c49
--- /dev/null
+++ b/src/common/config-parser.h
@@ -0,0 +1,26 @@
+/*
+ * blogc: A blog compiler.
+ * Copyright (C) 2014-2016 Rafael G. Martins <rafael@rafaelmartins.eng.br>
+ *
+ * This program can be distributed under the terms of the BSD License.
+ * See the file LICENSE.
+ */
+
+#ifndef _CONFIG_PARSER_H
+#define _CONFIG_PARSER_H
+
+#include "utils.h"
+#include "error.h"
+
+typedef struct {
+ bc_trie_t *root;
+} bc_config_t;
+
+bc_config_t* bc_config_parse(const char *src, size_t src_len, bc_error_t **err);
+char** bc_config_list_sections(bc_config_t *config);
+char** bc_config_list_keys(bc_config_t *config, const char *section);
+const char* bc_config_get(bc_config_t *config, const char *section,
+ const char *key);
+void bc_config_free(bc_config_t *config);
+
+#endif /* _CONFIG_PARSER_H */