aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-18 22:17:31 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2006-01-18 22:17:31 +0000
commitc6643537f1a978097034de7ce33dcd40530da1c8 (patch)
tree84b53711ba03f3f8d0b61dcace4eca78f6ef8127 /include
parent20dede9dcf4608236c70acd8d3ce544123d3ce9a (diff)
constify arguments in more places where strings should not be modified (issue #6286)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@8203 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/cli.h13
-rw-r--r--include/asterisk/module.h2
2 files changed, 7 insertions, 8 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)
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index ec01ba115..80806de5e 100644
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -242,7 +242,7 @@ int ast_module_reload(const char *name);
* \return A possible completion of the partial match, or NULL if no matches
* were found.
*/
-char *ast_module_helper(char *line, char *word, int pos, int state, int rpos, int needsreload);
+char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload);
/*!
* \brief Register a function to be executed before Asterisk exits.