From f7900e258dfb8ab55f333d02d96f908ca0ea8899 Mon Sep 17 00:00:00 2001 From: Thomas Hindoe Paaboel Andersen Date: Thu, 14 Feb 2013 21:32:49 +0100 Subject: bootchart: use conf-parser & CamelCase names in .conf --- src/shared/conf-parser.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/shared/conf-parser.c') 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, -- cgit v1.2.3-54-g00ecf