aboutsummaryrefslogtreecommitdiff
path: root/src/include/gnunet_namestore_plugin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/include/gnunet_namestore_plugin.h')
-rw-r--r--src/include/gnunet_namestore_plugin.h40
1 files changed, 7 insertions, 33 deletions
diff --git a/src/include/gnunet_namestore_plugin.h b/src/include/gnunet_namestore_plugin.h
index d8dde5af5..c31926a49 100644
--- a/src/include/gnunet_namestore_plugin.h
+++ b/src/include/gnunet_namestore_plugin.h
@@ -53,6 +53,7 @@ extern "C"
53 * @param cls closure 53 * @param cls closure
54 * @param serial unique serial number of the record, MUST NOT BE ZERO, 54 * @param serial unique serial number of the record, MUST NOT BE ZERO,
55 * and must be monotonically increasing while iterating 55 * and must be monotonically increasing while iterating
56 * @param editor_hint content of the editor field when record was read (may be NULL)
56 * @param zone_key private key of the zone 57 * @param zone_key private key of the zone
57 * @param label name that is being mapped (at most 255 characters long) 58 * @param label name that is being mapped (at most 255 characters long)
58 * @param rd_count number of entries in @a rd array 59 * @param rd_count number of entries in @a rd array
@@ -61,6 +62,7 @@ extern "C"
61typedef void 62typedef void
62(*GNUNET_NAMESTORE_RecordIterator) (void *cls, 63(*GNUNET_NAMESTORE_RecordIterator) (void *cls,
63 uint64_t serial, 64 uint64_t serial,
65 const char *editor_hint,
64 const struct 66 const struct
65 GNUNET_CRYPTO_PrivateKey *private_key, 67 GNUNET_CRYPTO_PrivateKey *private_key,
66 const char *label, 68 const char *label,
@@ -158,42 +160,13 @@ struct GNUNET_NAMESTORE_PluginFunctions
158 /** Transaction-based API draft **/ 160 /** Transaction-based API draft **/
159 161
160 /** 162 /**
161 * Start a transaction in the database 163 * Edit records in the namestore.
162 * 164 * This modifies the editor hint, an advisory lock entry.
163 * @param cls closure (internal context for the plugin) 165 * The record iterator will be called with the old editor hint (if any).
164 * @param emsg message. On error, string will be allocated and must be freed.
165 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
166 */
167 enum GNUNET_GenericReturnValue
168 (*transaction_begin)(void *cls, char **emsg);
169
170 /**
171 * Abort and roll back a transaction in the database
172 *
173 * @param cls closure (internal context for the plugin)
174 * @param emsg message. On error, string will be allocated and must be freed.
175 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
176 */
177 enum GNUNET_GenericReturnValue
178 (*transaction_rollback)(void *cls, char **emsg);
179
180 /**
181 * Commit a transaction in the database
182 *
183 * @param cls closure (internal context for the plugin)
184 * @param emsg message. On error, string will be allocated and must be freed.
185 * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
186 */
187 enum GNUNET_GenericReturnValue
188 (*transaction_commit)(void *cls, char **emsg);
189
190 /**
191 * Edit records in the datastore for which we are the authority.
192 * Should be called within a transaction (after begin) and maps
193 * to a SELECT ... FOR UPDATE in PQ.
194 * 166 *
195 * @param cls closure (internal context for the plugin) 167 * @param cls closure (internal context for the plugin)
196 * @param zone private key of the zone 168 * @param zone private key of the zone
169 * @param editor_hint the new value for the advisory lock field
197 * @param label name of the record in the zone 170 * @param label name of the record in the zone
198 * @param iter function to call with the result 171 * @param iter function to call with the result
199 * @param iter_cls closure for @a iter 172 * @param iter_cls closure for @a iter
@@ -201,6 +174,7 @@ struct GNUNET_NAMESTORE_PluginFunctions
201 */ 174 */
202 enum GNUNET_GenericReturnValue 175 enum GNUNET_GenericReturnValue
203 (*edit_records)(void *cls, 176 (*edit_records)(void *cls,
177 const char *editor_hint,
204 const struct GNUNET_CRYPTO_PrivateKey *zone, 178 const struct GNUNET_CRYPTO_PrivateKey *zone,
205 const char *label, 179 const char *label,
206 GNUNET_NAMESTORE_RecordIterator iter, 180 GNUNET_NAMESTORE_RecordIterator iter,