summaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
Diffstat (limited to 'config.c')
-rw-r--r--config.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/config.c b/config.c
new file mode 100644
index 0000000..e7b2293
--- /dev/null
+++ b/config.c
@@ -0,0 +1,22 @@
+#include "config.h"
+
+cWeatherforecastConfig::cWeatherforecastConfig() {
+ //number of hours to wait till next update from forecast.io is fetched
+ hoursToUpdate = 20;
+ //city to display in menus
+ city = "";
+ //latitude and longitude of location for forecast.io query
+ lat = 0.0;
+ lon = 0.0;
+}
+
+cWeatherforecastConfig::~cWeatherforecastConfig() {
+}
+
+bool cWeatherforecastConfig::SetupParse(const char *Name, const char *Value) {
+ if (!strcasecmp(Name, "city")) city = Value;
+ else if (!strcasecmp(Name, "lat")) lat = atod(Value);
+ else if (!strcasecmp(Name, "lon")) lon = atod(Value);
+ else return false;
+ return true;
+}