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
This commit is contained in:
Russell Bryant
2006-01-18 22:17:31 +00:00
parent d57bc8a513
commit 6f71e1178e
19 changed files with 66 additions and 64 deletions

View File

@@ -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)