From e8982b5fb097e5c8ddef43447a937b2555247d3c Mon Sep 17 00:00:00 2001 From: Yersa Nordman Date: Sat, 13 Jul 2024 23:37:11 +0200 Subject: [PATCH] Defined transaction methods --- src/kvsm.h | 114 +++++++++++++++++++---------------------------------- 1 file changed, 41 insertions(+), 73 deletions(-) diff --git a/src/kvsm.h b/src/kvsm.h index abda8a6..73daa37 100644 --- a/src/kvsm.h +++ b/src/kvsm.h @@ -167,82 +167,50 @@ KVSM_RESPONSE kvsm_set(struct kvsm *ctx, const struct buf *key, const struct buf ///> /// +///
+/// kvsm_transaction_get_id(ctx, offset) +/// +/// Gets the identifier of the transaction located at the given offset +/// +///
-// TODO -// buf kvsm_tx_get_id(ctx,offset) -// tx kvsm_tx_load_id(ctx,identifier) //-- gets metadata/struct, not entries -// resp kvsm_tx_free(tx) -// buf kvsm_tx_serialize(tx) //-- includes data -// resp kvsm_tx_ingest(buf) +///
+/// kvsm_transaction_load_id(ctx, identifier) +/// +/// Loads the metadata for the given transaction id and returns a transaction struct for it +/// +///
+ +///
+/// kvsm_transaction_free(tx) +/// +/// Frees up the memory used by the transaction +/// +///
+///
+/// kvsm_transaction_serialize +/// +/// Serializes the transaction, including contents +/// +///
-// //
-// // kvsm_cursor_free(cursor) -// // -// // Frees the used memory by the given cursor -// // -// //
-// -// //
-// // kvsm_cursor_previous(cursor) -// // -// // Returns a NEW cursor, pointing to the given cursor's parent transaction, -// // or NULL if the given cursor has no parent -// // -// //
-// -// //
-// // kvsm_cursor_next(cursor) -// // -// // Returns a NEW cursor, pointing to the given cursor's child transaction, -// // or NULL if the given cursor has no child -// // -// //
-// -// //
-// // kvsm_cursor_load(ctx, offset) -// // -// // Returns a new cursor, loaded from the transaction at the given offset. -// // -// //
-// -// //
-// // kvsm_cursor_fetch(ctx, increment) -// // -// // Returns a new cursor pointing to the transaction with the given increment, -// // or to the oldest transaction available higher than the given increment. -// // -// //
-// -// //
-// // kvsm_cursor_serialize(cursor) -// // -// // Returns a buffer representing the serialized transaction, including -// // increment and values -// // -// //
-// -// //
-// // kvsm_cursor_ingest(ctx, serialized) -// // -// // Ingests the given serialized transaction, inserting it with the existing -// // increment instead of writing a new one -// // -// //
+///
+/// kvsm_transaction_ingest +/// +/// Stores the given transaction and it's data +/// +///
/// /// ## Example