|
Robust Distributed System Nucleus (rDSN)
ver 1.0.0
|
Classes | |
| struct | dsn_cli_reply |
Typedefs | |
| typedef struct dsn_cli_reply | dsn_cli_reply |
| typedef void(* | dsn_cli_handler) (void *context, int argc, const char **argv, dsn_cli_reply *reply) |
| typedef void(* | dsn_cli_free_handler) (dsn_cli_reply reply) |
Functions | |
| DSN_API const char * | dsn_cli_run (const char *command_line) |
| DSN_API void | dsn_cli_free (const char *command_output) |
| DSN_API dsn_handle_t | dsn_cli_register (const char *command, const char *help_one_line, const char *help_long, void *context, dsn_cli_handler cmd_handler, dsn_cli_free_handler output_freer) |
| DSN_API dsn_handle_t | dsn_cli_app_register (const char *command, const char *help_one_line, const char *help_long, void *context, dsn_cli_handler cmd_handler, dsn_cli_free_handler output_freer) |
| DSN_API void | dsn_cli_deregister (dsn_handle_t cli_handle) |
| DSN_API const char* dsn_cli_run | ( | const char * | command_line | ) |
run a given cli command
| command_line | given command line. |
| DSN_API void dsn_cli_free | ( | const char * | command_output | ) |
free memory occupied by cli response
| command_output | result from dsn_cli_run |
| DSN_API dsn_handle_t dsn_cli_register | ( | const char * | command, |
| const char * | help_one_line, | ||
| const char * | help_long, | ||
| void * | context, | ||
| dsn_cli_handler | cmd_handler, | ||
| dsn_cli_free_handler | output_freer | ||
| ) |
register a customized cli command handler
| command | command name |
| help_one_line | one line help information |
| help_long | long help information |
| context | context used by cmd_handler |
| cmd_handler | command handler |
| output_freer | command result resource free handler |
| DSN_API dsn_handle_t dsn_cli_app_register | ( | const char * | command, |
| const char * | help_one_line, | ||
| const char * | help_long, | ||
| void * | context, | ||
| dsn_cli_handler | cmd_handler, | ||
| dsn_cli_free_handler | output_freer | ||
| ) |
same as dsn_cli_register, except that the command name is auto-augmented by rDSN as $app_full_name.
$command
| DSN_API void dsn_cli_deregister | ( | dsn_handle_t | cli_handle | ) |
remove a cli handler
| cli_handle | handle of the cli returned from dsn_cli_register or dsn_cli_app_register |