summaryrefslogtreecommitdiff
path: root/src/shared/conf-parser.c
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-14 21:32:49 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2013-02-14 21:36:45 +0100
commitf7900e258dfb8ab55f333d02d96f908ca0ea8899 (patch)
tree5ea3f278094931de8f37eaef5ded6bfa3ac1e3c9 /src/shared/conf-parser.c
parent47a81ba2e101058459328d2da3d9b950a8030c86 (diff)
bootchart: use conf-parser & CamelCase names in .conf
Diffstat (limited to 'src/shared/conf-parser.c')
-rw-r--r--src/shared/conf-parser.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index c5dd26db52..b09e90ae8b 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -467,6 +467,33 @@ int config_parse_unsigned(
return 0;
}
+int config_parse_double(
+ const char *filename,
+ unsigned line,
+ const char *section,
+ const char *lvalue,
+ int ltype,
+ const char *rvalue,
+ void *data,
+ void *userdata) {
+
+ double *d = data;
+ int r;
+
+ assert(filename);
+ assert(lvalue);
+ assert(rvalue);
+ assert(data);
+
+ r = safe_atod(rvalue, d);
+ if (r < 0) {
+ log_error("[%s:%u] Failed to parse numeric value: %s", filename, line, rvalue);
+ return r;
+ }
+
+ return 0;
+}
+
int config_parse_bytes_size(
const char *filename,
unsigned line,