gobj_command()

gobj_command()#

Executes a command on the given hgobj instance, using either the local command parser or the global command parser if available.

Prototype

json_t *gobj_command(
    hgobj gobj,
    const char *command,
    json_t *kw,
    hgobj src
);

Parameters

Key

Type

Description

gobj

hgobj

The target hgobj instance on which the command is executed.

command

const char *

The name of the command to execute.

kw

json_t *

A JSON object containing the command parameters. Ownership is transferred to the function.

src

hgobj

The source hgobj instance that initiated the command.


Return Value

A JSON object containing the command response. The response follows the format { "result": int, "comment": string, "schema": json_t *, "data": json_t * }. The caller is responsible for managing the returned JSON object.

Notes

If the target hgobj has a local command parser (mt_command_parser), it is used. Otherwise, the global command parser is invoked if available. If neither is present, an error response is returned.

Prototype

// Not applicable in JS

Prototype

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