aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/cli.h
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2001-10-31 15:28:08 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2001-10-31 15:28:08 +0000
commita881107daa6bee3ca7bc537b4c0ed7a568368cb9 (patch)
tree33d790ecbb94ae7c4cececd8b69695ccedce33f0 /include/asterisk/cli.h
parentb6c1eedcbed1c6ad198bca79b889bfe3c5c698f3 (diff)
Version 0.1.10 from FTP
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@380 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk/cli.h')
-rwxr-xr-xinclude/asterisk/cli.h40
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)