gobj_save_resource()

gobj_save_resource()#

Saves a resource associated with the given gobj. The function updates the specified resource with the provided record data and applies any additional options from jn_options.

Prototype

int gobj_save_resource(
    hgobj gobj,
    const char *resource,
    json_t *record,
    json_t *jn_options
);

Parameters

Key

Type

Description

gobj

hgobj

The GObj instance managing the resource.

resource

const char *

The name of the resource to be saved.

record

json_t *

The JSON object containing the data to be saved. This parameter is not owned by the function.

jn_options

json_t *

Additional options for saving the resource. This parameter is owned by the function.


Return Value

Returns 0 on success, or -1 if an error occurs.

Notes

If the GObj does not implement the mt_save_resource method, an error is logged and the function returns -1.

Prototype

// Not applicable in JS

Prototype

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