diff options
Diffstat (limited to 'src/include/gnunet_namestore_plugin.h')
-rw-r--r-- | src/include/gnunet_namestore_plugin.h | 52 |
1 files changed, 10 insertions, 42 deletions
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 9301c29fe..82bac1f9e 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -160,63 +160,31 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
160 | * Start a transaction in the database | 160 | * Start a transaction in the database |
161 | * | 161 | * |
162 | * @param cls closure (internal context for the plugin) | 162 | * @param cls closure (internal context for the plugin) |
163 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 163 | * @param emsg message. On error, string will be allocated and must be freed. |
164 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | ||
164 | */ | 165 | */ |
165 | enum GNUNET_GenericReturnValue | 166 | enum GNUNET_GenericReturnValue |
166 | (*transaction_begin) (void *cls); | 167 | (*transaction_begin) (void *cls, char **emsg); |
167 | 168 | ||
168 | /** | 169 | /** |
169 | * Abort a transaction in the database | 170 | * Abort and roll back a transaction in the database |
170 | * | 171 | * |
171 | * @param cls closure (internal context for the plugin) | 172 | * @param cls closure (internal context for the plugin) |
172 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 173 | * @param emsg message. On error, string will be allocated and must be freed. |
174 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | ||
173 | */ | 175 | */ |
174 | enum GNUNET_GenericReturnValue | 176 | enum GNUNET_GenericReturnValue |
175 | (*transaction_abort) (void *cls); | 177 | (*transaction_rollback) (void *cls, char **emsg); |
176 | 178 | ||
177 | /** | 179 | /** |
178 | * Commit a transaction in the database | 180 | * Commit a transaction in the database |
179 | * | 181 | * |
180 | * @param cls closure (internal context for the plugin) | 182 | * @param cls closure (internal context for the plugin) |
181 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | 183 | * @param emsg message. On error, string will be allocated and must be freed. |
184 | * @return #GNUNET_OK on success, #GNUNET_SYSERR on error | ||
182 | */ | 185 | */ |
183 | enum GNUNET_GenericReturnValue | 186 | enum GNUNET_GenericReturnValue |
184 | (*transaction_commit) (void *cls); | 187 | (*transaction_commit) (void *cls, char **emsg); |
185 | |||
186 | /** | ||
187 | * Replace a record in the datastore for which we are the authority. | ||
188 | * Removes any existing record in the same zone with the same name. | ||
189 | * | ||
190 | * @param cls closure (internal context for the plugin) | ||
191 | * @param zone private key of the zone | ||
192 | * @param label name of the record in the zone | ||
193 | * @param rd_count number of entries in @a rd array, 0 to delete all records | ||
194 | * @param rd array of records with data to store | ||
195 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | ||
196 | */ | ||
197 | int | ||
198 | (*replace_records) (void *cls, | ||
199 | const struct GNUNET_IDENTITY_PrivateKey *zone, | ||
200 | const char *label, | ||
201 | unsigned int rd_count, | ||
202 | const struct GNUNET_GNSRECORD_Data *rd); | ||
203 | |||
204 | /** | ||
205 | * Lookup records in the datastore for which we are the authority. | ||
206 | * | ||
207 | * @param cls closure (internal context for the plugin) | ||
208 | * @param zone private key of the zone | ||
209 | * @param label name of the record in the zone | ||
210 | * @param iter function to call with the result | ||
211 | * @param iter_cls closure for @a iter | ||
212 | * @return #GNUNET_OK on success, #GNUNET_NO for no results, else #GNUNET_SYSERR | ||
213 | */ | ||
214 | int | ||
215 | (*select_records) (void *cls, | ||
216 | const struct GNUNET_IDENTITY_PrivateKey *zone, | ||
217 | const char *label, | ||
218 | GNUNET_NAMESTORE_RecordIterator iter, | ||
219 | void *iter_cls); | ||
220 | 188 | ||
221 | }; | 189 | }; |
222 | 190 | ||