aboutsummaryrefslogtreecommitdiff
path: root/src/auction
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
committerng0 <ng0@n0.is>2019-09-08 12:33:09 +0000
commitd41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb (patch)
tree9efd18ea7d425652085ed0bd5e8e45604bc5f6b9 /src/auction
parenta0fce305c565c0937d917a92712f15e9c5736260 (diff)
downloadgnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.tar.gz
gnunet-d41ed82a4ea0cc8e1674b6d5d2c49fd6462610bb.zip
uncrustify as demanded.
Diffstat (limited to 'src/auction')
-rw-r--r--src/auction/auction.h7
-rw-r--r--src/auction/gnunet-auction-create.c292
-rw-r--r--src/auction/gnunet-auction-info.c33
-rw-r--r--src/auction/gnunet-auction-join.c33
-rw-r--r--src/auction/gnunet-service-auction.c72
-rw-r--r--src/auction/test_auction_api.c10
6 files changed, 224 insertions, 223 deletions
diff --git a/src/auction/auction.h b/src/auction/auction.h
index 74da53fdb..8324e1cb1 100644
--- a/src/auction/auction.h
+++ b/src/auction/auction.h
@@ -11,12 +11,12 @@
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 * @author Markus Teich 22 * @author Markus Teich
@@ -34,8 +34,7 @@ GNUNET_NETWORK_STRUCT_BEGIN
34/** 34/**
35 * Auction creation request sent from the client to the service 35 * Auction creation request sent from the client to the service
36 */ 36 */
37struct GNUNET_AUCTION_ClientCreateMessage 37struct GNUNET_AUCTION_ClientCreateMessage {
38{
39 /** 38 /**
40 * Type: GNUNET_MESSAGE_TYPE_AUCTION_CLIENT_CREATE 39 * Type: GNUNET_MESSAGE_TYPE_AUCTION_CLIENT_CREATE
41 */ 40 */
diff --git a/src/auction/gnunet-auction-create.c b/src/auction/gnunet-auction-create.c
index 3ee4d3554..42ab14aca 100644
--- a/src/auction/gnunet-auction-create.c
+++ b/src/auction/gnunet-auction-create.c
@@ -11,12 +11,12 @@
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 auction/gnunet-auction-create.c 22 * @file auction/gnunet-auction-create.c
@@ -54,94 +54,94 @@ static int interactive; /** keep running in foreground */
54 * @param cfg configuration 54 * @param cfg configuration
55 */ 55 */
56static void 56static void
57run (void *cls, 57run(void *cls,
58 char *const *args, 58 char *const *args,
59 const char *cfgfile, 59 const char *cfgfile,
60 const struct GNUNET_CONFIGURATION_Handle *cfg) 60 const struct GNUNET_CONFIGURATION_Handle *cfg)
61{ 61{
62 unsigned int i; 62 unsigned int i;
63 double cur, prev = DBL_MAX; 63 double cur, prev = DBL_MAX;
64 json_t *pmap; 64 json_t *pmap;
65 json_t *parray; 65 json_t *parray;
66 json_t *pnode; 66 json_t *pnode;
67 json_error_t jerr; 67 json_error_t jerr;
68 68
69 /* cmdline parsing */ 69 /* cmdline parsing */
70 if (GNUNET_TIME_UNIT_ZERO.rel_value_us == dstart.rel_value_us) 70 if (GNUNET_TIME_UNIT_ZERO.rel_value_us == dstart.rel_value_us)
71 { 71 {
72 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 72 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
73 "required argument --regtime missing or invalid (zero)\n"); 73 "required argument --regtime missing or invalid (zero)\n");
74 goto fail; 74 goto fail;
75 } 75 }
76 if (GNUNET_TIME_UNIT_ZERO.rel_value_us == dround.rel_value_us) 76 if (GNUNET_TIME_UNIT_ZERO.rel_value_us == dround.rel_value_us)
77 { 77 {
78 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 78 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
79 "required argument --roundtime missing or invalid (zero)\n"); 79 "required argument --roundtime missing or invalid (zero)\n");
80 goto fail; 80 goto fail;
81 } 81 }
82 if (!fndesc) 82 if (!fndesc)
83 { 83 {
84 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 84 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
85 "required argument --description missing\n"); 85 "required argument --description missing\n");
86 goto fail; 86 goto fail;
87 } 87 }
88 if (!fnprices) 88 if (!fnprices)
89 { 89 {
90 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 90 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
91 "required argument --pricemap missing\n"); 91 "required argument --pricemap missing\n");
92 goto fail; 92 goto fail;
93 } 93 }
94 94
95 /* parse and check pricemap validity */ 95 /* parse and check pricemap validity */
96 if (!(pmap = json_load_file (fnprices, JSON_DECODE_INT_AS_REAL, &jerr))) 96 if (!(pmap = json_load_file(fnprices, JSON_DECODE_INT_AS_REAL, &jerr)))
97 { 97 {
98 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 98 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
99 "parsing pricemap json at %d:%d: %s\n", 99 "parsing pricemap json at %d:%d: %s\n",
100 jerr.line, jerr.column, jerr.text); 100 jerr.line, jerr.column, jerr.text);
101 goto fail; 101 goto fail;
102 } 102 }
103 if (-1 == json_unpack_ex (pmap, &jerr, JSON_VALIDATE_ONLY, 103 if (-1 == json_unpack_ex(pmap, &jerr, JSON_VALIDATE_ONLY,
104 "{s:s, s:[]}", "currency", "prices")) 104 "{s:s, s:[]}", "currency", "prices"))
105 { 105 {
106 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 106 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
107 "validating pricemap: %s\n", jerr.text); 107 "validating pricemap: %s\n", jerr.text);
108 goto fail; 108 goto fail;
109 } 109 }
110 if (!(parray = json_object_get (pmap, "prices")) || !json_is_array (parray)) 110 if (!(parray = json_object_get(pmap, "prices")) || !json_is_array(parray))
111 { 111 {
112 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 112 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
113 "could not get `prices` array node from pricemap\n"); 113 "could not get `prices` array node from pricemap\n");
114 goto fail; 114 goto fail;
115 } 115 }
116 if (0 == json_array_size (parray)) 116 if (0 == json_array_size(parray))
117 { 117 {
118 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "empty pricemap array\n"); 118 GNUNET_log(GNUNET_ERROR_TYPE_ERROR, "empty pricemap array\n");
119 goto fail; 119 goto fail;
120 } 120 }
121 json_array_foreach (parray, i, pnode) 121 json_array_foreach(parray, i, pnode)
122 { 122 {
123 if (-1 == json_unpack_ex (pnode, &jerr, 0, "F", &cur)) 123 if (-1 == json_unpack_ex(pnode, &jerr, 0, "F", &cur))
124 { 124 {
125 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 125 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
126 "validating pricearray index %d: %s\n", i, jerr.text); 126 "validating pricearray index %d: %s\n", i, jerr.text);
127 goto fail; 127 goto fail;
128 } 128 }
129 if (prev <= cur) 129 if (prev <= cur)
130 { 130 {
131 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 131 GNUNET_log(GNUNET_ERROR_TYPE_ERROR,
132 "validating pricearray index %d: " 132 "validating pricearray index %d: "
133 "prices must be strictly monotonically decreasing\n", 133 "prices must be strictly monotonically decreasing\n",
134 i); 134 i);
135 goto fail; 135 goto fail;
136 } 136 }
137 prev = cur; 137 prev = cur;
138 } 138 }
139 139
140 return; 140 return;
141 141
142fail: 142fail:
143 ret = 1; 143 ret = 1;
144 return; 144 return;
145} 145}
146 146
147 147
@@ -153,64 +153,64 @@ fail:
153 * @return 0 ok, 1 on error 153 * @return 0 ok, 1 on error
154 */ 154 */
155int 155int
156main (int argc, char *const *argv) 156main(int argc, char *const *argv)
157{ 157{
158 struct GNUNET_GETOPT_CommandLineOption options[] = { 158 struct GNUNET_GETOPT_CommandLineOption options[] = {
159 159 GNUNET_GETOPT_option_filename('d',
160 GNUNET_GETOPT_option_filename ('d', 160 "description",
161 "description", 161 "FILE",
162 "FILE", 162 gettext_noop("description of the item to be sold"),
163 gettext_noop ("description of the item to be sold"), 163 &fndesc),
164 &fndesc), 164
165 165 GNUNET_GETOPT_option_filename('p',
166 GNUNET_GETOPT_option_filename ('p', 166 "pricemap",
167 "pricemap", 167 "FILE",
168 "FILE", 168 gettext_noop("mapping of possible prices"),
169 gettext_noop ("mapping of possible prices"), 169 &fnprices),
170 &fnprices), 170
171 171 GNUNET_GETOPT_option_relative_time('r',
172 GNUNET_GETOPT_option_relative_time ('r', 172 "roundtime",
173 "roundtime", 173 "DURATION",
174 "DURATION", 174 gettext_noop("max duration per round"),
175 gettext_noop ("max duration per round"), 175 &dround),
176 &dround), 176
177 177 GNUNET_GETOPT_option_relative_time('s',
178 GNUNET_GETOPT_option_relative_time ('s', 178 "regtime",
179 "regtime", 179 "DURATION",
180 "DURATION", 180 gettext_noop("duration until auction starts"),
181 gettext_noop ("duration until auction starts"), 181 &dstart),
182 &dstart), 182 GNUNET_GETOPT_option_uint('m',
183 GNUNET_GETOPT_option_uint ('m', 183 "m",
184 "m", 184 "NUMBER",
185 "NUMBER", 185 gettext_noop("number of items to sell\n"
186 gettext_noop ("number of items to sell\n" 186 "0 for first price auction\n"
187 "0 for first price auction\n" 187 ">0 for vickrey/M+1st price auction"),
188 ">0 for vickrey/M+1st price auction"), 188 &m),
189 &m), 189
190 190 GNUNET_GETOPT_option_flag('u',
191 GNUNET_GETOPT_option_flag ('u', 191 "public",
192 "public", 192 gettext_noop("public auction outcome"),
193 gettext_noop ("public auction outcome"), 193 &outcome),
194 &outcome), 194
195 195 GNUNET_GETOPT_option_flag('i',
196 GNUNET_GETOPT_option_flag ('i', 196 "interactive",
197 "interactive", 197 gettext_noop("keep running in foreground until auction completes"),
198 gettext_noop ("keep running in foreground until auction completes"), 198 &interactive),
199 &interactive), 199
200 200 GNUNET_GETOPT_OPTION_END
201 GNUNET_GETOPT_OPTION_END 201 };
202 }; 202
203 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args (argc, argv, &argc, &argv)) 203 if (GNUNET_OK != GNUNET_STRINGS_get_utf8_args(argc, argv, &argc, &argv))
204 return 2; 204 return 2;
205 205
206 ret = (GNUNET_OK == 206 ret = (GNUNET_OK ==
207 GNUNET_PROGRAM_run (argc, argv, 207 GNUNET_PROGRAM_run(argc, argv,
208 "gnunet-auction-create", 208 "gnunet-auction-create",
209 gettext_noop ("create a new auction and " 209 gettext_noop("create a new auction and "
210 "start listening for bidders"), 210 "start listening for bidders"),
211 options, 211 options,
212 &run, 212 &run,
213 NULL)) ? ret : 1; 213 NULL)) ? ret : 1;
214 GNUNET_free ((void*) argv); 214 GNUNET_free((void*)argv);
215 return ret; 215 return ret;
216} 216}
diff --git a/src/auction/gnunet-auction-info.c b/src/auction/gnunet-auction-info.c
index 58639a57c..ef46ca212 100644
--- a/src/auction/gnunet-auction-info.c
+++ b/src/auction/gnunet-auction-info.c
@@ -11,12 +11,12 @@
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 auction/gnunet-auction.c 22 * @file auction/gnunet-auction.c
@@ -42,10 +42,10 @@ static int ret;
42 * @param cfg configuration 42 * @param cfg configuration
43 */ 43 */
44static void 44static void
45run (void *cls, 45run(void *cls,
46 char *const *args, 46 char *const *args,
47 const char *cfgfile, 47 const char *cfgfile,
48 const struct GNUNET_CONFIGURATION_Handle *cfg) 48 const struct GNUNET_CONFIGURATION_Handle *cfg)
49{ 49{
50 /* main code here */ 50 /* main code here */
51} 51}
@@ -59,25 +59,26 @@ run (void *cls,
59 * @return 0 ok, 1 on error 59 * @return 0 ok, 1 on error
60 */ 60 */
61int 61int
62main (int argc, char *const *argv) 62main(int argc, char *const *argv)
63{ 63{
64 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 64 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
65 /* FIMXE: add options here */ 65 /* FIMXE: add options here */
66 GNUNET_GETOPT_OPTION_END 66 GNUNET_GETOPT_OPTION_END
67 }; 67 };
68
68 if (GNUNET_OK != 69 if (GNUNET_OK !=
69 GNUNET_STRINGS_get_utf8_args (argc, argv, 70 GNUNET_STRINGS_get_utf8_args(argc, argv,
70 &argc, &argv)) 71 &argc, &argv))
71 return 2; 72 return 2;
72 73
73 ret = (GNUNET_OK == 74 ret = (GNUNET_OK ==
74 GNUNET_PROGRAM_run (argc, argv, 75 GNUNET_PROGRAM_run(argc, argv,
75 "gnunet-auction", 76 "gnunet-auction",
76 gettext_noop ("help text"), 77 gettext_noop("help text"),
77 options, 78 options,
78 &run, 79 &run,
79 NULL)) ? ret : 1; 80 NULL)) ? ret : 1;
80 GNUNET_free ((void*) argv); 81 GNUNET_free((void*)argv);
81 return ret; 82 return ret;
82} 83}
83 84
diff --git a/src/auction/gnunet-auction-join.c b/src/auction/gnunet-auction-join.c
index 58639a57c..ef46ca212 100644
--- a/src/auction/gnunet-auction-join.c
+++ b/src/auction/gnunet-auction-join.c
@@ -11,12 +11,12 @@
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 auction/gnunet-auction.c 22 * @file auction/gnunet-auction.c
@@ -42,10 +42,10 @@ static int ret;
42 * @param cfg configuration 42 * @param cfg configuration
43 */ 43 */
44static void 44static void
45run (void *cls, 45run(void *cls,
46 char *const *args, 46 char *const *args,
47 const char *cfgfile, 47 const char *cfgfile,
48 const struct GNUNET_CONFIGURATION_Handle *cfg) 48 const struct GNUNET_CONFIGURATION_Handle *cfg)
49{ 49{
50 /* main code here */ 50 /* main code here */
51} 51}
@@ -59,25 +59,26 @@ run (void *cls,
59 * @return 0 ok, 1 on error 59 * @return 0 ok, 1 on error
60 */ 60 */
61int 61int
62main (int argc, char *const *argv) 62main(int argc, char *const *argv)
63{ 63{
64 static const struct GNUNET_GETOPT_CommandLineOption options[] = { 64 static const struct GNUNET_GETOPT_CommandLineOption options[] = {
65 /* FIMXE: add options here */ 65 /* FIMXE: add options here */
66 GNUNET_GETOPT_OPTION_END 66 GNUNET_GETOPT_OPTION_END
67 }; 67 };
68
68 if (GNUNET_OK != 69 if (GNUNET_OK !=
69 GNUNET_STRINGS_get_utf8_args (argc, argv, 70 GNUNET_STRINGS_get_utf8_args(argc, argv,
70 &argc, &argv)) 71 &argc, &argv))
71 return 2; 72 return 2;
72 73
73 ret = (GNUNET_OK == 74 ret = (GNUNET_OK ==
74 GNUNET_PROGRAM_run (argc, argv, 75 GNUNET_PROGRAM_run(argc, argv,
75 "gnunet-auction", 76 "gnunet-auction",
76 gettext_noop ("help text"), 77 gettext_noop("help text"),
77 options, 78 options,
78 &run, 79 &run,
79 NULL)) ? ret : 1; 80 NULL)) ? ret : 1;
80 GNUNET_free ((void*) argv); 81 GNUNET_free((void*)argv);
81 return ret; 82 return ret;
82} 83}
83 84
diff --git a/src/auction/gnunet-service-auction.c b/src/auction/gnunet-service-auction.c
index a5518b0f3..ed1be20d8 100644
--- a/src/auction/gnunet-service-auction.c
+++ b/src/auction/gnunet-service-auction.c
@@ -11,12 +11,12 @@
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 auction/gnunet-service-auction.c 22 * @file auction/gnunet-service-auction.c
@@ -36,10 +36,10 @@
36 * @return #GNUNET_OK (always) 36 * @return #GNUNET_OK (always)
37 */ 37 */
38static int 38static int
39check_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg) 39check_create(void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
40{ 40{
41 /* always well-formed due to arbitrary length description */ 41 /* always well-formed due to arbitrary length description */
42 return GNUNET_OK; 42 return GNUNET_OK;
43} 43}
44 44
45 45
@@ -50,26 +50,26 @@ check_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
50 * @param msg the actual message received 50 * @param msg the actual message received
51 */ 51 */
52static void 52static void
53handle_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg) 53handle_create(void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
54{ 54{
55 struct GNUNET_SERVICE_Client *client = cls; 55 struct GNUNET_SERVICE_Client *client = cls;
56// struct GNUNET_MQ_Handle *mq; 56// struct GNUNET_MQ_Handle *mq;
57// struct GNUNET_MQ_Envelope *env; 57// struct GNUNET_MQ_Envelope *env;
58// struct GNUNET_AUCTION_blabla em; 58// struct GNUNET_AUCTION_blabla em;
59 uint16_t size; 59 uint16_t size;
60 60
61 GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, 61 GNUNET_log(GNUNET_ERROR_TYPE_DEBUG,
62 "Received CREATE message from client\n"); 62 "Received CREATE message from client\n");
63 63
64 size = ntohs (msg->header.size); 64 size = ntohs(msg->header.size);
65 65
66 /**TODO: create auction and return auction object */ 66 /**TODO: create auction and return auction object */
67// mq = GNUNET_SERVICE_client_get_mq (client); 67// mq = GNUNET_SERVICE_client_get_mq (client);
68// setup_info_message (&em); 68// setup_info_message (&em);
69// env = GNUNET_MQ_msg_copy (&em.header); 69// env = GNUNET_MQ_msg_copy (&em.header);
70// GNUNET_MQ_send (mq, env); 70// GNUNET_MQ_send (mq, env);
71 71
72 GNUNET_SERVICE_client_continue (client); 72 GNUNET_SERVICE_client_continue(client);
73} 73}
74 74
75 75
@@ -79,9 +79,9 @@ handle_create (void *cls, const struct GNUNET_AUCTION_ClientCreateMessage *msg)
79 * @param cls unused 79 * @param cls unused
80 */ 80 */
81static void 81static void
82cleanup_task (void *cls) 82cleanup_task(void *cls)
83{ 83{
84 /* FIXME: do clean up here */ 84 /* FIXME: do clean up here */
85} 85}
86 86
87 87
@@ -94,11 +94,11 @@ cleanup_task (void *cls)
94 * @return @a c 94 * @return @a c
95 */ 95 */
96static void * 96static void *
97client_connect_cb (void *cls, 97client_connect_cb(void *cls,
98 struct GNUNET_SERVICE_Client *c, 98 struct GNUNET_SERVICE_Client *c,
99 struct GNUNET_MQ_Handle *mq) 99 struct GNUNET_MQ_Handle *mq)
100{ 100{
101 return c; 101 return c;
102} 102}
103 103
104 104
@@ -110,11 +110,11 @@ client_connect_cb (void *cls,
110 * @param internal_cls should be equal to @a c 110 * @param internal_cls should be equal to @a c
111 */ 111 */
112static void 112static void
113client_disconnect_cb (void *cls, 113client_disconnect_cb(void *cls,
114 struct GNUNET_SERVICE_Client *c, 114 struct GNUNET_SERVICE_Client *c,
115 void *internal_cls) 115 void *internal_cls)
116{ 116{
117 GNUNET_assert (c == internal_cls); 117 GNUNET_assert(c == internal_cls);
118} 118}
119 119
120 120
@@ -126,12 +126,12 @@ client_disconnect_cb (void *cls,
126 * @param service the initialized service 126 * @param service the initialized service
127 */ 127 */
128static void 128static void
129run (void *cls, 129run(void *cls,
130 const struct GNUNET_CONFIGURATION_Handle *cfg, 130 const struct GNUNET_CONFIGURATION_Handle *cfg,
131 struct GNUNET_SERVICE_Handle *service) 131 struct GNUNET_SERVICE_Handle *service)
132{ 132{
133 /* FIXME: do setup here */ 133 /* FIXME: do setup here */
134 GNUNET_SCHEDULER_add_shutdown (&cleanup_task, NULL); 134 GNUNET_SCHEDULER_add_shutdown(&cleanup_task, NULL);
135} 135}
136 136
137 137
@@ -139,17 +139,17 @@ run (void *cls,
139 * Define "main" method using service macro. 139 * Define "main" method using service macro.
140 */ 140 */
141GNUNET_SERVICE_MAIN 141GNUNET_SERVICE_MAIN
142("auction", 142 ("auction",
143 GNUNET_SERVICE_OPTION_NONE, 143 GNUNET_SERVICE_OPTION_NONE,
144 &run, 144 &run,
145 &client_connect_cb, 145 &client_connect_cb,
146 &client_disconnect_cb, 146 &client_disconnect_cb,
147 NULL, 147 NULL,
148 GNUNET_MQ_hd_var_size (create, 148 GNUNET_MQ_hd_var_size(create,
149 GNUNET_MESSAGE_TYPE_AUCTION_CLIENT_CREATE, 149 GNUNET_MESSAGE_TYPE_AUCTION_CLIENT_CREATE,
150 struct GNUNET_AUCTION_ClientCreateMessage, 150 struct GNUNET_AUCTION_ClientCreateMessage,
151 NULL), 151 NULL),
152 GNUNET_MQ_handler_end ()) 152 GNUNET_MQ_handler_end())
153 153
154 154
155/* end of gnunet-service-auction.c */ 155/* end of gnunet-service-auction.c */
diff --git a/src/auction/test_auction_api.c b/src/auction/test_auction_api.c
index 56b2a8192..39a002a5f 100644
--- a/src/auction/test_auction_api.c
+++ b/src/auction/test_auction_api.c
@@ -11,12 +11,12 @@
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 * @file auction/test_auction_api.c 21 * @file auction/test_auction_api.c
22 * @brief testcase for auction.c 22 * @brief testcase for auction.c
@@ -24,17 +24,17 @@
24#include "platform.h" 24#include "platform.h"
25 25
26static int 26static int
27check () 27check()
28{ 28{
29 return 0; 29 return 0;
30} 30}
31 31
32int 32int
33main (int argc, char *argv[]) 33main(int argc, char *argv[])
34{ 34{
35 int ret; 35 int ret;
36 36
37 ret = check (); 37 ret = check();
38 38
39 return ret; 39 return ret;
40} 40}