summaryrefslogtreecommitdiff
path: root/src/common/raconf.h
diff options
context:
space:
mode:
authorTrojal <trojal@gmail.com>2013-01-10 20:09:39 -0800
committershennetsind <ind@henn.et>2013-01-12 05:56:35 -0200
commitc55855fcf627478f864c0f82a1a2f201fd407a38 (patch)
treeb7f6d11b2058248d026f2d9944e8f4b6ac288d50 /src/common/raconf.h
parent51bfeb38eb139e97e0e1c096c85c15fba234f35b (diff)
parent38e583df21eccd9e4f31d38acaae32579c6f0d27 (diff)
downloadhercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.gz
hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.bz2
hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.tar.xz
hercules-c55855fcf627478f864c0f82a1a2f201fd407a38.zip
Test1, testing for the commit widget, need to edit something.
Test2, testing for the commit widget, need to edit something. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/common/raconf.h')
-rw-r--r--src/common/raconf.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/common/raconf.h b/src/common/raconf.h
new file mode 100644
index 000000000..68a2b51b2
--- /dev/null
+++ b/src/common/raconf.h
@@ -0,0 +1,59 @@
+// Copyright (c) rAthena Project (www.rathena.org) - Licensed under GNU GPL
+// For more information, see LICENCE in the main folder
+
+#ifndef _rA_CONF_H_
+#define _rA_CONF_H_
+
+#include "../common/cbasetypes.h"
+
+// rAthena generic configuration file parser
+//
+// Config file Syntax is athena style
+// extended with ini style support (including sections)
+//
+// Comments are started with // or ; (ini style)
+//
+
+typedef struct raconf *raconf;
+
+
+/**
+ * Parses a rAthna Configuration file
+ *
+ * @param file_name path to the file to parse
+ *
+ * @returns not NULL incase of success
+ */
+raconf raconf_parse(const char *file_name);
+
+
+/**
+ * Frees a Handle received from raconf_parse
+ *
+ * @param rc - the handle to free
+ */
+void raconf_destroy(raconf rc);
+
+
+/**
+ * Gets the value for Section / Key pair, if key not exists returns _default!
+ *
+ */
+bool raconf_getbool(raconf rc, const char *section, const char *key, bool _default);
+float raconf_getfloat(raconf rc,const char *section, const char *key, float _default);
+int64 raconf_getint(raconf rc, const char *section, const char *key, int64 _default);
+const char* raconf_getstr(raconf rc, const char *section, const char *key, const char *_default);
+
+/**
+ * Gets the value for Section / Key pair, but has fallback section option if not found in section,
+ * if not found in both - default gets returned.
+ *
+ */
+bool raconf_getboolEx(raconf rc, const char *section, const char *fallback_section, const char *key, bool _default);
+float raconf_getfloatEx(raconf rc,const char *section, const char *fallback_section, const char *key, float _default);
+int64 raconf_getintEx(raconf rc, const char *section, const char *fallback_section, const char *key, int64 _default);
+const char* raconf_getstrEx(raconf rc, const char *section, const char *fallback_section, const char *key, const char *_default);
+
+
+
+#endif