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 |
---|---|---|
|
|
The target |
|
|
The name of the command to execute. |
|
|
A JSON object containing the command parameters. Ownership is transferred to the function. |
|
|
The source |
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