diff options
author | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-06-07 13:50:08 +0000 |
---|---|---|
committer | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-06-07 13:50:08 +0000 |
commit | f12ac33d46fad89af94831f16dcdebd436a851da (patch) | |
tree | 0e79ed94a2348be62f8c683421251d69bcc159f3 /src/include/gnunet_my_lib.h | |
parent | ec817d5981e88f06f9f153cd423d13860fba4b57 (diff) | |
download | gnunet-f12ac33d46fad89af94831f16dcdebd436a851da.tar.gz gnunet-f12ac33d46fad89af94831f16dcdebd436a851da.zip |
written function cleanup
Diffstat (limited to 'src/include/gnunet_my_lib.h')
-rw-r--r-- | src/include/gnunet_my_lib.h | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/include/gnunet_my_lib.h b/src/include/gnunet_my_lib.h index f42276554..534a4db40 100644 --- a/src/include/gnunet_my_lib.h +++ b/src/include/gnunet_my_lib.h | |||
@@ -66,9 +66,20 @@ typedef int | |||
66 | 66 | ||
67 | 67 | ||
68 | /** | 68 | /** |
69 | * Function called to cleanup result data. | ||
70 | * | ||
71 | * @param cls closure | ||
72 | * @param rs spec to clean up | ||
73 | */ | ||
74 | typedef void | ||
75 | (*GNUNET_MY_QueryCleanup)(void *cls, | ||
76 | struct GNUNET_MY_QueryParam *qp); | ||
77 | /** | ||
69 | * Information we pass to #GNUNET_MY_exec_prepared() to | 78 | * Information we pass to #GNUNET_MY_exec_prepared() to |
70 | * initialize the arguments of the prepared statement. | 79 | * initialize the arguments of the prepared statement. |
71 | */ | 80 | */ |
81 | |||
82 | |||
72 | struct GNUNET_MY_QueryParam | 83 | struct GNUNET_MY_QueryParam |
73 | { | 84 | { |
74 | 85 | ||
@@ -77,6 +88,11 @@ struct GNUNET_MY_QueryParam | |||
77 | */ | 88 | */ |
78 | GNUNET_MY_QueryConverter conv; | 89 | GNUNET_MY_QueryConverter conv; |
79 | 90 | ||
91 | /** | ||
92 | * Function to call for cleaning up the query. Can be NULL. | ||
93 | */ | ||
94 | GNUNET_MY_QueryCleanup cleaner; | ||
95 | |||
80 | /** | 96 | /** |
81 | * Closure for @e conv. | 97 | * Closure for @e conv. |
82 | */ | 98 | */ |
@@ -104,7 +120,7 @@ struct GNUNET_MY_QueryParam | |||
104 | * | 120 | * |
105 | * @return array last entry for the result specification to use | 121 | * @return array last entry for the result specification to use |
106 | */ | 122 | */ |
107 | #define GNUNET_MY_query_param_end { NULL, NULL, 0, NULL, 0 } | 123 | #define GNUNET_MY_query_param_end { NULL, NULL, NULL, 0, NULL, 0 } |
108 | 124 | ||
109 | 125 | ||
110 | 126 | ||
@@ -447,6 +463,15 @@ GNUNET_MY_extract_result (struct GNUNET_MYSQL_StatementHandle *sh, | |||
447 | struct GNUNET_MY_ResultSpec *specs); | 463 | struct GNUNET_MY_ResultSpec *specs); |
448 | 464 | ||
449 | 465 | ||
466 | /** | ||
467 | * Free all memory that was allocated in @a qp during | ||
468 | * #GNUNET_MY_exect_prepared(). | ||
469 | * | ||
470 | * @param qp query specification to clean up | ||
471 | */ | ||
472 | void | ||
473 | GNUNET_MY_cleanup_query (struct GNUNET_MY_QueryParam *qp); | ||
474 | |||
450 | 475 | ||
451 | /** | 476 | /** |
452 | * Free all memory that was allocated in @a rs during | 477 | * Free all memory that was allocated in @a rs during |