|
MCEL: Merkle-Chaining Event Ledger 1.0.0.0a (A1)
A post-quantum secure block-chain ledger system
|
The MCEL storage callback table. More...
#include <mcel.h>
Data Fields | |
| void * | context |
| bool(* | write )(void *context, const uint8_t *loc, size_t loclen, const uint8_t *data, size_t datalen) |
| Write a complete object at a logical location. | |
| bool(* | read )(void *context, const uint8_t *loc, size_t loclen, uint8_t *data, size_t datalen, size_t *outread) |
| Read a complete object from a logical location. | |
| bool(* | append )(void *context, const uint8_t *loc, size_t loclen, const uint8_t *data, size_t datalen, uint64_t *outpos) |
| Append bytes to an append-only object. | |
| bool(* | size )(void *context, const uint8_t *loc, size_t loclen, uint64_t *outlen) |
| Get the size of an object at a logical location. | |
| bool(* | flush )(void *context, const uint8_t *loc, size_t loclen) |
| Flush any buffered data for a logical location. | |
The MCEL storage callback table.
The hosting application owns persistence. MCEL calls these functions to read and write opaque byte strings (blocks, checkpoint bundles, records, indexes).
| bool(* append) (void *context, const uint8_t *loc, size_t loclen, const uint8_t *data, size_t datalen, uint64_t *outpos) |
Append bytes to an append-only object.
| context | The storage context. |
| loc | [const] A pointer to an application-defined location identifier. |
| loclen | The length of the location identifier in bytes. |
| data | [const] A pointer to the data buffer. |
| datalen | The data length in bytes. |
| outpos | A pointer to the returned append position offset, can be NULL. |
| void* context |
The host-defined storage context pointer
| bool(* flush) (void *context, const uint8_t *loc, size_t loclen) |
Flush any buffered data for a logical location.
| context | The storage context. |
| loc | [const] A pointer to an application-defined location identifier. |
| loclen | The length of the location identifier in bytes. |
| bool(* read) (void *context, const uint8_t *loc, size_t loclen, uint8_t *data, size_t datalen, size_t *outread) |
Read a complete object from a logical location.
| context | The storage context. |
| loc | [const] A pointer to an application-defined location identifier. |
| loclen | The length of the location identifier in bytes. |
| data | A pointer to the output buffer. |
| datalen | The output buffer length in bytes. |
| outread | A pointer to the returned number of bytes read. |
| bool(* size) (void *context, const uint8_t *loc, size_t loclen, uint64_t *outlen) |
Get the size of an object at a logical location.
| context | The storage context. |
| loc | [const] A pointer to an application-defined location identifier. |
| loclen | The length of the location identifier in bytes. |
| outlen | A pointer to the returned size in bytes. |
| bool(* write) (void *context, const uint8_t *loc, size_t loclen, const uint8_t *data, size_t datalen) |
Write a complete object at a logical location.
| context | The storage context. |
| loc | [const] A pointer to an application-defined location identifier. |
| loclen | The length of the location identifier in bytes. |
| data | [const] A pointer to the data buffer. |
| datalen | The data length in bytes. |