[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-mdb] 46/93: first steps in configurable products
From: |
gnunet |
Subject: |
[taler-taler-mdb] 46/93: first steps in configurable products |
Date: |
Mon, 18 Nov 2019 21:13:09 +0100 |
This is an automated email from the git hooks/post-receive script.
marco-boss pushed a commit to branch master
in repository taler-mdb.
commit d0f3643c3166bd41bcf16c71e1ea4db829704122
Author: Boss Marco <address@hidden>
AuthorDate: Mon Nov 11 17:53:55 2019 +0100
first steps in configurable products
---
src/main.c | 55 ++++++++++++++++++++++++++++---------------------------
1 file changed, 28 insertions(+), 27 deletions(-)
diff --git a/src/main.c b/src/main.c
index 5cdfe6a..c1ab881 100644
--- a/src/main.c
+++ b/src/main.c
@@ -42,7 +42,7 @@ along with
#define NFC_TIMEOUT 500
#define MAX_HTTP_RETRY_FREQ GNUNET_TIME_relative_multiply ( \
- GNUNET_TIME_UNIT_MILLISECONDS, 500)
+ GNUNET_TIME_UNIT_MILLISECONDS, 500)
/**
* Code returned by libnfc in case of success.
@@ -209,9 +209,9 @@ shutdown_task (void *cls)
{
for (unsigned int i = 0; NrOfProducts > i; i++)
{
- GNUNET_free(products[i].description);
- GNUNET_free(products[i].price);
- GNUNET_free(products[i].number);
+ GNUNET_free (products[i].description);
+ GNUNET_free (products[i].price);
+ GNUNET_free (products[i].number);
}
}
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
@@ -264,7 +264,7 @@ wallet_transmit_uri (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"'PUT DATA' command transmission failed, return code: %x%x\n",
response[0],
- response[1]);
+ response[1]);
pa->task = GNUNET_SCHEDULER_add_now (&connect_target,
pa);
return;
@@ -328,7 +328,7 @@ wallet_select_aid (void *cls)
GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
"AID selection failure, return code: %x%x, trying to find
another NFC client\n",
response[0],
- response[1]);
+ response[1]);
pa->task = GNUNET_SCHEDULER_add_delayed (NFC_FAILURE_RETRY_FREQ,
&connect_target,
pa);
@@ -663,15 +663,15 @@ start_read_keyboard ()
}
static void
-read_products (void* cls,
+read_products (void*cls,
const char *section)
{
struct Product tmpProduct;
- char* tmpKey;
+ char*tmpKey;
- if(0 == strncmp(section,
- "product",
- strlen("product")))
+ if (0 == strncmp (section,
+ "product",
+ strlen ("product")))
{
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cls,
@@ -707,7 +707,7 @@ read_products (void* cls,
return;
}
tmpProduct.key = tmpKey[0];
- GNUNET_free(tmpKey);
+ GNUNET_free (tmpKey);
if (GNUNET_OK !=
GNUNET_CONFIGURATION_get_value_string (cls,
section,
@@ -720,24 +720,25 @@ read_products (void* cls,
return;
}
NrOfProducts++;
- if(NULL == products)
+ if (NULL == products)
/*products = GNUNET_new_array(1,
sizeof(struct Product)); */
- products = GNUNET_new(struct Product);
+ products = GNUNET_new (struct Product);
else
/*GNUNET_array_grow(products,
sizeof(products),
sizeof(products)+sizeof(struct Product)); NOT WORKING
? */
- products = GNUNET_realloc(products,
- NrOfProducts*sizeof(struct Product));
+ products = GNUNET_realloc (products,
+ NrOfProducts * sizeof(struct Product));
- products[NrOfProducts-1].description =
GNUNET_strdup(tmpProduct.description);
- GNUNET_free(tmpProduct.description);
- products[NrOfProducts-1].price = GNUNET_strdup(tmpProduct.price);
- GNUNET_free(tmpProduct.price);
- products[NrOfProducts-1].number = GNUNET_strdup(tmpProduct.number);
- GNUNET_free(tmpProduct.number);
- products[NrOfProducts-1].key = tmpProduct.key;
+ products[NrOfProducts - 1].description = GNUNET_strdup (
+ tmpProduct.description);
+ GNUNET_free (tmpProduct.description);
+ products[NrOfProducts - 1].price = GNUNET_strdup (tmpProduct.price);
+ GNUNET_free (tmpProduct.price);
+ products[NrOfProducts - 1].number = GNUNET_strdup (tmpProduct.number);
+ GNUNET_free (tmpProduct.number);
+ products[NrOfProducts - 1].key = tmpProduct.key;
}
}
@@ -820,10 +821,10 @@ run (void *cls,
global_ret = EXIT_FAILURE;
return;
}
- GNUNET_CONFIGURATION_iterate_sections(cfg,
- &read_products,
- (void*)cfg);
- GNUNET_assert(NULL != products);
+ GNUNET_CONFIGURATION_iterate_sections (cfg,
+ &read_products,
+ (void *) cfg);
+ GNUNET_assert (NULL != products);
GNUNET_SCHEDULER_add_shutdown (&shutdown_task,
NULL);
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [taler-taler-mdb] 14/93: updated .gitignore, (continued)
- [taler-taler-mdb] 14/93: updated .gitignore, gnunet, 2019/11/18
- [taler-taler-mdb] 20/93: more implementations using GNUNETUtils, gnunet, 2019/11/18
- [taler-taler-mdb] 19/93: GNUnet logs added, -h option added, gnunet, 2019/11/18
- [taler-taler-mdb] 12/93: initial indenting, gnunet, 2019/11/18
- [taler-taler-mdb] 31/93: cleanup, gnunet, 2019/11/18
- [taler-taler-mdb] 33/93: typo, gnunet, 2019/11/18
- [taler-taler-mdb] 30/93: cleanup, gnunet, 2019/11/18
- [taler-taler-mdb] 24/93: use event loop, gnunet, 2019/11/18
- [taler-taler-mdb] 32/93: retry NFC failures more nicely, gnunet, 2019/11/18
- [taler-taler-mdb] 36/93: fixed delay when cancelling, new bugs detected marked with FIXME, gnunet, 2019/11/18
- [taler-taler-mdb] 46/93: first steps in configurable products,
gnunet <=
- [taler-taler-mdb] 28/93: misc cleanup, gnunet, 2019/11/18
- [taler-taler-mdb] 45/93: first steps in configurable products, gnunet, 2019/11/18
- [taler-taler-mdb] 40/93: fix, gnunet, 2019/11/18
- [taler-taler-mdb] 43/93: preparations for QR code alternative path, gnunet, 2019/11/18
- [taler-taler-mdb] 35/93: explicitly detect not-found code, gnunet, 2019/11/18
- [taler-taler-mdb] 39/93: use test for now, gnunet, 2019/11/18
- [taler-taler-mdb] 38/93: merged, gnunet, 2019/11/18
- [taler-taler-mdb] 37/93: fixed delay when cancelling, new bugs detected marked with FIXME, gnunet, 2019/11/18
- [taler-taler-mdb] 34/93: fix, gnunet, 2019/11/18
- [taler-taler-mdb] 42/93: print URI sent to wallet for diagnostics, gnunet, 2019/11/18