msg2db_get_message()#
msg2db_get_message() retrieves a message from the specified database and topic using the given primary and secondary keys.
Prototype
json_t *msg2db_get_message(
json_t *tranger,
const char *msg2db_name,
const char *topic_name,
const char *id,
const char *id2
);
Parameters
Key |
Type |
Description |
|---|---|---|
|
|
Pointer to the TimeRanger database instance. |
|
|
Name of the message database. |
|
|
Name of the topic within the database. |
|
|
Primary key of the message to retrieve. |
|
|
Secondary key of the message to retrieve. |
Return Value
A JSON object containing the requested message. The returned object is not owned by the caller and must not be modified or freed.
Notes
The function returns a reference to an internal JSON object, so the caller must not modify or free it.
If the message is not found, the function may return NULL.
The function relies on the structure and indexing of the database, which must be properly initialized using msg2db_open_db().
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples