summaryrefslogtreecommitdiff
path: root/include/asterisk/cli.h
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2006-01-18 22:17:31 +0000
committerRussell Bryant <russell@russellbryant.com>2006-01-18 22:17:31 +0000
commit6f71e1178e5e9efb90f66cf0d558ab226d2f93a7 (patch)
tree84b53711ba03f3f8d0b61dcace4eca78f6ef8127 /include/asterisk/cli.h
parentd57bc8a513f1371150a8e6b4a5c80bae88708c3f (diff)
constify arguments in more places where strings should not be modified (issue #6286)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@8203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/cli.h')
-rw-r--r--include/asterisk/cli.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/include/asterisk/cli.h b/include/asterisk/cli.h
index 32fb02ab3..f5bb10070 100644
--- a/include/asterisk/cli.h
+++ b/include/asterisk/cli.h
@@ -44,8 +44,7 @@ void ast_cli(int fd, char *fmt, ...)
/*! \brief A command line entry */
struct ast_cli_entry {
- /*! Null terminated list of the words of the command */
- char * cmda[AST_MAX_CMD_LEN];
+ char * const cmda[AST_MAX_CMD_LEN];
/*! Handler for the command (fd for output, # of args, argument list).
Returns RESULT_SHOWUSAGE for improper arguments.
argv[] has argc 'useful' entries, and an additional NULL entry
@@ -67,7 +66,7 @@ struct ast_cli_entry {
Typically, the function is called with increasing values for n
until a NULL is returned.
*/
- char *(*generator)(char *line, char *word, int pos, int n);
+ char *(*generator)(const char *line, const char *word, int pos, int n);
/*! For linking */
struct ast_cli_entry *next;
/*! For keeping track of usage */
@@ -79,7 +78,7 @@ struct ast_cli_entry {
* Interpret a command s, sending output to fd
* Returns 0 on succes, -1 on failure
*/
-int ast_cli_command(int fd, char *s);
+int ast_cli_command(int fd, const char *s);
/*! \brief Registers a command or an array of commands
* \param e which cli entry to register
@@ -114,9 +113,9 @@ void ast_cli_unregister_multiple(struct ast_cli_entry *e, int len);
* Useful for readline, that's about it
* Returns 0 on success, -1 on failure
*/
-char *ast_cli_generator(char *, char *, int);
+char *ast_cli_generator(const char *, const char *, int);
-int ast_cli_generatornummatches(char *, char *);
+int ast_cli_generatornummatches(const char *, const char *);
/*!
* \brief Generates a NULL-terminated array of strings that
@@ -129,7 +128,7 @@ int ast_cli_generatornummatches(char *, char *);
* All strings and the array itself are malloc'ed and must be freed
* by the caller.
*/
-char **ast_cli_completion_matches(char *, char *);
+char **ast_cli_completion_matches(const char *, const char *);
#if defined(__cplusplus) || defined(c_plusplus)