aboutsummaryrefslogtreecommitdiff
path: root/src/reclaim/json_reclaim.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <mschanzenbach@posteo.de>2019-05-22 16:25:38 +0200
committerSchanzenbach, Martin <mschanzenbach@posteo.de>2019-05-22 16:25:38 +0200
commitb2e257ecb9c82b19f6ab23431faa3605718d3f01 (patch)
tree767b8cf35d6e1c9a741ee7e87f33dc852a6593cc /src/reclaim/json_reclaim.c
parentf9c41505dd2ad80d08d6b516c534df0a66ea55fc (diff)
downloadgnunet-b2e257ecb9c82b19f6ab23431faa3605718d3f01.tar.gz
gnunet-b2e257ecb9c82b19f6ab23431faa3605718d3f01.zip
clang-format and cleanup
Diffstat (limited to 'src/reclaim/json_reclaim.c')
-rw-r--r--src/reclaim/json_reclaim.c58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/reclaim/json_reclaim.c b/src/reclaim/json_reclaim.c
index 9c186b64a..3ba4300bb 100644
--- a/src/reclaim/json_reclaim.c
+++ b/src/reclaim/json_reclaim.c
@@ -1,22 +1,22 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2009-2018 GNUnet e.V. 3 Copyright (C) 2009-2018 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License, 7 by the Free Software Foundation, either version 3 of the License,
8 or (at your option) any later version. 8 or (at your option) any later version.
9 9
10 GNUnet is distributed in the hope that it will be useful, but 10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of 11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Affero General Public License for more details. 13 Affero General Public License for more details.
14 14
15 You should have received a copy of the GNU Affero General Public License 15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>. 16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17 17
18 SPDX-License-Identifier: AGPL3.0-or-later 18 SPDX-License-Identifier: AGPL3.0-or-later
19*/ 19 */
20 20
21/** 21/**
22 * @file rest-plugins/json_reclaim.c 22 * @file rest-plugins/json_reclaim.c
@@ -62,8 +62,8 @@ parse_attr (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec)
62 } 62 }
63 // interpret single attribute 63 // interpret single attribute
64 unpack_state = 64 unpack_state =
65 json_unpack (root, "{s:s, s?s, s:s, s:s!}", "name", &name_str, "id", 65 json_unpack (root, "{s:s, s?s, s:s, s:s!}", "name", &name_str, "id",
66 &id_str, "type", &type_str, "value", &val_str); 66 &id_str, "type", &type_str, "value", &val_str);
67 if ((0 != unpack_state) || (NULL == name_str) || (NULL == val_str) || 67 if ((0 != unpack_state) || (NULL == name_str) || (NULL == val_str) ||
68 (NULL == type_str)) { 68 (NULL == type_str)) {
69 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 69 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -72,7 +72,7 @@ parse_attr (void *cls, json_t *root, struct GNUNET_JSON_Specification *spec)
72 } 72 }
73 type = GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (type_str); 73 type = GNUNET_RECLAIM_ATTRIBUTE_typename_to_number (type_str);
74 if (GNUNET_SYSERR == (GNUNET_RECLAIM_ATTRIBUTE_string_to_value ( 74 if (GNUNET_SYSERR == (GNUNET_RECLAIM_ATTRIBUTE_string_to_value (
75 type, val_str, (void **)&data, &data_size))) { 75 type, val_str, (void **)&data, &data_size))) {
76 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Attribute value invalid!\n"); 76 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Attribute value invalid!\n");
77 return GNUNET_SYSERR; 77 return GNUNET_SYSERR;
78 } 78 }
@@ -114,12 +114,12 @@ struct GNUNET_JSON_Specification
114GNUNET_RECLAIM_JSON_spec_claim (struct GNUNET_RECLAIM_ATTRIBUTE_Claim **attr) 114GNUNET_RECLAIM_JSON_spec_claim (struct GNUNET_RECLAIM_ATTRIBUTE_Claim **attr)
115{ 115{
116 struct GNUNET_JSON_Specification ret = {.parser = &parse_attr, 116 struct GNUNET_JSON_Specification ret = {.parser = &parse_attr,
117 .cleaner = &clean_attr, 117 .cleaner = &clean_attr,
118 .cls = NULL, 118 .cls = NULL,
119 .field = NULL, 119 .field = NULL,
120 .ptr = attr, 120 .ptr = attr,
121 .ptr_size = 0, 121 .ptr_size = 0,
122 .size_ptr = NULL}; 122 .size_ptr = NULL};
123 *attr = NULL; 123 *attr = NULL;
124 return ret; 124 return ret;
125} 125}
@@ -210,12 +210,12 @@ struct GNUNET_JSON_Specification
210GNUNET_RECLAIM_JSON_spec_ticket (struct GNUNET_RECLAIM_Ticket **ticket) 210GNUNET_RECLAIM_JSON_spec_ticket (struct GNUNET_RECLAIM_Ticket **ticket)
211{ 211{
212 struct GNUNET_JSON_Specification ret = {.parser = &parse_ticket, 212 struct GNUNET_JSON_Specification ret = {.parser = &parse_ticket,
213 .cleaner = &clean_ticket, 213 .cleaner = &clean_ticket,
214 .cls = NULL, 214 .cls = NULL,
215 .field = NULL, 215 .field = NULL,
216 .ptr = ticket, 216 .ptr = ticket,
217 .ptr_size = 0, 217 .ptr_size = 0,
218 .size_ptr = NULL}; 218 .size_ptr = NULL};
219 *ticket = NULL; 219 *ticket = NULL;
220 return ret; 220 return ret;
221} 221}