Skip to content

Struct MDBX_chk_callbacks_t

ClassList > MDBX_chk_callbacks_t

A set of callback functions used for checking the integrity of a database. More...

  • #include <mdbx.h>

Public Attributes

Type Name
bool(* check_break
Called to check whether the checking should be interrupted.
void(* issue
Called each time an issue is discovered.
MDBX_chk_line_t *(* print_begin
Called to start printing a report line of the given severity.
void(* print_chars
Called to append a string of the given length to the printed line.
void(* print_done
Called when the printed line is done.
void(* print_flush
Called to flush the printed line.
void(* print_format
Called to append a formatted string to the printed line.
void(* print_size
Called to append a size value with a prefix and a suffix to the printed line.
int(* scope_conclude
Called when a nested scope is concluded before popping.
void(* scope_pop
Called when a nested scope is popped.
int(* scope_push
Called when a new nested scope is pushed.
int(* stage_begin
Called when a checking stage is started.
int(* stage_end
Called when a checking stage is finished.
int(* table_conclude
Called when a key-value table check is concluded.
void(* table_dispose
Called to dispose the user-defined cookie of a table.
MDBX_chk_user_table_cookie_t *(* table_filter
Called for each key-value table to decide whether it should be checked.
int(* table_handle_kv
Called for each key-value pair of a table, allowing the application to verify integrity above the key-value level.

Detailed Description

The callback functions are designed to organize interaction with the application code. This includes the integration of application logic that verifies the integrity of a data structure above the key-value level, the preparation and structured output of information about both the progress and the results of verification.

All callback functions are optional, unused ones must be set to nullptr.

Note:

This API has not been frozen yet, and there may be improvements and changes in subsequent versions.

See also: mdbx_env_chk()

Public Attributes Documentation

variable check_break

Called to check whether the checking should be interrupted.

bool(* MDBX_chk_callbacks_t::check_break) (MDBX_chk_context_t *ctx);

Returns:

Non-zero to break the checking.


variable issue

Called each time an issue is discovered.

void(* MDBX_chk_callbacks_t::issue) (MDBX_chk_context_t *ctx, const char *object, uint64_t entry_number, const char *issue, const char *extra_fmt, va_list extra_args);

variable print_begin

Called to start printing a report line of the given severity.

MDBX_chk_line_t *(* MDBX_chk_callbacks_t::print_begin) (MDBX_chk_context_t *ctx, MDBX_chk_severity_t severity);

Returns:

A pointer to the line instance, or nullptr to suppress the line.


variable print_chars

Called to append a string of the given length to the printed line.

void(* MDBX_chk_callbacks_t::print_chars) (MDBX_chk_line_t *, const char *str, size_t len);

variable print_done

Called when the printed line is done.

void(* MDBX_chk_callbacks_t::print_done) (MDBX_chk_line_t *);

variable print_flush

Called to flush the printed line.

void(* MDBX_chk_callbacks_t::print_flush) (MDBX_chk_line_t *);

variable print_format

Called to append a formatted string to the printed line.

void(* MDBX_chk_callbacks_t::print_format) (MDBX_chk_line_t *, const char *fmt, va_list args);

variable print_size

Called to append a size value with a prefix and a suffix to the printed line.

void(* MDBX_chk_callbacks_t::print_size) (MDBX_chk_line_t *, const char *prefix, const uint64_t value, const char *suffix);

variable scope_conclude

Called when a nested scope is concluded before popping.

int(* MDBX_chk_callbacks_t::scope_conclude) (MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer, MDBX_chk_scope_t *inner, int err);

Returns:

Zero on success, otherwise an error code that will be propagated.


variable scope_pop

Called when a nested scope is popped.

void(* MDBX_chk_callbacks_t::scope_pop) (MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer, MDBX_chk_scope_t *inner);

variable scope_push

Called when a new nested scope is pushed.

int(* MDBX_chk_callbacks_t::scope_push) (MDBX_chk_context_t *ctx, MDBX_chk_scope_t *outer, MDBX_chk_scope_t *inner, const char *fmt, va_list args);

Returns:

Zero on success, otherwise an error code that will be propagated.


variable stage_begin

Called when a checking stage is started.

int(* MDBX_chk_callbacks_t::stage_begin) (MDBX_chk_context_t *ctx, MDBX_chk_stage_t);

Returns:

Zero on success, otherwise an error code that will be propagated.


variable stage_end

Called when a checking stage is finished.

int(* MDBX_chk_callbacks_t::stage_end) (MDBX_chk_context_t *ctx, MDBX_chk_stage_t, int err);

Returns:

Zero on success, otherwise an error code that will be propagated.


variable table_conclude

Called when a key-value table check is concluded.

int(* MDBX_chk_callbacks_t::table_conclude) (MDBX_chk_context_t *ctx, const MDBX_chk_table_t *table, MDBX_cursor *cursor, int err);

Returns:

Zero on success, otherwise an error code that will be propagated.


variable table_dispose

Called to dispose the user-defined cookie of a table.

void(* MDBX_chk_callbacks_t::table_dispose) (MDBX_chk_context_t *ctx, const MDBX_chk_table_t *table);

variable table_filter

Called for each key-value table to decide whether it should be checked.

MDBX_chk_user_table_cookie_t *(* MDBX_chk_callbacks_t::table_filter) (MDBX_chk_context_t *ctx, const MDBX_val *name, MDBX_db_flags_t flags);

Returns:

A user-defined cookie, or nullptr to skip the table.


variable table_handle_kv

Called for each key-value pair of a table, allowing the application to verify integrity above the key-value level.

int(* MDBX_chk_callbacks_t::table_handle_kv) (MDBX_chk_context_t *ctx, const MDBX_chk_table_t *table, size_t entry_number, const MDBX_val *key, const MDBX_val *value);

Returns:

Zero to continue, otherwise the value will be returned to the caller.



The documentation for this class was generated from the following file mdbx.h