diff options
author | Hartmut Goebel <h.goebel@crazy-compilers.com> | 2019-03-02 17:27:36 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-04-03 13:42:16 +0200 |
commit | e729040833049ada5bb642e1084b603ec428742d (patch) | |
tree | 169071eb7718c251c20dadd7296e1a451321621b /src/util/gnunet-qr.c | |
parent | 6f4f14aa56a879587ae731751d51ea062e3d0956 (diff) | |
download | gnunet-e729040833049ada5bb642e1084b603ec428742d.tar.gz gnunet-e729040833049ada5bb642e1084b603ec428742d.zip |
gnunet-qr: Actually run gnunet-uri.
Diffstat (limited to 'src/util/gnunet-qr.c')
-rw-r--r-- | src/util/gnunet-qr.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c index b375d20a7..c8919dae4 100644 --- a/src/util/gnunet-qr.c +++ b/src/util/gnunet-qr.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <zbar.h> | 22 | #include <zbar.h> |
23 | #include <stdbool.h> | 23 | #include <stdbool.h> |
24 | #include <getopt.h> | 24 | #include <getopt.h> |
25 | #include "gnunet-qr-utils.h" | ||
25 | 26 | ||
26 | static const char *usage_note = | 27 | static const char *usage_note = |
27 | "gnunet-qr\n" | 28 | "gnunet-qr\n" |
@@ -128,16 +129,16 @@ int main (int argc, char **argv) | |||
128 | LOG("Found %s \"%s\"\n", | 129 | LOG("Found %s \"%s\"\n", |
129 | zbar_get_symbol_name(zbar_symbol_get_type(symbol)), data); | 130 | zbar_get_symbol_name(zbar_symbol_get_type(symbol)), data); |
130 | 131 | ||
131 | /* TODO | 132 | if (configuration == NULL) { |
132 | args = ["gnunet-uri", | 133 | char* command_args[] = {"gnunet-uri", data, NULL }; |
133 | // FIXME: "-c", configuration, | 134 | LOG("Running `gnunet-uri %s`\n", data); |
134 | data]; | 135 | rc = fork_and_exec("gnunet-uri", command_args); |
135 | if (verbose = true) { | 136 | } else { |
136 | // TODO: print arguments: | 137 | char* command_args[] = {"gnunet-uri", "-c", configuration, data, NULL }; |
137 | printf("Running `%s %s %s %s`", *args, "", ""); // FIXME variable num args | 138 | LOG("Running `gnunet-uri -c '%s' %s`\n", configuration, data); |
139 | rc = fork_and_exec("gnunet-uri", command_args); | ||
138 | }; | 140 | }; |
139 | rc = popen("gnunet-uri", *args); | 141 | |
140 | */ | ||
141 | if (rc != 0) { | 142 | if (rc != 0) { |
142 | printf("Failed to add URI %s\n", data); | 143 | printf("Failed to add URI %s\n", data); |
143 | } else { | 144 | } else { |