diff options
Diffstat (limited to 'src/include/gnunet_namestore_plugin.h')
-rw-r--r-- | src/include/gnunet_namestore_plugin.h | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h index 9cc8abc6e..3dca5a853 100644 --- a/src/include/gnunet_namestore_plugin.h +++ b/src/include/gnunet_namestore_plugin.h | |||
@@ -150,6 +150,71 @@ struct GNUNET_NAMESTORE_PluginFunctions | |||
150 | const struct GNUNET_IDENTITY_PublicKey *value_zone, | 150 | const struct GNUNET_IDENTITY_PublicKey *value_zone, |
151 | GNUNET_NAMESTORE_RecordIterator iter, | 151 | GNUNET_NAMESTORE_RecordIterator iter, |
152 | void *iter_cls); | 152 | void *iter_cls); |
153 | |||
154 | /** Transaction-based API draft **/ | ||
155 | |||
156 | /** | ||
157 | * Start a transaction in the database | ||
158 | * | ||
159 | * @param cls closure (internal context for the plugin) | ||
160 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | ||
161 | */ | ||
162 | enum GNUNET_GenericReturnValue | ||
163 | (*transaction_begin) (void *cls); | ||
164 | |||
165 | /** | ||
166 | * Abort a transaction in the database | ||
167 | * | ||
168 | * @param cls closure (internal context for the plugin) | ||
169 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | ||
170 | */ | ||
171 | enum GNUNET_GenericReturnValue | ||
172 | (*transaction_abort) (void *cls); | ||
173 | |||
174 | /** | ||
175 | * Commit a transaction in the database | ||
176 | * | ||
177 | * @param cls closure (internal context for the plugin) | ||
178 | * @return #GNUNET_OK on success, #GNUNET_NO if there were no results, #GNUNET_SYSERR on error | ||
179 | */ | ||
180 | enum GNUNET_GenericReturnValue | ||
181 | (*transaction_commit) (void *cls); | ||
182 | |||
183 | /** | ||
184 | * Replace a record in the datastore for which we are the authority. | ||
185 | * Removes any existing record in the same zone with the same name. | ||
186 | * | ||
187 | * @param cls closure (internal context for the plugin) | ||
188 | * @param zone private key of the zone | ||
189 | * @param label name of the record in the zone | ||
190 | * @param rd_count number of entries in @a rd array, 0 to delete all records | ||
191 | * @param rd array of records with data to store | ||
192 | * @return #GNUNET_OK on success, else #GNUNET_SYSERR | ||
193 | */ | ||
194 | int | ||
195 | (*replace_records) (void *cls, | ||
196 | const struct GNUNET_IDENTITY_PrivateKey *zone, | ||
197 | const char *label, | ||
198 | unsigned int rd_count, | ||
199 | const struct GNUNET_GNSRECORD_Data *rd); | ||
200 | |||
201 | /** | ||
202 | * Lookup records in the datastore for which we are the authority. | ||
203 | * | ||
204 | * @param cls closure (internal context for the plugin) | ||
205 | * @param zone private key of the zone | ||
206 | * @param label name of the record in the zone | ||
207 | * @param iter function to call with the result | ||
208 | * @param iter_cls closure for @a iter | ||
209 | * @return #GNUNET_OK on success, #GNUNET_NO for no results, else #GNUNET_SYSERR | ||
210 | */ | ||
211 | int | ||
212 | (*select_records) (void *cls, | ||
213 | const struct GNUNET_IDENTITY_PrivateKey *zone, | ||
214 | const char *label, | ||
215 | GNUNET_NAMESTORE_RecordIterator iter, | ||
216 | void *iter_cls); | ||
217 | |||
153 | }; | 218 | }; |
154 | 219 | ||
155 | 220 | ||