summaryrefslogtreecommitdiff
path: root/conf.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2010-11-14 19:15:52 +0100
committerGravatar waker <wakeroid@gmail.com>2010-11-14 19:15:52 +0100
commite99691495ae098275ba7a3029960d2156ed28537 (patch)
treed5f5cd734cfde60771191594fcff4e15b9e8ff12 /conf.c
parentd78c38b33247a6ba153847ee720c7786109f00f9 (diff)
album art cache fixes
Diffstat (limited to 'conf.c')
-rw-r--r--conf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/conf.c b/conf.c
index b86e0836..c59cc92d 100644
--- a/conf.c
+++ b/conf.c
@@ -19,6 +19,7 @@
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
+#include <inttypes.h>
#include "conf.h"
static DB_conf_item_t *conf_items;
@@ -133,6 +134,12 @@ conf_get_int (const char *key, int def) {
return v ? atoi (v) : def;
}
+int64_t
+conf_get_int64 (const char *key, int64_t def) {
+ const char *v = conf_get_str (key, NULL);
+ return v ? atoll (v) : def;
+}
+
DB_conf_item_t *
conf_find (const char *group, DB_conf_item_t *prev) {
int l = strlen (group);
@@ -186,6 +193,13 @@ conf_set_int (const char *key, int val) {
}
void
+conf_set_int64 (const char *key, int64_t val) {
+ char s[20];
+ snprintf (s, sizeof (s), PRId64, val);
+ conf_set_str (key, s);
+}
+
+void
conf_set_float (const char *key, float val) {
char s[10];
snprintf (s, sizeof (s), "%0.7f", val);