From f0194b7e7d6c225554ec4b2a5fe909f14ac8182e Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Sat, 2 Mar 2024 22:02:16 +0100 Subject: [PATCH] add config read tool read config --- src/kds_s2000w_net.conf | 3 +-- tools/read_config.c | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/kds_s2000w_net.conf b/src/kds_s2000w_net.conf index bce4ac9..698f116 100644 --- a/src/kds_s2000w_net.conf +++ b/src/kds_s2000w_net.conf @@ -1,3 +1,2 @@ -# scanner_url = http://scanner.example.com scanner_url = http://scanner.example.com - +username = muster diff --git a/tools/read_config.c b/tools/read_config.c index 964292b..a2028e1 100644 --- a/tools/read_config.c +++ b/tools/read_config.c @@ -5,14 +5,14 @@ int main(int argc, char** argv) { program_config* config = malloc(sizeof(program_config)); - char* config_stream = NULL; + + printf("config file %s\n", argv[1]); read_config_file(argv[1], &config_stream); - printf("config:\n%s\n", config_stream); load_config(config, config_stream); - printf("scanner_url: %s", config->scanner_url); - printf("username %s", config->username); + printf("scanner_url: %s\n", config->scanner_url); + printf("username: %s\n", config->username); free(config_stream); config_stream = NULL; -- 2.39.5