gobj_treedb_topics()

gobj_treedb_topics()#

gobj_treedb_topics() retrieves a list of topics from a TreeDB instance, returning either a list of topic names or a list of topic descriptions based on the provided options.

Prototype

json_t *gobj_treedb_topics(
    hgobj gobj,
    const char *treedb_name,
    json_t *options,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The GObj instance managing the TreeDB.

treedb_name

const char *

The name of the TreeDB instance.

options

json_t *

A JSON object specifying retrieval options, such as returning a list of topic names or full topic descriptions.

src

hgobj

The source GObj requesting the topic list.


Return Value

A JSON array containing the list of topics. If options specifies ‘dict’, the array contains topic descriptions; otherwise, it contains topic names.

Notes

[‘If gobj is NULL or destroyed, an error is logged, and NULL is returned.’, ‘If gobj does not implement mt_treedb_topics, an error is logged, and NULL is returned.’, ‘The returned JSON object must be freed by the caller.’]

Prototype

// Not applicable in JS

Prototype

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