[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 02/30: gnunet-qr: Simplify verbose messaging.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 02/30: gnunet-qr: Simplify verbose messaging. |
Date: |
Wed, 03 Apr 2019 13:53:43 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet.
commit eaf7440ec8e19df09b0ae632c4b200a0511069aa
Author: Hartmut Goebel <address@hidden>
AuthorDate: Sat Mar 2 12:37:46 2019 +0100
gnunet-qr: Simplify verbose messaging.
---
src/util/gnunet-qr.c | 26 +++++++++-----------------
1 file changed, 9 insertions(+), 17 deletions(-)
diff --git a/src/util/gnunet-qr.c b/src/util/gnunet-qr.c
index c02212a51..b375d20a7 100644
--- a/src/util/gnunet-qr.c
+++ b/src/util/gnunet-qr.c
@@ -38,6 +38,8 @@ static const char *usage_note =
"GNUnet home page: https://gnunet.org/\n"
"General help using GNU software: https://www.gnu.org/gethelp/\n";
+#define LOG(fmt, ...) if (verbose == true) printf(fmt, ## __VA_ARGS__)
+
int main (int argc, char **argv)
{
const char* configuration = NULL;
@@ -83,9 +85,7 @@ int main (int argc, char **argv)
}
/* create a Processor */
- if (verbose == true) {
- printf("Initializing\n");
- };
+ LOG("Initializing\n");
zbar_processor_t *proc = zbar_processor_create(1);
// FIXME: Wrap all this into a function which returns an error on
@@ -95,9 +95,7 @@ int main (int argc, char **argv)
zbar_processor_parse_config(proc, "enable");
/* initialize the Processor */
- if (verbose == true) {
- printf("Opening video device %s\n", device);
- };
+ LOG("Opening video device %s\n", device);
// FIXME: error handling
zbar_processor_init(proc, device, 1);
@@ -109,14 +107,10 @@ int main (int argc, char **argv)
//zbar_processor_user_wait(proc, -1);
// read at least one barcode (or until window closed)
- if (verbose == true) {
- printf("Capturing\n");
- }
+ LOG("Capturing\n");
int n;
n = zbar_process_one(proc, -1);
- if (verbose == true) {
- printf("Got %i images\n", n);
- };
+ LOG("Got %i images\n", n);
// FIXME: Error handling (n = -1)
// hide the preview window
@@ -131,11 +125,9 @@ int main (int argc, char **argv)
if (symbol != NULL) {
const char* data = zbar_symbol_get_data(symbol);
- if (verbose = true) {
- zbar_symbol_type_t type =
- printf("Found %s \"%s\"\n",
- zbar_get_symbol_name(zbar_symbol_get_type(symbol)), data);
- }
+ LOG("Found %s \"%s\"\n",
+ zbar_get_symbol_name(zbar_symbol_get_type(symbol)), data);
+
/* TODO
args = ["gnunet-uri",
// FIXME: "-c", configuration,
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (65c86ea8d -> f256a930e), gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 04/30: gnunet-qr: Actually run gnunet-uri., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 06/30: configure.ac: Add check for libzbar (using pkgconfig)., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 02/30: gnunet-qr: Simplify verbose messaging.,
gnunet <=
- [GNUnet-SVN] [gnunet] 05/30: Add Hartmut Goebel to the AUTHORS file., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 10/30: gnunet-qr: Use GNUNET_PROGRAM_run to simplify the code., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 03/30: Add helper lib "gnunet-qr-utils.h"., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 07/30: gnunet-qr: Add into Makefile.am and pofiles,, gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 01/30: gnunet-qr: Reimplement in C - yet only a proof of concept., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 25/30: contrib/guix: Add zbar as dependency for package gnunet., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 17/30: gnunet-qr: Actually run gnunet-uri., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 15/30: gnunet-qr: Simplify verbose messaging., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 18/30: Add Hartmut Goebel to the AUTHORS file., gnunet, 2019/04/03
- [GNUnet-SVN] [gnunet] 08/30: gnunet-qr: Use the `gnunet-uri` binary installed into PREFIX., gnunet, 2019/04/03