gobj_activate_snap()

gobj_activate_snap()#

Activates a previously saved snapshot identified by tag in the given hgobj instance. This operation typically involves stopping and restarting the associated hgobj to restore the saved state.

Prototype

int gobj_activate_snap(
    hgobj gobj,
    const char *tag,
    json_t *kw,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The hgobj instance where the snapshot will be activated.

tag

const char *

The identifier of the snapshot to activate.

kw

json_t *

Additional options for activation, passed as a JSON object. Owned by the function.

src

hgobj

The source hgobj initiating the activation request.


Return Value

Returns 0 on success, or -1 if an error occurs (e.g., if gobj is NULL, destroyed, or if mt_activate_snap is not defined).

Notes

[‘If gobj is NULL or destroyed, an error is logged and the function returns -1.’, “If mt_activate_snap is not defined in the hgobj’s gclass, an error is logged and the function returns -1.”, “The function ensures that the snapshot activation is properly handled by the hgobj’s gclass.”]

Prototype

// Not applicable in JS

Prototype

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