diff options
Diffstat (limited to 'include/asterisk/cli.h')
-rwxr-xr-x | include/asterisk/cli.h | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h index 3720e4567..bfbf2c5c5 100755 --- a/include/asterisk/cli.h +++ b/include/asterisk/cli.h @@ -28,35 +28,51 @@ extern void ast_cli(int fd, char *fmt, ...); #define AST_MAX_CMD_LEN 16 -/* A command line entry */ #define AST_MAX_ARGS 64 +//! A command line entry */ struct ast_cli_entry { - /* Null terminated list of the words of the command */ + /*! Null terminated list of the words of the command */ char *cmda[AST_MAX_CMD_LEN]; - /* Handler for the command (fd for output, # of arguments, argument list). - Returns RESULT_SHOWUSAGE for improper arguments */ + /*! Handler for the command (fd for output, # of arguments, argument list). Returns RESULT_SHOWUSAGE for improper arguments */ int (*handler)(int fd, int argc, char *argv[]); - /* Summary of the command (< 60 characters) */ + /*! Summary of the command (< 60 characters) */ char *summary; - /* Detailed usage information */ + /*! Detailed usage information */ char *usage; - /* Generate a list of possible completions for a given word */ + /*! Generate a list of possible completions for a given word */ char *(*generator)(char *line, char *word, int pos, int state); - /* For linking */ + /*! For linking */ struct ast_cli_entry *next; }; -/* Interpret a command s, sending output to fd */ +//! Interprets a command +/*! Interpret a command s, sending output to fd + * Returns 0 on succes, -1 on failure + */ extern int ast_cli_command(int fd, char *s); -/* Register your own command */ +//! Registers a command +/*! + * \param fd File descriptor that I/O is done to + * \param s string given at prompt + * Register your own command + * Returns 0 on success, -1 on failure + */ extern int ast_cli_register(struct ast_cli_entry *e); -/* Unregister your own command */ +//! Unregisters a command +/*! + * \param e which cli entry to unregister + * Unregister your own command. You must pass a completed ast_cli_entry structur + * Returns 0 on success, -1 on failure + */ extern int ast_cli_unregister(struct ast_cli_entry *e); -/* Useful for readline, that's about it */ +//! Readline madness +/* Useful for readline, that's about it + * Returns 0 on success, -1 on failure + */ extern char *ast_cli_generator(char *, char *, int); #if defined(__cplusplus) || defined(c_plusplus) |