ec_control_register_command3 — Register a command handler with the system
int **ec_control_register_command3** ( | prefix, | |
| | closure, | |
| | func
); | |
**Configuration Change. ** This feature is available starting from Momentum 3.2.
Register a command handler with the system.
The command handler is scoped to the generation of the configuration, meaning that the command will not be available if the module that registered it is removed from the configuration.
The control function that is dispatched by this function accepts a blobject as a closure, even though the prototype is defined as taking a void*. The blobject allows the command implementation to manage the lifetime of the closure.
This function may only be called from inside a configuration transaction, meaning that it should be called from within your module ext_init function.
The command name.
A void pointer to the closure. For a description of this data type see “ec_blobject”.
A void pointer to the command action.
On success this function returns
1; on failure,
It is legal to call this function in any thread.