treedb_activate_snap()

treedb_activate_snap()#

Activates a snapshot in the TreeDB, returning the corresponding snapshot tag. The function updates the current state of the database to match the specified snapshot.

Prototype

int treedb_activate_snap(
    json_t      *tranger,
    const char  *treedb_name,
    const char  *snap_name
);

Parameters

Key

Type

Description

tranger

json_t *

A reference to the TimeRanger instance managing the TreeDB.

treedb_name

const char *

The name of the TreeDB where the snapshot is stored.

snap_name

const char *

The name of the snapshot to activate.


Return Value

Returns the snapshot tag as an integer if successful, or a negative value if an error occurs.

Notes

Ensure that the snapshot exists before calling treedb_activate_snap().

Prototype

// Not applicable in JS

Prototype

# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples