diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/testbed/generate-underlay-topology.c | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/testbed/generate-underlay-topology.c')
-rw-r--r-- | src/testbed/generate-underlay-topology.c | 376 |
1 files changed, 188 insertions, 188 deletions
diff --git a/src/testbed/generate-underlay-topology.c b/src/testbed/generate-underlay-topology.c index a463d384a..726bed179 100644 --- a/src/testbed/generate-underlay-topology.c +++ b/src/testbed/generate-underlay-topology.c | |||
@@ -30,10 +30,10 @@ | |||
30 | #include "testbed_api_topology.h" | 30 | #include "testbed_api_topology.h" |
31 | #include "sqlite3.h" | 31 | #include "sqlite3.h" |
32 | 32 | ||
33 | #define LOG(type, ...) GNUNET_log(type, __VA_ARGS__) | 33 | #define LOG(type, ...) GNUNET_log (type, __VA_ARGS__) |
34 | 34 | ||
35 | 35 | ||
36 | #define LOG_ERROR(...) LOG(GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) | 36 | #define LOG_ERROR(...) LOG (GNUNET_ERROR_TYPE_ERROR, __VA_ARGS__) |
37 | 37 | ||
38 | /** | 38 | /** |
39 | * Log an error message at log-level 'level' that indicates | 39 | * Log an error message at log-level 'level' that indicates |
@@ -42,22 +42,22 @@ | |||
42 | */ | 42 | */ |
43 | #define LOG_SQLITE(db, msg, level, cmd) \ | 43 | #define LOG_SQLITE(db, msg, level, cmd) \ |
44 | do \ | 44 | do \ |
45 | { \ | 45 | { \ |
46 | GNUNET_log_from(level, \ | 46 | GNUNET_log_from (level, \ |
47 | "sqlite", \ | 47 | "sqlite", \ |
48 | _("`%s' failed at %s:%d with error: %s\n"), \ | 48 | _ ("`%s' failed at %s:%d with error: %s\n"), \ |
49 | cmd, \ | 49 | cmd, \ |
50 | __FILE__, \ | 50 | __FILE__, \ |
51 | __LINE__, \ | 51 | __LINE__, \ |
52 | sqlite3_errmsg(db)); \ | 52 | sqlite3_errmsg (db)); \ |
53 | if (msg != NULL) \ | 53 | if (msg != NULL) \ |
54 | GNUNET_asprintf (msg, \ | 54 | GNUNET_asprintf (msg, \ |
55 | _("`%s' failed at %s:%u with error: %s"), \ | 55 | _ ("`%s' failed at %s:%u with error: %s"), \ |
56 | cmd, \ | 56 | cmd, \ |
57 | __FILE__, \ | 57 | __FILE__, \ |
58 | __LINE__, \ | 58 | __LINE__, \ |
59 | sqlite3_errmsg(db)); \ | 59 | sqlite3_errmsg (db)); \ |
60 | } while (0) | 60 | } while (0) |
61 | 61 | ||
62 | 62 | ||
63 | /** | 63 | /** |
@@ -98,43 +98,43 @@ static int exit_result; | |||
98 | * @return GNUNET_OK to continue processing; GNUNET_SYSERR to abort | 98 | * @return GNUNET_OK to continue processing; GNUNET_SYSERR to abort |
99 | */ | 99 | */ |
100 | static int | 100 | static int |
101 | link_processor(void *cls, | 101 | link_processor (void *cls, |
102 | unsigned int A, | 102 | unsigned int A, |
103 | unsigned int B, | 103 | unsigned int B, |
104 | unsigned int bandwidth, | 104 | unsigned int bandwidth, |
105 | unsigned int latency, | 105 | unsigned int latency, |
106 | unsigned int loss) | 106 | unsigned int loss) |
107 | { | 107 | { |
108 | if ((SQLITE_OK != sqlite3_bind_int(stmt_insert, 1, A)) || | 108 | if ((SQLITE_OK != sqlite3_bind_int (stmt_insert, 1, A)) || |
109 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 2, B)) || | 109 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 2, B)) || |
110 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 3, bandwidth)) || | 110 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 3, bandwidth)) || |
111 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 4, latency)) || | 111 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 4, latency)) || |
112 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 5, loss))) | 112 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 5, loss))) |
113 | { | 113 | { |
114 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); | 114 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); |
115 | return GNUNET_SYSERR; | 115 | return GNUNET_SYSERR; |
116 | } | 116 | } |
117 | if (SQLITE_DONE != sqlite3_step(stmt_insert)) | 117 | if (SQLITE_DONE != sqlite3_step (stmt_insert)) |
118 | { | 118 | { |
119 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); | 119 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); |
120 | return GNUNET_SYSERR; | 120 | return GNUNET_SYSERR; |
121 | } | 121 | } |
122 | fprintf(stdout, "%u -> %u\n", A, B); | 122 | fprintf (stdout, "%u -> %u\n", A, B); |
123 | GNUNET_break(SQLITE_OK == sqlite3_reset(stmt_insert)); | 123 | GNUNET_break (SQLITE_OK == sqlite3_reset (stmt_insert)); |
124 | //GNUNET_break (SQLITE_OK == sqlite3_clear_bindings (stmt_insert)); | 124 | // GNUNET_break (SQLITE_OK == sqlite3_clear_bindings (stmt_insert)); |
125 | if ((SQLITE_OK != sqlite3_bind_int(stmt_insert, 1, B)) || | 125 | if ((SQLITE_OK != sqlite3_bind_int (stmt_insert, 1, B)) || |
126 | (SQLITE_OK != sqlite3_bind_int(stmt_insert, 2, A))) | 126 | (SQLITE_OK != sqlite3_bind_int (stmt_insert, 2, A))) |
127 | { | 127 | { |
128 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); | 128 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_bind_int"); |
129 | return GNUNET_SYSERR; | 129 | return GNUNET_SYSERR; |
130 | } | 130 | } |
131 | if (SQLITE_DONE != sqlite3_step(stmt_insert)) | 131 | if (SQLITE_DONE != sqlite3_step (stmt_insert)) |
132 | { | 132 | { |
133 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); | 133 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_step"); |
134 | return GNUNET_SYSERR; | 134 | return GNUNET_SYSERR; |
135 | } | 135 | } |
136 | fprintf(stdout, "%u -> %u\n", B, A); | 136 | fprintf (stdout, "%u -> %u\n", B, A); |
137 | GNUNET_break(SQLITE_OK == sqlite3_reset(stmt_insert)); | 137 | GNUNET_break (SQLITE_OK == sqlite3_reset (stmt_insert)); |
138 | return GNUNET_OK; | 138 | return GNUNET_OK; |
139 | } | 139 | } |
140 | 140 | ||
@@ -148,7 +148,7 @@ link_processor(void *cls, | |||
148 | * to be printed) | 148 | * to be printed) |
149 | */ | 149 | */ |
150 | static int | 150 | static int |
151 | setup_db(const char *dbfile) | 151 | setup_db (const char *dbfile) |
152 | { | 152 | { |
153 | const char *query_create = "CREATE TABLE whitelist (" | 153 | const char *query_create = "CREATE TABLE whitelist (" |
154 | "id INTEGER," | 154 | "id INTEGER," |
@@ -176,28 +176,28 @@ setup_db(const char *dbfile) | |||
176 | int ret; | 176 | int ret; |
177 | 177 | ||
178 | ret = GNUNET_SYSERR; | 178 | ret = GNUNET_SYSERR; |
179 | if (SQLITE_OK != sqlite3_open(dbfile, &db)) | 179 | if (SQLITE_OK != sqlite3_open (dbfile, &db)) |
180 | { | 180 | { |
181 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_open"); | 181 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_open"); |
182 | goto err_ret; | 182 | goto err_ret; |
183 | } | 183 | } |
184 | if (0 != sqlite3_exec(db, query_create, NULL, NULL, NULL)) | 184 | if (0 != sqlite3_exec (db, query_create, NULL, NULL, NULL)) |
185 | { | 185 | { |
186 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_exec"); | 186 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_exec"); |
187 | fprintf(stderr, | 187 | fprintf (stderr, |
188 | "Error: %d. Perhaps the database `%s' already exits.\n", | 188 | "Error: %d. Perhaps the database `%s' already exits.\n", |
189 | sqlite3_errcode(db), | 189 | sqlite3_errcode (db), |
190 | dbfile); | 190 | dbfile); |
191 | goto err_ret; | 191 | goto err_ret; |
192 | } | 192 | } |
193 | GNUNET_break(0 == | 193 | GNUNET_break (0 == |
194 | sqlite3_exec(db, "PRAGMA synchronous = 0;", NULL, NULL, NULL)); | 194 | sqlite3_exec (db, "PRAGMA synchronous = 0;", NULL, NULL, NULL)); |
195 | if (SQLITE_OK != | 195 | if (SQLITE_OK != |
196 | sqlite3_prepare_v2(db, query_insert, -1, &stmt_insert, NULL)) | 196 | sqlite3_prepare_v2 (db, query_insert, -1, &stmt_insert, NULL)) |
197 | { | 197 | { |
198 | LOG_SQLITE(db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_prepare_v2"); | 198 | LOG_SQLITE (db, NULL, GNUNET_ERROR_TYPE_ERROR, "sqlite3_prepare_v2"); |
199 | goto err_ret; | 199 | goto err_ret; |
200 | } | 200 | } |
201 | ret = GNUNET_OK; | 201 | ret = GNUNET_OK; |
202 | 202 | ||
203 | err_ret: | 203 | err_ret: |
@@ -214,10 +214,10 @@ err_ret: | |||
214 | * @param cfg the configuration file handle | 214 | * @param cfg the configuration file handle |
215 | */ | 215 | */ |
216 | static void | 216 | static void |
217 | run(void *cls, | 217 | run (void *cls, |
218 | char *const *args, | 218 | char *const *args, |
219 | const char *cfgfile, | 219 | const char *cfgfile, |
220 | const struct GNUNET_CONFIGURATION_Handle *config) | 220 | const struct GNUNET_CONFIGURATION_Handle *config) |
221 | { | 221 | { |
222 | const char *dbfile; | 222 | const char *dbfile; |
223 | const char *topology_string; | 223 | const char *topology_string; |
@@ -231,125 +231,125 @@ run(void *cls, | |||
231 | arg_uint1 = 0; /* make compilers happy */ | 231 | arg_uint1 = 0; /* make compilers happy */ |
232 | arg_uint2 = 0; /* make compilers happy */ | 232 | arg_uint2 = 0; /* make compilers happy */ |
233 | if (NULL == args) | 233 | if (NULL == args) |
234 | { | 234 | { |
235 | LOG_ERROR(_("Need at least 2 arguments\n")); | 235 | LOG_ERROR (_ ("Need at least 2 arguments\n")); |
236 | return; | 236 | return; |
237 | } | 237 | } |
238 | if (NULL == (dbfile = args[argc++])) | 238 | if (NULL == (dbfile = args[argc++])) |
239 | { | 239 | { |
240 | LOG_ERROR(_("Database filename missing\n")); | 240 | LOG_ERROR (_ ("Database filename missing\n")); |
241 | return; | 241 | return; |
242 | } | 242 | } |
243 | if (GNUNET_OK != setup_db(dbfile)) | 243 | if (GNUNET_OK != setup_db (dbfile)) |
244 | return; | 244 | return; |
245 | if (NULL == (topology_string = args[argc++])) | 245 | if (NULL == (topology_string = args[argc++])) |
246 | { | ||
247 | LOG_ERROR (_ ("Topology string missing\n")); | ||
248 | return; | ||
249 | } | ||
250 | if (GNUNET_YES != GNUNET_TESTBED_topology_get_ (&topology, topology_string)) | ||
251 | { | ||
252 | LOG_ERROR (_ ("Invalid topology: %s\n"), topology_string); | ||
253 | return; | ||
254 | } | ||
255 | arg_str1 = NULL; | ||
256 | /* parse for first TOPOOPT. This can either be arg_uint1 or arg_str1 */ | ||
257 | switch (topology) | ||
258 | { | ||
259 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: | ||
260 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: | ||
261 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: | ||
262 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
263 | if (NULL == (value = args[argc++])) | ||
246 | { | 264 | { |
247 | LOG_ERROR(_("Topology string missing\n")); | 265 | LOG_ERROR (_ ("An argument is missing for given topology `%s'\n"), |
266 | topology_string); | ||
248 | return; | 267 | return; |
249 | } | 268 | } |
250 | if (GNUNET_YES != GNUNET_TESTBED_topology_get_(&topology, topology_string)) | 269 | if (-1 == sscanf (value, "%u", &arg_uint1)) |
251 | { | 270 | { |
252 | LOG_ERROR(_("Invalid topology: %s\n"), topology_string); | 271 | LOG_ERROR (_ ("Invalid argument `%s' given as topology argument\n"), |
272 | value); | ||
253 | return; | 273 | return; |
254 | } | 274 | } |
255 | arg_str1 = NULL; | 275 | break; |
256 | /* parse for first TOPOOPT. This can either be arg_uint1 or arg_str1 */ | 276 | |
257 | switch (topology) | 277 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: |
278 | if (NULL == (arg_str1 = args[argc++])) | ||
258 | { | 279 | { |
259 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: | 280 | LOG_ERROR (_ ("Filename argument missing for topology `%s'\n"), |
260 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: | 281 | topology_string); |
261 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: | 282 | return; |
262 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
263 | if (NULL == (value = args[argc++])) | ||
264 | { | ||
265 | LOG_ERROR(_("An argument is missing for given topology `%s'\n"), | ||
266 | topology_string); | ||
267 | return; | ||
268 | } | ||
269 | if (-1 == sscanf(value, "%u", &arg_uint1)) | ||
270 | { | ||
271 | LOG_ERROR(_("Invalid argument `%s' given as topology argument\n"), | ||
272 | value); | ||
273 | return; | ||
274 | } | ||
275 | break; | ||
276 | |||
277 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | ||
278 | if (NULL == (arg_str1 = args[argc++])) | ||
279 | { | ||
280 | LOG_ERROR(_("Filename argument missing for topology `%s'\n"), | ||
281 | topology_string); | ||
282 | return; | ||
283 | } | ||
284 | break; | ||
285 | |||
286 | default: | ||
287 | break; | ||
288 | } | 283 | } |
284 | break; | ||
285 | |||
286 | default: | ||
287 | break; | ||
288 | } | ||
289 | /* parse for second TOPOOPT. Only required for SCALE_FREE topology */ | 289 | /* parse for second TOPOOPT. Only required for SCALE_FREE topology */ |
290 | switch (topology) | 290 | switch (topology) |
291 | { | ||
292 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
293 | if (NULL == (value = args[argc++])) | ||
291 | { | 294 | { |
292 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | 295 | LOG_ERROR (_ ("Second argument for topology `%s' is missing\n"), |
293 | if (NULL == (value = args[argc++])) | 296 | topology_string); |
294 | { | 297 | return; |
295 | LOG_ERROR(_("Second argument for topology `%s' is missing\n"), | ||
296 | topology_string); | ||
297 | return; | ||
298 | } | ||
299 | if (-1 == sscanf(value, "%u", &arg_uint2)) | ||
300 | { | ||
301 | LOG_ERROR(_("Invalid argument `%s'; expecting unsigned int\n"), value); | ||
302 | return; | ||
303 | } | ||
304 | break; | ||
305 | |||
306 | default: | ||
307 | break; | ||
308 | } | 298 | } |
309 | /* contruct topologies */ | 299 | if (-1 == sscanf (value, "%u", &arg_uint2)) |
310 | switch (topology) | ||
311 | { | 300 | { |
312 | case GNUNET_TESTBED_TOPOLOGY_LINE: | 301 | LOG_ERROR (_ ("Invalid argument `%s'; expecting unsigned int\n"), value); |
313 | case GNUNET_TESTBED_TOPOLOGY_RING: | 302 | return; |
314 | case GNUNET_TESTBED_TOPOLOGY_STAR: | ||
315 | case GNUNET_TESTBED_TOPOLOGY_CLIQUE: | ||
316 | case GNUNET_TESTBED_TOPOLOGY_2D_TORUS: | ||
317 | GNUNET_TESTBED_underlay_construct_(num_peers, | ||
318 | link_processor, | ||
319 | NULL, | ||
320 | topology); | ||
321 | break; | ||
322 | |||
323 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: | ||
324 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: | ||
325 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: | ||
326 | GNUNET_TESTBED_underlay_construct_(num_peers, | ||
327 | link_processor, | ||
328 | NULL, | ||
329 | topology, | ||
330 | arg_uint1); | ||
331 | break; | ||
332 | |||
333 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | ||
334 | GNUNET_TESTBED_underlay_construct_(num_peers, | ||
335 | link_processor, | ||
336 | NULL, | ||
337 | topology, | ||
338 | arg_str1); | ||
339 | break; | ||
340 | |||
341 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
342 | GNUNET_TESTBED_underlay_construct_(num_peers, | ||
343 | link_processor, | ||
344 | NULL, | ||
345 | topology, | ||
346 | arg_uint1, | ||
347 | arg_uint2); | ||
348 | break; | ||
349 | |||
350 | default: | ||
351 | GNUNET_assert(0); | ||
352 | } | 303 | } |
304 | break; | ||
305 | |||
306 | default: | ||
307 | break; | ||
308 | } | ||
309 | /* contruct topologies */ | ||
310 | switch (topology) | ||
311 | { | ||
312 | case GNUNET_TESTBED_TOPOLOGY_LINE: | ||
313 | case GNUNET_TESTBED_TOPOLOGY_RING: | ||
314 | case GNUNET_TESTBED_TOPOLOGY_STAR: | ||
315 | case GNUNET_TESTBED_TOPOLOGY_CLIQUE: | ||
316 | case GNUNET_TESTBED_TOPOLOGY_2D_TORUS: | ||
317 | GNUNET_TESTBED_underlay_construct_ (num_peers, | ||
318 | link_processor, | ||
319 | NULL, | ||
320 | topology); | ||
321 | break; | ||
322 | |||
323 | case GNUNET_TESTBED_TOPOLOGY_ERDOS_RENYI: | ||
324 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD_RING: | ||
325 | case GNUNET_TESTBED_TOPOLOGY_SMALL_WORLD: | ||
326 | GNUNET_TESTBED_underlay_construct_ (num_peers, | ||
327 | link_processor, | ||
328 | NULL, | ||
329 | topology, | ||
330 | arg_uint1); | ||
331 | break; | ||
332 | |||
333 | case GNUNET_TESTBED_TOPOLOGY_FROM_FILE: | ||
334 | GNUNET_TESTBED_underlay_construct_ (num_peers, | ||
335 | link_processor, | ||
336 | NULL, | ||
337 | topology, | ||
338 | arg_str1); | ||
339 | break; | ||
340 | |||
341 | case GNUNET_TESTBED_TOPOLOGY_SCALE_FREE: | ||
342 | GNUNET_TESTBED_underlay_construct_ (num_peers, | ||
343 | link_processor, | ||
344 | NULL, | ||
345 | topology, | ||
346 | arg_uint1, | ||
347 | arg_uint2); | ||
348 | break; | ||
349 | |||
350 | default: | ||
351 | GNUNET_assert (0); | ||
352 | } | ||
353 | } | 353 | } |
354 | 354 | ||
355 | 355 | ||
@@ -357,25 +357,25 @@ run(void *cls, | |||
357 | * Main | 357 | * Main |
358 | */ | 358 | */ |
359 | int | 359 | int |
360 | main(int argc, char *const argv[]) | 360 | main (int argc, char *const argv[]) |
361 | { | 361 | { |
362 | struct GNUNET_GETOPT_CommandLineOption option[] = { | 362 | struct GNUNET_GETOPT_CommandLineOption option[] = { |
363 | GNUNET_GETOPT_option_uint('p', | 363 | GNUNET_GETOPT_option_uint ('p', |
364 | "num-peers", | 364 | "num-peers", |
365 | "COUNT", | 365 | "COUNT", |
366 | gettext_noop("create COUNT number of peers"), | 366 | gettext_noop ("create COUNT number of peers"), |
367 | &num_peers), | 367 | &num_peers), |
368 | GNUNET_GETOPT_OPTION_END | 368 | GNUNET_GETOPT_OPTION_END |
369 | }; | 369 | }; |
370 | 370 | ||
371 | int ret; | 371 | int ret; |
372 | 372 | ||
373 | exit_result = GNUNET_SYSERR; | 373 | exit_result = GNUNET_SYSERR; |
374 | ret = GNUNET_PROGRAM_run( | 374 | ret = GNUNET_PROGRAM_run ( |
375 | argc, | 375 | argc, |
376 | argv, | 376 | argv, |
377 | "gnunet-underlay-topology", | 377 | "gnunet-underlay-topology", |
378 | _( | 378 | _ ( |
379 | "Generates SQLite3 database representing a given underlay topology.\n" | 379 | "Generates SQLite3 database representing a given underlay topology.\n" |
380 | "Usage: gnunet-underlay-topology [OPTIONS] db-filename TOPO [TOPOOPTS]\n" | 380 | "Usage: gnunet-underlay-topology [OPTIONS] db-filename TOPO [TOPOOPTS]\n" |
381 | "The following options are available for TOPO followed by TOPOOPTS if applicable:\n" | 381 | "The following options are available for TOPO followed by TOPOOPTS if applicable:\n" |
@@ -398,9 +398,9 @@ main(int argc, char *const argv[]) | |||
398 | &run, | 398 | &run, |
399 | NULL); | 399 | NULL); |
400 | if (NULL != stmt_insert) | 400 | if (NULL != stmt_insert) |
401 | sqlite3_finalize(stmt_insert); | 401 | sqlite3_finalize (stmt_insert); |
402 | if (NULL != db) | 402 | if (NULL != db) |
403 | GNUNET_break(SQLITE_OK == sqlite3_close(db)); | 403 | GNUNET_break (SQLITE_OK == sqlite3_close (db)); |
404 | if ((GNUNET_OK != ret) || (GNUNET_OK != exit_result)) | 404 | if ((GNUNET_OK != ret) || (GNUNET_OK != exit_result)) |
405 | return 1; | 405 | return 1; |
406 | return 0; | 406 | return 0; |