diff options
Diffstat (limited to 'src/include/gnunet_sq_lib.h')
-rw-r--r-- | src/include/gnunet_sq_lib.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/include/gnunet_sq_lib.h b/src/include/gnunet_sq_lib.h index 21ce5b393..b84e6759a 100644 --- a/src/include/gnunet_sq_lib.h +++ b/src/include/gnunet_sq_lib.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #ifndef GNUNET_SQ_LIB_H | 25 | #ifndef GNUNET_SQ_LIB_H |
26 | #define GNUNET_SQ_LIB_H | 26 | #define GNUNET_SQ_LIB_H |
27 | 27 | ||
28 | |||
28 | #include <sqlite3.h> | 29 | #include <sqlite3.h> |
29 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
30 | 31 | ||
@@ -40,7 +41,7 @@ | |||
40 | * so immediately suitable for passing to `sqlite3_bind`-functions. | 41 | * so immediately suitable for passing to `sqlite3_bind`-functions. |
41 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success | 42 | * @return #GNUNET_SYSERR on error, #GNUNET_OK on success |
42 | */ | 43 | */ |
43 | typedef int | 44 | typedef enum GNUNET_GenericReturnValue |
44 | (*GNUNET_SQ_QueryConverter)(void *cls, | 45 | (*GNUNET_SQ_QueryConverter)(void *cls, |
45 | const void *data, | 46 | const void *data, |
46 | size_t data_len, | 47 | size_t data_len, |
@@ -91,7 +92,7 @@ struct GNUNET_SQ_QueryParam | |||
91 | * @a ptr_size bytes. | 92 | * @a ptr_size bytes. |
92 | * | 93 | * |
93 | * @param ptr pointer to the query parameter to pass | 94 | * @param ptr pointer to the query parameter to pass |
94 | * @oaran ptr_size number of bytes in @a ptr | 95 | * @param ptr_size number of bytes in @a ptr |
95 | */ | 96 | */ |
96 | struct GNUNET_SQ_QueryParam | 97 | struct GNUNET_SQ_QueryParam |
97 | GNUNET_SQ_query_param_fixed_size (const void *ptr, | 98 | GNUNET_SQ_query_param_fixed_size (const void *ptr, |
@@ -156,8 +157,8 @@ GNUNET_SQ_query_param_absolute_time (const struct GNUNET_TIME_Absolute *x); | |||
156 | * @param x pointer to the query parameter to pass | 157 | * @param x pointer to the query parameter to pass |
157 | */ | 158 | */ |
158 | struct GNUNET_SQ_QueryParam | 159 | struct GNUNET_SQ_QueryParam |
159 | GNUNET_SQ_query_param_absolute_time_nbo (const struct | 160 | GNUNET_SQ_query_param_absolute_time_nbo ( |
160 | GNUNET_TIME_AbsoluteNBO *x); | 161 | const struct GNUNET_TIME_AbsoluteNBO *x); |
161 | 162 | ||
162 | 163 | ||
163 | /** | 164 | /** |
@@ -194,7 +195,7 @@ GNUNET_SQ_query_param_uint64 (const uint64_t *x); | |||
194 | * @param params parameters to the statement | 195 | * @param params parameters to the statement |
195 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | 196 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error |
196 | */ | 197 | */ |
197 | int | 198 | enum GNUNET_GenericReturnValue |
198 | GNUNET_SQ_bind (sqlite3_stmt *stmt, | 199 | GNUNET_SQ_bind (sqlite3_stmt *stmt, |
199 | const struct GNUNET_SQ_QueryParam *params); | 200 | const struct GNUNET_SQ_QueryParam *params); |
200 | 201 | ||
@@ -222,7 +223,7 @@ GNUNET_SQ_reset (sqlite3 *dbh, | |||
222 | * #GNUNET_YES if all results could be extracted | 223 | * #GNUNET_YES if all results could be extracted |
223 | * #GNUNET_SYSERR if a result was invalid (non-existing field or NULL) | 224 | * #GNUNET_SYSERR if a result was invalid (non-existing field or NULL) |
224 | */ | 225 | */ |
225 | typedef int | 226 | typedef enum GNUNET_GenericReturnValue |
226 | (*GNUNET_SQ_ResultConverter)(void *cls, | 227 | (*GNUNET_SQ_ResultConverter)(void *cls, |
227 | sqlite3_stmt *result, | 228 | sqlite3_stmt *result, |
228 | unsigned int column, | 229 | unsigned int column, |
@@ -436,7 +437,7 @@ GNUNET_SQ_result_spec_uint64 (uint64_t *u64); | |||
436 | * #GNUNET_OK if all results could be extracted | 437 | * #GNUNET_OK if all results could be extracted |
437 | * #GNUNET_SYSERR if a result was invalid (non-existing field) | 438 | * #GNUNET_SYSERR if a result was invalid (non-existing field) |
438 | */ | 439 | */ |
439 | int | 440 | enum GNUNET_GenericReturnValue |
440 | GNUNET_SQ_extract_result (sqlite3_stmt *result, | 441 | GNUNET_SQ_extract_result (sqlite3_stmt *result, |
441 | struct GNUNET_SQ_ResultSpec *rs); | 442 | struct GNUNET_SQ_ResultSpec *rs); |
442 | 443 | ||
@@ -498,7 +499,7 @@ GNUNET_SQ_make_prepare (const char *sql, | |||
498 | * @param ps array of statements to prepare | 499 | * @param ps array of statements to prepare |
499 | * @return #GNUNET_OK on success | 500 | * @return #GNUNET_OK on success |
500 | */ | 501 | */ |
501 | int | 502 | enum GNUNET_GenericReturnValue |
502 | GNUNET_SQ_prepare (sqlite3 *dbh, | 503 | GNUNET_SQ_prepare (sqlite3 *dbh, |
503 | const struct GNUNET_SQ_PrepareStatement *ps); | 504 | const struct GNUNET_SQ_PrepareStatement *ps); |
504 | 505 | ||
@@ -520,7 +521,7 @@ struct GNUNET_SQ_ExecuteStatement | |||
520 | /** | 521 | /** |
521 | * Should we ignore errors? | 522 | * Should we ignore errors? |
522 | */ | 523 | */ |
523 | int ignore_errors; | 524 | bool ignore_errors; |
524 | }; | 525 | }; |
525 | 526 | ||
526 | 527 | ||
@@ -560,7 +561,7 @@ GNUNET_SQ_make_try_execute (const char *sql); | |||
560 | * @return #GNUNET_OK on success (modulo statements where errors can be ignored) | 561 | * @return #GNUNET_OK on success (modulo statements where errors can be ignored) |
561 | * #GNUNET_SYSERR on error | 562 | * #GNUNET_SYSERR on error |
562 | */ | 563 | */ |
563 | int | 564 | enum GNUNET_GenericReturnValue |
564 | GNUNET_SQ_exec_statements (sqlite3 *dbh, | 565 | GNUNET_SQ_exec_statements (sqlite3 *dbh, |
565 | const struct GNUNET_SQ_ExecuteStatement *es); | 566 | const struct GNUNET_SQ_ExecuteStatement *es); |
566 | 567 | ||