diff options
author | Christian Grothoff <christian@grothoff.org> | 2015-07-18 13:33:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2015-07-18 13:33:10 +0000 |
commit | 957ba741a643ac853f7cd6c00f05f41cf57d8d59 (patch) | |
tree | 98acdb5bcf1e0cf959100e7e0416a14ccd270550 /src/include/gnunet_datastore_plugin.h | |
parent | d38544730123a1f365ef287a7e88060d97b266b7 (diff) | |
download | gnunet-957ba741a643ac853f7cd6c00f05f41cf57d8d59.tar.gz gnunet-957ba741a643ac853f7cd6c00f05f41cf57d8d59.zip |
-adding missing 'const' decls, fixing indentation / doxygen a bit
Diffstat (limited to 'src/include/gnunet_datastore_plugin.h')
-rw-r--r-- | src/include/gnunet_datastore_plugin.h | 118 |
1 files changed, 76 insertions, 42 deletions
diff --git a/src/include/gnunet_datastore_plugin.h b/src/include/gnunet_datastore_plugin.h index fc13645e5..08093d55e 100644 --- a/src/include/gnunet_datastore_plugin.h +++ b/src/include/gnunet_datastore_plugin.h | |||
@@ -48,7 +48,9 @@ | |||
48 | * @param delta change in disk utilization, | 48 | * @param delta change in disk utilization, |
49 | * 0 for "reset to empty" | 49 | * 0 for "reset to empty" |
50 | */ | 50 | */ |
51 | typedef void (*DiskUtilizationChange) (void *cls, int delta); | 51 | typedef void |
52 | (*GNUNET_DATASTORE_DiskUtilizationChange) (void *cls, | ||
53 | int delta); | ||
52 | 54 | ||
53 | 55 | ||
54 | /** | 56 | /** |
@@ -66,7 +68,7 @@ struct GNUNET_DATASTORE_PluginEnvironment | |||
66 | /** | 68 | /** |
67 | * Function to call on disk utilization change. | 69 | * Function to call on disk utilization change. |
68 | */ | 70 | */ |
69 | DiskUtilizationChange duc; | 71 | GNUNET_DATASTORE_DiskUtilizationChange duc; |
70 | 72 | ||
71 | /** | 73 | /** |
72 | * Closure. | 74 | * Closure. |
@@ -91,12 +93,17 @@ struct GNUNET_DATASTORE_PluginEnvironment | |||
91 | * @return #GNUNET_OK to keep the item | 93 | * @return #GNUNET_OK to keep the item |
92 | * #GNUNET_NO to delete the item | 94 | * #GNUNET_NO to delete the item |
93 | */ | 95 | */ |
94 | typedef int (*PluginDatumProcessor) (void *cls, const struct GNUNET_HashCode * key, | 96 | typedef int |
95 | uint32_t size, const void *data, | 97 | (*PluginDatumProcessor) (void *cls, |
96 | enum GNUNET_BLOCK_Type type, | 98 | const struct GNUNET_HashCode *key, |
97 | uint32_t priority, uint32_t anonymity, | 99 | uint32_t size, |
98 | struct GNUNET_TIME_Absolute expiration, | 100 | const void *data, |
99 | uint64_t uid); | 101 | enum GNUNET_BLOCK_Type type, |
102 | uint32_t priority, | ||
103 | uint32_t anonymity, | ||
104 | struct GNUNET_TIME_Absolute expiration, | ||
105 | uint64_t uid); | ||
106 | |||
100 | 107 | ||
101 | /** | 108 | /** |
102 | * Get an estimate of how much space the database is | 109 | * Get an estimate of how much space the database is |
@@ -109,7 +116,9 @@ typedef int (*PluginDatumProcessor) (void *cls, const struct GNUNET_HashCode * k | |||
109 | * @param estimate location to store estimate | 116 | * @param estimate location to store estimate |
110 | * @return number of bytes used on disk | 117 | * @return number of bytes used on disk |
111 | */ | 118 | */ |
112 | typedef void (*PluginEstimateSize) (void *cls, unsigned long long *estimate); | 119 | typedef void |
120 | (*PluginEstimateSize) (void *cls, | ||
121 | unsigned long long *estimate); | ||
113 | 122 | ||
114 | 123 | ||
115 | /** | 124 | /** |
@@ -118,11 +127,15 @@ typedef void (*PluginEstimateSize) (void *cls, unsigned long long *estimate); | |||
118 | * @param cls closure | 127 | * @param cls closure |
119 | * @param key key for the item stored | 128 | * @param key key for the item stored |
120 | * @param size size of the item stored | 129 | * @param size size of the item stored |
121 | * @param status GNUNET_OK or GNUNET_SYSERROR | 130 | * @param status #GNUNET_OK or #GNUNET_SYSERROR |
122 | * @param msg error message on error | 131 | * @param msg error message on error |
123 | */ | 132 | */ |
124 | typedef void (*PluginPutCont) (void *cls, const struct GNUNET_HashCode *key, | 133 | typedef void |
125 | uint32_t size, int status, char *msg); | 134 | (*PluginPutCont) (void *cls, |
135 | const struct GNUNET_HashCode *key, | ||
136 | uint32_t size, | ||
137 | int status, | ||
138 | const char *msg); | ||
126 | 139 | ||
127 | 140 | ||
128 | /** | 141 | /** |
@@ -140,15 +153,19 @@ typedef void (*PluginPutCont) (void *cls, const struct GNUNET_HashCode *key, | |||
140 | * @param replication replication-level for the content | 153 | * @param replication replication-level for the content |
141 | * @param expiration expiration time for the content | 154 | * @param expiration expiration time for the content |
142 | * @param cont continuation called with success or failure status | 155 | * @param cont continuation called with success or failure status |
143 | * @param cont_cls continuation closure | 156 | * @param cont_cls continuation closure for @a cont |
144 | */ | 157 | */ |
145 | typedef void (*PluginPut) (void *cls, const struct GNUNET_HashCode * key, | 158 | typedef void |
146 | uint32_t size, | 159 | (*PluginPut) (void *cls, const struct GNUNET_HashCode *key, |
147 | const void *data, enum GNUNET_BLOCK_Type type, | 160 | uint32_t size, |
148 | uint32_t priority, uint32_t anonymity, | 161 | const void *data, |
149 | uint32_t replication, | 162 | enum GNUNET_BLOCK_Type type, |
150 | struct GNUNET_TIME_Absolute expiration, | 163 | uint32_t priority, |
151 | PluginPutCont cont, void *cont_cls); | 164 | uint32_t anonymity, |
165 | uint32_t replication, | ||
166 | struct GNUNET_TIME_Absolute expiration, | ||
167 | PluginPutCont cont, | ||
168 | void *cont_cls); | ||
152 | 169 | ||
153 | 170 | ||
154 | /** | 171 | /** |
@@ -158,9 +175,10 @@ typedef void (*PluginPut) (void *cls, const struct GNUNET_HashCode * key, | |||
158 | * @param key key in the data store, if NULL iteration is finished | 175 | * @param key key in the data store, if NULL iteration is finished |
159 | * @param count how many values are stored under this key in the datastore | 176 | * @param count how many values are stored under this key in the datastore |
160 | */ | 177 | */ |
161 | typedef void (*PluginKeyProcessor) (void *cls, | 178 | typedef void |
162 | const struct GNUNET_HashCode *key, | 179 | (*PluginKeyProcessor) (void *cls, |
163 | unsigned int count); | 180 | const struct GNUNET_HashCode *key, |
181 | unsigned int count); | ||
164 | 182 | ||
165 | 183 | ||
166 | /** | 184 | /** |
@@ -170,8 +188,9 @@ typedef void (*PluginKeyProcessor) (void *cls, | |||
170 | * @param proc function to call on each key | 188 | * @param proc function to call on each key |
171 | * @param proc_cls closure for @a proc | 189 | * @param proc_cls closure for @a proc |
172 | */ | 190 | */ |
173 | typedef void (*PluginGetKeys) (void *cls, | 191 | typedef void |
174 | PluginKeyProcessor proc, void *proc_cls); | 192 | (*PluginGetKeys) (void *cls, |
193 | PluginKeyProcessor proc, void *proc_cls); | ||
175 | 194 | ||
176 | 195 | ||
177 | /** | 196 | /** |
@@ -192,11 +211,14 @@ typedef void (*PluginGetKeys) (void *cls, | |||
192 | * proc should be called with NULL if there is no result | 211 | * proc should be called with NULL if there is no result |
193 | * @param proc_cls closure for @a proc | 212 | * @param proc_cls closure for @a proc |
194 | */ | 213 | */ |
195 | typedef void (*PluginGetKey) (void *cls, uint64_t offset, | 214 | typedef void |
196 | const struct GNUNET_HashCode * key, | 215 | (*PluginGetKey) (void *cls, |
197 | const struct GNUNET_HashCode * vhash, | 216 | uint64_t offset, |
198 | enum GNUNET_BLOCK_Type type, | 217 | const struct GNUNET_HashCode *key, |
199 | PluginDatumProcessor proc, void *proc_cls); | 218 | const struct GNUNET_HashCode *vhash, |
219 | enum GNUNET_BLOCK_Type type, | ||
220 | PluginDatumProcessor proc, | ||
221 | void *proc_cls); | ||
200 | 222 | ||
201 | 223 | ||
202 | /** | 224 | /** |
@@ -209,18 +231,23 @@ typedef void (*PluginGetKey) (void *cls, uint64_t offset, | |||
209 | * @param proc function to call the value (once only). | 231 | * @param proc function to call the value (once only). |
210 | * @param proc_cls closure for @a proc | 232 | * @param proc_cls closure for @a proc |
211 | */ | 233 | */ |
212 | typedef void (*PluginGetRandom) (void *cls, PluginDatumProcessor proc, | 234 | typedef void |
213 | void *proc_cls); | 235 | (*PluginGetRandom) (void *cls, |
236 | PluginDatumProcessor proc, | ||
237 | void *proc_cls); | ||
214 | 238 | ||
215 | 239 | ||
216 | /** | 240 | /** |
217 | * Update continuation. | 241 | * Update continuation. |
218 | * | 242 | * |
219 | * @param cls closure | 243 | * @param cls closure |
220 | * @param status GNUNET_OK or GNUNET_SYSERROR | 244 | * @param status #GNUNET_OK or #GNUNET_SYSERROR |
221 | * @param msg error message on error | 245 | * @param msg error message on error |
222 | */ | 246 | */ |
223 | typedef void (*PluginUpdateCont) (void *cls, int status, char *msg); | 247 | typedef void |
248 | (*PluginUpdateCont) (void *cls, | ||
249 | int status, | ||
250 | const char *msg); | ||
224 | 251 | ||
225 | 252 | ||
226 | /** | 253 | /** |
@@ -243,9 +270,13 @@ typedef void (*PluginUpdateCont) (void *cls, int status, char *msg); | |||
243 | * @param cont continuation called with success or failure status | 270 | * @param cont continuation called with success or failure status |
244 | * @param cons_cls continuation closure | 271 | * @param cons_cls continuation closure |
245 | */ | 272 | */ |
246 | typedef void (*PluginUpdate) (void *cls, uint64_t uid, int delta, | 273 | typedef void |
247 | struct GNUNET_TIME_Absolute expire, | 274 | (*PluginUpdate) (void *cls, |
248 | PluginUpdateCont cont, void *cont_cls); | 275 | uint64_t uid, |
276 | int delta, | ||
277 | struct GNUNET_TIME_Absolute expire, | ||
278 | PluginUpdateCont cont, | ||
279 | void *cont_cls); | ||
249 | 280 | ||
250 | 281 | ||
251 | /** | 282 | /** |
@@ -260,9 +291,12 @@ typedef void (*PluginUpdate) (void *cls, uint64_t uid, int delta, | |||
260 | * @param proc function to call on the matching value | 291 | * @param proc function to call on the matching value |
261 | * @param proc_cls closure for @a proc | 292 | * @param proc_cls closure for @a proc |
262 | */ | 293 | */ |
263 | typedef void (*PluginGetType) (void *cls, uint64_t offset, | 294 | typedef void |
264 | enum GNUNET_BLOCK_Type type, | 295 | (*PluginGetType) (void *cls, |
265 | PluginDatumProcessor proc, void *proc_cls); | 296 | uint64_t offset, |
297 | enum GNUNET_BLOCK_Type type, | ||
298 | PluginDatumProcessor proc, | ||
299 | void *proc_cls); | ||
266 | 300 | ||
267 | 301 | ||
268 | /** | 302 | /** |
@@ -270,8 +304,8 @@ typedef void (*PluginGetType) (void *cls, uint64_t offset, | |||
270 | * | 304 | * |
271 | * @param cls closure | 305 | * @param cls closure |
272 | */ | 306 | */ |
273 | typedef void (*PluginDrop) (void *cls); | 307 | typedef void |
274 | 308 | (*PluginDrop) (void *cls); | |
275 | 309 | ||
276 | 310 | ||
277 | /** | 311 | /** |