From: Bastian Dehn Date: Sat, 2 Mar 2024 21:02:16 +0000 (+0100) Subject: add config read tool read config X-Git-Tag: v1.0.0^2~144^2~3 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=f0194b7e7d6c225554ec4b2a5fe909f14ac8182e;p=sane-kds-s2000w-net.git add config read tool read config --- 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;