trmsg_add_instance()

trmsg_add_instance()#

trmsg_add_instance() adds a new message instance to the specified topic in the TimeRanger database.

Prototype

int trmsg_add_instance(
    json_t            *tranger,
    const char        *topic_name,
    json_t            *jn_msg,      // owned
    md2_record_ex_t   *md_record
);

Parameters

Key

Type

Description

tranger

json_t *

Pointer to the TimeRanger database instance.

topic_name

const char *

Name of the topic where the instance will be added.

jn_msg

json_t *

JSON object containing the message instance data. Ownership is transferred to trmsg_add_instance().

md_record

md2_record_ex_t *

Pointer to the metadata record associated with the message instance.


Return Value

Returns 0 on success, or a negative value on failure.

Notes

The jn_msg parameter is owned by trmsg_add_instance(), meaning it will be managed and freed internally.

Prototype

// Not applicable in JS

Prototype

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