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/include/gnunet_sq_lib.h | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/include/gnunet_sq_lib.h')
-rw-r--r-- | src/include/gnunet_sq_lib.h | 99 |
1 files changed, 54 insertions, 45 deletions
diff --git a/src/include/gnunet_sq_lib.h b/src/include/gnunet_sq_lib.h index 31ac0675c..b6b09eb67 100644 --- a/src/include/gnunet_sq_lib.h +++ b/src/include/gnunet_sq_lib.h | |||
@@ -51,7 +51,8 @@ typedef int | |||
51 | /** | 51 | /** |
52 | * @brief Description of a DB query parameter. | 52 | * @brief Description of a DB query parameter. |
53 | */ | 53 | */ |
54 | struct GNUNET_SQ_QueryParam { | 54 | struct GNUNET_SQ_QueryParam |
55 | { | ||
55 | /** | 56 | /** |
56 | * Function for how to handle this type of entry. | 57 | * Function for how to handle this type of entry. |
57 | */ | 58 | */ |
@@ -93,8 +94,8 @@ struct GNUNET_SQ_QueryParam { | |||
93 | * @oaran ptr_size number of bytes in @a ptr | 94 | * @oaran ptr_size number of bytes in @a ptr |
94 | */ | 95 | */ |
95 | struct GNUNET_SQ_QueryParam | 96 | struct GNUNET_SQ_QueryParam |
96 | GNUNET_SQ_query_param_fixed_size(const void *ptr, | 97 | GNUNET_SQ_query_param_fixed_size (const void *ptr, |
97 | size_t ptr_size); | 98 | size_t ptr_size); |
98 | 99 | ||
99 | 100 | ||
100 | 101 | ||
@@ -104,7 +105,7 @@ GNUNET_SQ_query_param_fixed_size(const void *ptr, | |||
104 | * @param ptr pointer to the string query parameter to pass | 105 | * @param ptr pointer to the string query parameter to pass |
105 | */ | 106 | */ |
106 | struct GNUNET_SQ_QueryParam | 107 | struct GNUNET_SQ_QueryParam |
107 | GNUNET_SQ_query_param_string(const char *ptr); | 108 | GNUNET_SQ_query_param_string (const char *ptr); |
108 | 109 | ||
109 | 110 | ||
110 | /** | 111 | /** |
@@ -113,7 +114,8 @@ GNUNET_SQ_query_param_string(const char *ptr); | |||
113 | * | 114 | * |
114 | * @param x pointer to the query parameter to pass. | 115 | * @param x pointer to the query parameter to pass. |
115 | */ | 116 | */ |
116 | #define GNUNET_SQ_query_param_auto_from_type(x) GNUNET_SQ_query_param_fixed_size((x), sizeof(*(x))) | 117 | #define GNUNET_SQ_query_param_auto_from_type( \ |
118 | x) GNUNET_SQ_query_param_fixed_size ((x), sizeof(*(x))) | ||
117 | 119 | ||
118 | 120 | ||
119 | /** | 121 | /** |
@@ -123,7 +125,8 @@ GNUNET_SQ_query_param_string(const char *ptr); | |||
123 | * @param x the query parameter to pass. | 125 | * @param x the query parameter to pass. |
124 | */ | 126 | */ |
125 | struct GNUNET_SQ_QueryParam | 127 | struct GNUNET_SQ_QueryParam |
126 | GNUNET_SQ_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x); | 128 | GNUNET_SQ_query_param_rsa_public_key (const struct |
129 | GNUNET_CRYPTO_RsaPublicKey *x); | ||
127 | 130 | ||
128 | 131 | ||
129 | /** | 132 | /** |
@@ -133,7 +136,8 @@ GNUNET_SQ_query_param_rsa_public_key(const struct GNUNET_CRYPTO_RsaPublicKey *x) | |||
133 | * @param x the query parameter to pass | 136 | * @param x the query parameter to pass |
134 | */ | 137 | */ |
135 | struct GNUNET_SQ_QueryParam | 138 | struct GNUNET_SQ_QueryParam |
136 | GNUNET_SQ_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x); | 139 | GNUNET_SQ_query_param_rsa_signature (const struct |
140 | GNUNET_CRYPTO_RsaSignature *x); | ||
137 | 141 | ||
138 | 142 | ||
139 | /** | 143 | /** |
@@ -143,7 +147,7 @@ GNUNET_SQ_query_param_rsa_signature(const struct GNUNET_CRYPTO_RsaSignature *x); | |||
143 | * @param x pointer to the query parameter to pass | 147 | * @param x pointer to the query parameter to pass |
144 | */ | 148 | */ |
145 | struct GNUNET_SQ_QueryParam | 149 | struct GNUNET_SQ_QueryParam |
146 | GNUNET_SQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); | 150 | GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); |
147 | 151 | ||
148 | 152 | ||
149 | /** | 153 | /** |
@@ -153,7 +157,8 @@ GNUNET_SQ_query_param_absolute_time(const struct GNUNET_TIME_Absolute *x); | |||
153 | * @param x pointer to the query parameter to pass | 157 | * @param x pointer to the query parameter to pass |
154 | */ | 158 | */ |
155 | struct GNUNET_SQ_QueryParam | 159 | struct GNUNET_SQ_QueryParam |
156 | GNUNET_SQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x); | 160 | GNUNET_SQ_query_param_absolute_time_nbo (const struct |
161 | GNUNET_TIME_AbsoluteNBO *x); | ||
157 | 162 | ||
158 | 163 | ||
159 | /** | 164 | /** |
@@ -162,7 +167,7 @@ GNUNET_SQ_query_param_absolute_time_nbo(const struct GNUNET_TIME_AbsoluteNBO *x) | |||
162 | * @param x pointer to the query parameter to pass | 167 | * @param x pointer to the query parameter to pass |
163 | */ | 168 | */ |
164 | struct GNUNET_SQ_QueryParam | 169 | struct GNUNET_SQ_QueryParam |
165 | GNUNET_SQ_query_param_uint16(const uint16_t *x); | 170 | GNUNET_SQ_query_param_uint16 (const uint16_t *x); |
166 | 171 | ||
167 | 172 | ||
168 | /** | 173 | /** |
@@ -171,7 +176,7 @@ GNUNET_SQ_query_param_uint16(const uint16_t *x); | |||
171 | * @param x pointer to the query parameter to pass | 176 | * @param x pointer to the query parameter to pass |
172 | */ | 177 | */ |
173 | struct GNUNET_SQ_QueryParam | 178 | struct GNUNET_SQ_QueryParam |
174 | GNUNET_SQ_query_param_uint32(const uint32_t *x); | 179 | GNUNET_SQ_query_param_uint32 (const uint32_t *x); |
175 | 180 | ||
176 | 181 | ||
177 | /** | 182 | /** |
@@ -180,7 +185,7 @@ GNUNET_SQ_query_param_uint32(const uint32_t *x); | |||
180 | * @param x pointer to the query parameter to pass | 185 | * @param x pointer to the query parameter to pass |
181 | */ | 186 | */ |
182 | struct GNUNET_SQ_QueryParam | 187 | struct GNUNET_SQ_QueryParam |
183 | GNUNET_SQ_query_param_uint64(const uint64_t *x); | 188 | GNUNET_SQ_query_param_uint64 (const uint64_t *x); |
184 | 189 | ||
185 | 190 | ||
186 | /** | 191 | /** |
@@ -191,8 +196,8 @@ GNUNET_SQ_query_param_uint64(const uint64_t *x); | |||
191 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 196 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
192 | */ | 197 | */ |
193 | int | 198 | int |
194 | GNUNET_SQ_bind(sqlite3_stmt *stmt, | 199 | GNUNET_SQ_bind (sqlite3_stmt *stmt, |
195 | const struct GNUNET_SQ_QueryParam *params); | 200 | const struct GNUNET_SQ_QueryParam *params); |
196 | 201 | ||
197 | 202 | ||
198 | /** | 203 | /** |
@@ -202,8 +207,8 @@ GNUNET_SQ_bind(sqlite3_stmt *stmt, | |||
202 | * @param stmt statement to reset | 207 | * @param stmt statement to reset |
203 | */ | 208 | */ |
204 | void | 209 | void |
205 | GNUNET_SQ_reset(sqlite3 *dbh, | 210 | GNUNET_SQ_reset (sqlite3 *dbh, |
206 | sqlite3_stmt *stmt); | 211 | sqlite3_stmt *stmt); |
207 | 212 | ||
208 | 213 | ||
209 | /** | 214 | /** |
@@ -245,7 +250,8 @@ typedef void | |||
245 | /** | 250 | /** |
246 | * @brief Description of a DB result cell. | 251 | * @brief Description of a DB result cell. |
247 | */ | 252 | */ |
248 | struct GNUNET_SQ_ResultSpec { | 253 | struct GNUNET_SQ_ResultSpec |
254 | { | ||
249 | /** | 255 | /** |
250 | * What is the format of the result? | 256 | * What is the format of the result? |
251 | */ | 257 | */ |
@@ -304,8 +310,8 @@ struct GNUNET_SQ_ResultSpec { | |||
304 | * @return array entry for the result specification to use | 310 | * @return array entry for the result specification to use |
305 | */ | 311 | */ |
306 | struct GNUNET_SQ_ResultSpec | 312 | struct GNUNET_SQ_ResultSpec |
307 | GNUNET_SQ_result_spec_variable_size(void **dst, | 313 | GNUNET_SQ_result_spec_variable_size (void **dst, |
308 | size_t *sptr); | 314 | size_t *sptr); |
309 | 315 | ||
310 | 316 | ||
311 | /** | 317 | /** |
@@ -316,8 +322,8 @@ GNUNET_SQ_result_spec_variable_size(void **dst, | |||
316 | * @return array entry for the result specification to use | 322 | * @return array entry for the result specification to use |
317 | */ | 323 | */ |
318 | struct GNUNET_SQ_ResultSpec | 324 | struct GNUNET_SQ_ResultSpec |
319 | GNUNET_SQ_result_spec_fixed_size(void *dst, | 325 | GNUNET_SQ_result_spec_fixed_size (void *dst, |
320 | size_t dst_size); | 326 | size_t dst_size); |
321 | 327 | ||
322 | 328 | ||
323 | /** | 329 | /** |
@@ -326,7 +332,8 @@ GNUNET_SQ_result_spec_fixed_size(void *dst, | |||
326 | * @param dst point to where to store the result, type fits expected result size | 332 | * @param dst point to where to store the result, type fits expected result size |
327 | * @return array entry for the result specification to use | 333 | * @return array entry for the result specification to use |
328 | */ | 334 | */ |
329 | #define GNUNET_SQ_result_spec_auto_from_type(dst) GNUNET_SQ_result_spec_fixed_size((dst), sizeof(*(dst))) | 335 | #define GNUNET_SQ_result_spec_auto_from_type( \ |
336 | dst) GNUNET_SQ_result_spec_fixed_size ((dst), sizeof(*(dst))) | ||
330 | 337 | ||
331 | 338 | ||
332 | /** | 339 | /** |
@@ -337,8 +344,8 @@ GNUNET_SQ_result_spec_fixed_size(void *dst, | |||
337 | * @return array entry for the result specification to use | 344 | * @return array entry for the result specification to use |
338 | */ | 345 | */ |
339 | struct GNUNET_SQ_ResultSpec | 346 | struct GNUNET_SQ_ResultSpec |
340 | GNUNET_SQ_result_spec_variable_size(void **dst, | 347 | GNUNET_SQ_result_spec_variable_size (void **dst, |
341 | size_t *sptr); | 348 | size_t *sptr); |
342 | 349 | ||
343 | 350 | ||
344 | /** | 351 | /** |
@@ -348,7 +355,7 @@ GNUNET_SQ_result_spec_variable_size(void **dst, | |||
348 | * @return array entry for the result specification to use | 355 | * @return array entry for the result specification to use |
349 | */ | 356 | */ |
350 | struct GNUNET_SQ_ResultSpec | 357 | struct GNUNET_SQ_ResultSpec |
351 | GNUNET_SQ_result_spec_string(char **dst); | 358 | GNUNET_SQ_result_spec_string (char **dst); |
352 | 359 | ||
353 | 360 | ||
354 | /** | 361 | /** |
@@ -358,7 +365,7 @@ GNUNET_SQ_result_spec_string(char **dst); | |||
358 | * @return array entry for the result specification to use | 365 | * @return array entry for the result specification to use |
359 | */ | 366 | */ |
360 | struct GNUNET_SQ_ResultSpec | 367 | struct GNUNET_SQ_ResultSpec |
361 | GNUNET_SQ_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa); | 368 | GNUNET_SQ_result_spec_rsa_public_key (struct GNUNET_CRYPTO_RsaPublicKey **rsa); |
362 | 369 | ||
363 | 370 | ||
364 | /** | 371 | /** |
@@ -368,7 +375,7 @@ GNUNET_SQ_result_spec_rsa_public_key(struct GNUNET_CRYPTO_RsaPublicKey **rsa); | |||
368 | * @return array entry for the result specification to use | 375 | * @return array entry for the result specification to use |
369 | */ | 376 | */ |
370 | struct GNUNET_SQ_ResultSpec | 377 | struct GNUNET_SQ_ResultSpec |
371 | GNUNET_SQ_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig); | 378 | GNUNET_SQ_result_spec_rsa_signature (struct GNUNET_CRYPTO_RsaSignature **sig); |
372 | 379 | ||
373 | 380 | ||
374 | /** | 381 | /** |
@@ -378,7 +385,7 @@ GNUNET_SQ_result_spec_rsa_signature(struct GNUNET_CRYPTO_RsaSignature **sig); | |||
378 | * @return array entry for the result specification to use | 385 | * @return array entry for the result specification to use |
379 | */ | 386 | */ |
380 | struct GNUNET_SQ_ResultSpec | 387 | struct GNUNET_SQ_ResultSpec |
381 | GNUNET_SQ_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at); | 388 | GNUNET_SQ_result_spec_absolute_time (struct GNUNET_TIME_Absolute *at); |
382 | 389 | ||
383 | 390 | ||
384 | /** | 391 | /** |
@@ -388,7 +395,7 @@ GNUNET_SQ_result_spec_absolute_time(struct GNUNET_TIME_Absolute *at); | |||
388 | * @return array entry for the result specification to use | 395 | * @return array entry for the result specification to use |
389 | */ | 396 | */ |
390 | struct GNUNET_SQ_ResultSpec | 397 | struct GNUNET_SQ_ResultSpec |
391 | GNUNET_SQ_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at); | 398 | GNUNET_SQ_result_spec_absolute_time_nbo (struct GNUNET_TIME_AbsoluteNBO *at); |
392 | 399 | ||
393 | 400 | ||
394 | /** | 401 | /** |
@@ -398,7 +405,7 @@ GNUNET_SQ_result_spec_absolute_time_nbo(struct GNUNET_TIME_AbsoluteNBO *at); | |||
398 | * @return array entry for the result specification to use | 405 | * @return array entry for the result specification to use |
399 | */ | 406 | */ |
400 | struct GNUNET_SQ_ResultSpec | 407 | struct GNUNET_SQ_ResultSpec |
401 | GNUNET_SQ_result_spec_uint16(uint16_t *u16); | 408 | GNUNET_SQ_result_spec_uint16 (uint16_t *u16); |
402 | 409 | ||
403 | 410 | ||
404 | /** | 411 | /** |
@@ -408,7 +415,7 @@ GNUNET_SQ_result_spec_uint16(uint16_t *u16); | |||
408 | * @return array entry for the result specification to use | 415 | * @return array entry for the result specification to use |
409 | */ | 416 | */ |
410 | struct GNUNET_SQ_ResultSpec | 417 | struct GNUNET_SQ_ResultSpec |
411 | GNUNET_SQ_result_spec_uint32(uint32_t *u32); | 418 | GNUNET_SQ_result_spec_uint32 (uint32_t *u32); |
412 | 419 | ||
413 | 420 | ||
414 | /** | 421 | /** |
@@ -418,7 +425,7 @@ GNUNET_SQ_result_spec_uint32(uint32_t *u32); | |||
418 | * @return array entry for the result specification to use | 425 | * @return array entry for the result specification to use |
419 | */ | 426 | */ |
420 | struct GNUNET_SQ_ResultSpec | 427 | struct GNUNET_SQ_ResultSpec |
421 | GNUNET_SQ_result_spec_uint64(uint64_t *u64); | 428 | GNUNET_SQ_result_spec_uint64 (uint64_t *u64); |
422 | 429 | ||
423 | 430 | ||
424 | /** | 431 | /** |
@@ -431,8 +438,8 @@ GNUNET_SQ_result_spec_uint64(uint64_t *u64); | |||
431 | * #GNUNET_SYSERR if a result was invalid (non-existing field) | 438 | * #GNUNET_SYSERR if a result was invalid (non-existing field) |
432 | */ | 439 | */ |
433 | int | 440 | int |
434 | GNUNET_SQ_extract_result(sqlite3_stmt *result, | 441 | GNUNET_SQ_extract_result (sqlite3_stmt *result, |
435 | struct GNUNET_SQ_ResultSpec *rs); | 442 | struct GNUNET_SQ_ResultSpec *rs); |
436 | 443 | ||
437 | 444 | ||
438 | /** | 445 | /** |
@@ -442,7 +449,7 @@ GNUNET_SQ_extract_result(sqlite3_stmt *result, | |||
442 | * @param rs reult specification to clean up | 449 | * @param rs reult specification to clean up |
443 | */ | 450 | */ |
444 | void | 451 | void |
445 | GNUNET_SQ_cleanup_result(struct GNUNET_SQ_ResultSpec *rs); | 452 | GNUNET_SQ_cleanup_result (struct GNUNET_SQ_ResultSpec *rs); |
446 | 453 | ||
447 | 454 | ||
448 | 455 | ||
@@ -453,7 +460,8 @@ GNUNET_SQ_cleanup_result(struct GNUNET_SQ_ResultSpec *rs); | |||
453 | * Information needed to run a list of SQL statements using | 460 | * Information needed to run a list of SQL statements using |
454 | * #GNUNET_SQ_exec_statements(). | 461 | * #GNUNET_SQ_exec_statements(). |
455 | */ | 462 | */ |
456 | struct GNUNET_SQ_PrepareStatement { | 463 | struct GNUNET_SQ_PrepareStatement |
464 | { | ||
457 | /** | 465 | /** |
458 | * Actual SQL statement. | 466 | * Actual SQL statement. |
459 | */ | 467 | */ |
@@ -480,8 +488,8 @@ struct GNUNET_SQ_PrepareStatement { | |||
480 | * @return initialized struct | 488 | * @return initialized struct |
481 | */ | 489 | */ |
482 | struct GNUNET_SQ_PrepareStatement | 490 | struct GNUNET_SQ_PrepareStatement |
483 | GNUNET_SQ_make_prepare(const char *sql, | 491 | GNUNET_SQ_make_prepare (const char *sql, |
484 | sqlite3_stmt **pstmt); | 492 | sqlite3_stmt **pstmt); |
485 | 493 | ||
486 | 494 | ||
487 | 495 | ||
@@ -494,8 +502,8 @@ GNUNET_SQ_make_prepare(const char *sql, | |||
494 | * @return #GNUNET_OK on success | 502 | * @return #GNUNET_OK on success |
495 | */ | 503 | */ |
496 | int | 504 | int |
497 | GNUNET_SQ_prepare(sqlite3 *dbh, | 505 | GNUNET_SQ_prepare (sqlite3 *dbh, |
498 | const struct GNUNET_SQ_PrepareStatement *ps); | 506 | const struct GNUNET_SQ_PrepareStatement *ps); |
499 | 507 | ||
500 | 508 | ||
501 | /* ******************** sq_exec.c functions ************** */ | 509 | /* ******************** sq_exec.c functions ************** */ |
@@ -505,7 +513,8 @@ GNUNET_SQ_prepare(sqlite3 *dbh, | |||
505 | * Information needed to run a list of SQL statements using | 513 | * Information needed to run a list of SQL statements using |
506 | * #GNUNET_SQ_exec_statements(). | 514 | * #GNUNET_SQ_exec_statements(). |
507 | */ | 515 | */ |
508 | struct GNUNET_SQ_ExecuteStatement { | 516 | struct GNUNET_SQ_ExecuteStatement |
517 | { | ||
509 | /** | 518 | /** |
510 | * Actual SQL statement. | 519 | * Actual SQL statement. |
511 | */ | 520 | */ |
@@ -531,7 +540,7 @@ struct GNUNET_SQ_ExecuteStatement { | |||
531 | * @return initialized struct | 540 | * @return initialized struct |
532 | */ | 541 | */ |
533 | struct GNUNET_SQ_ExecuteStatement | 542 | struct GNUNET_SQ_ExecuteStatement |
534 | GNUNET_SQ_make_execute(const char *sql); | 543 | GNUNET_SQ_make_execute (const char *sql); |
535 | 544 | ||
536 | 545 | ||
537 | /** | 546 | /** |
@@ -542,7 +551,7 @@ GNUNET_SQ_make_execute(const char *sql); | |||
542 | * @return initialized struct | 551 | * @return initialized struct |
543 | */ | 552 | */ |
544 | struct GNUNET_SQ_ExecuteStatement | 553 | struct GNUNET_SQ_ExecuteStatement |
545 | GNUNET_SQ_make_try_execute(const char *sql); | 554 | GNUNET_SQ_make_try_execute (const char *sql); |
546 | 555 | ||
547 | 556 | ||
548 | /** | 557 | /** |
@@ -555,8 +564,8 @@ GNUNET_SQ_make_try_execute(const char *sql); | |||
555 | * #GNUNET_SYSERR on error | 564 | * #GNUNET_SYSERR on error |
556 | */ | 565 | */ |
557 | int | 566 | int |
558 | GNUNET_SQ_exec_statements(sqlite3 *dbh, | 567 | GNUNET_SQ_exec_statements (sqlite3 *dbh, |
559 | const struct GNUNET_SQ_ExecuteStatement *es); | 568 | const struct GNUNET_SQ_ExecuteStatement *es); |
560 | 569 | ||
561 | 570 | ||
562 | 571 | ||