diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-04-01 09:32:34 +0300 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-04-01 14:52:01 +0300 |
commit | 93cbe569582626793f79e5626970703059f88933 (patch) | |
tree | 8cb706c5a9c38e853424a1019aab1dfc089e2094 /runner/settings.h | |
parent | 7cadc6105b00f8d8ef166929118a95ce69221603 (diff) |
runner: Refactor metadata parsing
To aid testing function parsing metadata.txt is split into outer helper
that operates on dirfd and inner function that operates on FILE*.
This allows us to test the parsing using fmemopen(), limiting the amount
of necessary boilerplate.
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'runner/settings.h')
-rw-r--r-- | runner/settings.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/runner/settings.h b/runner/settings.h index 267d72cf..ae90897c 100644 --- a/runner/settings.h +++ b/runner/settings.h @@ -5,6 +5,7 @@ #include <stddef.h> #include <sys/types.h> #include <regex.h> +#include <stdio.h> enum { LOG_LEVEL_NORMAL = 0, @@ -114,6 +115,7 @@ char *absolute_path(char *path); */ bool serialize_settings(struct settings *settings); -bool read_settings(struct settings *settings, int dirfd); +bool read_settings_from_file(struct settings *settings, FILE* f); +bool read_settings_from_dir(struct settings *settings, int dirfd); #endif |