[asterisk-commits] trunk - r8203 in /trunk: ./ apps/ channels/ include/asterisk/ pbx/ res/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Jan 18 15:17:38 MST 2006


Author: russell
Date: Wed Jan 18 16:17:31 2006
New Revision: 8203

URL: http://svn.digium.com/view/asterisk?rev=8203&view=rev
Log:
constify arguments in more places where strings should not be modified (issue #6286)

Modified:
    trunk/apps/app_meetme.c
    trunk/apps/app_queue.c
    trunk/apps/app_voicemail.c
    trunk/asterisk.c
    trunk/channels/chan_agent.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_oss.c
    trunk/channels/chan_sip.c
    trunk/channels/iax2-provision.c
    trunk/channels/iax2-provision.h
    trunk/cli.c
    trunk/include/asterisk/cli.h
    trunk/include/asterisk/module.h
    trunk/loader.c
    trunk/manager.c
    trunk/pbx.c
    trunk/pbx/pbx_config.c
    trunk/pbx/pbx_dundi.c
    trunk/res/res_clioriginate.c

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Jan 18 16:17:31 2006
@@ -688,7 +688,7 @@
 	return 0;
 }
 
-static char *complete_confcmd(char *line, char *word, int pos, int state) {
+static char *complete_confcmd(const char *line, const char *word, int pos, int state) {
 #define CONF_COMMANDS 6
 	int which = 0, x = 0;
 	struct ast_conference *cnf = NULL;

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Jan 18 16:17:31 2006
@@ -3503,7 +3503,7 @@
 	return __queues_show(0, fd, argc, argv, 1);
 }
 
-static char *complete_queue(char *line, char *word, int pos, int state)
+static char *complete_queue(const char *line, const char *word, int pos, int state)
 {
 	struct ast_call_queue *q;
 	char *ret = NULL;
@@ -3777,7 +3777,7 @@
 	}
 }
 
-static char *complete_add_queue_member(char *line, char *word, int pos, int state)
+static char *complete_add_queue_member(const char *line, const char *word, int pos, int state)
 {
 	/* 0 - add; 1 - queue; 2 - member; 3 - <member>; 4 - to; 5 - <queue>; 6 - penalty; 7 - <penalty> */
 	switch (pos) {
@@ -3845,7 +3845,7 @@
 	}
 }
 
-static char *complete_remove_queue_member(char *line, char *word, int pos, int state)
+static char *complete_remove_queue_member(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	struct ast_call_queue *q;

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Jan 18 16:17:31 2006
@@ -5803,7 +5803,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_voicemail_users(char *line, char *word, int pos, int state)
+static char *complete_show_voicemail_users(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	int wordlen;

Modified: trunk/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/asterisk.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/asterisk.c (original)
+++ trunk/asterisk.c Wed Jan 18 16:17:31 2006
@@ -324,7 +324,7 @@
 #undef FORMAT
 }
 
-static char *complete_show_version_files(char *line, char *word, int pos, int state)
+static char *complete_show_version_files(const char *line, const char *word, int pos, int state)
 {
 	struct file_version *find;
 	int which = 0;

Modified: trunk/channels/chan_agent.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_agent.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/channels/chan_agent.c (original)
+++ trunk/channels/chan_agent.c Wed Jan 18 16:17:31 2006
@@ -1622,7 +1622,7 @@
 	return 0;
 }
 
-static char *complete_agent_logoff_cmd(char *line, char *word, int pos, int state)
+static char *complete_agent_logoff_cmd(const char *line, const char *word, int pos, int state)
 {
 	struct agent_pvt *p;
 	char name[AST_MAX_AGENT];

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Jan 18 16:17:31 2006
@@ -1970,7 +1970,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_iax2_show_peer(char *line, char *word, int pos, int state)
+static char *complete_iax2_show_peer(const char *line, const char *word, int pos, int state)
 {
 	int which = 0;
 	struct iax2_peer *p;
@@ -7631,7 +7631,7 @@
 	return 0;
 }
 
-static char *iax2_prov_complete_template_3rd(char *line, char *word, int pos, int state)
+static char *iax2_prov_complete_template_3rd(const char *line, const char *word, int pos, int state)
 {
 	if (pos != 3)
 		return NULL;

Modified: trunk/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_oss.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/channels/chan_oss.c (original)
+++ trunk/channels/chan_oss.c Wed Jan 18 16:17:31 2006
@@ -975,7 +975,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *autoanswer_complete(char *line, char *word, int pos, int state)
+static char *autoanswer_complete(const char *line, const char *word, int pos, int state)
 {
 	int l = strlen(word);
 

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jan 18 16:17:31 2006
@@ -8401,7 +8401,7 @@
 }
 
 /*! \brief  complete_sipch: Support routine for 'sip show channel' CLI ---*/
-static char *complete_sipch(char *line, char *word, int pos, int state)
+static char *complete_sipch(const char *line, const char *word, int pos, int state)
 {
 	int which=0;
 	struct sip_pvt *cur;
@@ -8422,7 +8422,7 @@
 }
 
 /*! \brief  complete_sip_peer: Do completion on peer name ---*/
-static char *complete_sip_peer(char *word, int state, int flags2)
+static char *complete_sip_peer(const char *word, const int state, int flags2)
 {
 	char *result = NULL;
 	int wordlen = strlen(word);
@@ -8442,7 +8442,7 @@
 }
 
 /*! \brief  complete_sip_show_peer: Support routine for 'sip show peer' CLI ---*/
-static char *complete_sip_show_peer(char *line, char *word, int pos, int state)
+static char *complete_sip_show_peer(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 3)
 		return complete_sip_peer(word, state, 0);
@@ -8451,7 +8451,7 @@
 }
 
 /*! \brief  complete_sip_debug_peer: Support routine for 'sip debug peer' CLI ---*/
-static char *complete_sip_debug_peer(char *line, char *word, int pos, int state)
+static char *complete_sip_debug_peer(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 3)
 		return complete_sip_peer(word, state, 0);
@@ -8460,7 +8460,7 @@
 }
 
 /*! \brief  complete_sip_user: Do completion on user name ---*/
-static char *complete_sip_user(char *word, int state, int flags2)
+static char *complete_sip_user(const char *word, int state, int flags2)
 {
 	char *result = NULL;
 	int wordlen = strlen(word);
@@ -8480,7 +8480,7 @@
 }
 
 /*! \brief  complete_sip_show_user: Support routine for 'sip show user' CLI ---*/
-static char *complete_sip_show_user(char *line, char *word, int pos, int state)
+static char *complete_sip_show_user(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 3)
 		return complete_sip_user(word, state, 0);
@@ -8489,7 +8489,7 @@
 }
 
 /*! \brief  complete_sipnotify: Support routine for 'sip notify' CLI ---*/
-static char *complete_sipnotify(char *line, char *word, int pos, int state)
+static char *complete_sipnotify(const char *line, const char *word, int pos, int state)
 {
 	char *c = NULL;
 
@@ -8521,7 +8521,7 @@
 }
 
 /*! \brief  complete_sip_prune_realtime_peer: Support routine for 'sip prune realtime peer' CLI ---*/
-static char *complete_sip_prune_realtime_peer(char *line, char *word, int pos, int state)
+static char *complete_sip_prune_realtime_peer(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 4)
 		return complete_sip_peer(word, state, SIP_PAGE2_RTCACHEFRIENDS);
@@ -8529,7 +8529,7 @@
 }
 
 /*! \brief  complete_sip_prune_realtime_user: Support routine for 'sip prune realtime user' CLI ---*/
-static char *complete_sip_prune_realtime_user(char *line, char *word, int pos, int state)
+static char *complete_sip_prune_realtime_user(const char *line, const char *word, int pos, int state)
 {
 	if (pos == 4)
 		return complete_sip_user(word, state, SIP_PAGE2_RTCACHEFRIENDS);

Modified: trunk/channels/iax2-provision.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/iax2-provision.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/channels/iax2-provision.c (original)
+++ trunk/channels/iax2-provision.c Wed Jan 18 16:17:31 2006
@@ -154,7 +154,7 @@
 	return cur;
 }
 
-char *iax_prov_complete_template(char *line, char *word, int pos, int state)
+char *iax_prov_complete_template(const char *line, const char *word, int pos, int state)
 {
 	struct iax_template *c;
 	int which=0;

Modified: trunk/channels/iax2-provision.h
URL: http://svn.digium.com/view/asterisk/trunk/channels/iax2-provision.h?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/channels/iax2-provision.h (original)
+++ trunk/channels/iax2-provision.h Wed Jan 18 16:17:31 2006
@@ -50,4 +50,4 @@
 extern int iax_provision_unload(void);
 extern int iax_provision_build(struct iax_ie_data *provdata, unsigned int *signature, const char *template, int force);
 extern int iax_provision_version(unsigned int *signature, const char *template, int force);
-extern char *iax_prov_complete_template(char *line, char *word, int pos, int state);
+extern char *iax_prov_complete_template(const char *line, const char *word, int pos, int state);

Modified: trunk/cli.c
URL: http://svn.digium.com/view/asterisk/trunk/cli.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/cli.c (original)
+++ trunk/cli.c Wed Jan 18 16:17:31 2006
@@ -508,7 +508,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *__ast_cli_generator(char *text, char *word, int state, int lock);
+static char *__ast_cli_generator(const char *text, const char *word, int state, int lock);
 
 static int handle_commandmatchesarray(int fd, int argc, char *argv[])
 {
@@ -762,7 +762,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_channels(char *line, char *word, int pos, int state)
+static char *complete_show_channels(const char *line, const char *word, int pos, int state)
 {
 	static char *choices[] = { "concise", "verbose" };
 	int match = 0;
@@ -785,7 +785,7 @@
 	return NULL;
 }
 
-static char *complete_ch_helper(char *line, char *word, int pos, int state, int rpos)
+static char *complete_ch_helper(const char *line, const char *word, int pos, int state, int rpos)
 {
 	struct ast_channel *c = NULL;
 	int which = 0;
@@ -811,27 +811,27 @@
 	return ret;
 }
 
-static char *complete_ch_3(char *line, char *word, int pos, int state)
+static char *complete_ch_3(const char *line, const char *word, int pos, int state)
 {
 	return complete_ch_helper(line, word, pos, state, 2);
 }
 
-static char *complete_ch_4(char *line, char *word, int pos, int state)
+static char *complete_ch_4(const char *line, const char *word, int pos, int state)
 {
 	return complete_ch_helper(line, word, pos, state, 3);
 }
 
-static char *complete_mod_2(char *line, char *word, int pos, int state)
+static char *complete_mod_2(const char *line, const char *word, int pos, int state)
 {
 	return ast_module_helper(line, word, pos, state, 1, 1);
 }
 
-static char *complete_mod_4(char *line, char *word, int pos, int state)
+static char *complete_mod_4(const char *line, const char *word, int pos, int state)
 {
 	return ast_module_helper(line, word, pos, state, 3, 0);
 }
 
-static char *complete_fn(char *line, char *word, int pos, int state)
+static char *complete_fn(const char *line, const char *word, int pos, int state)
 {
 	char *c;
 	char filename[256];
@@ -903,7 +903,7 @@
 
 static int handle_help(int fd, int argc, char *argv[]);
 
-static char * complete_help(char *text, char *word, int pos, int state)
+static char * complete_help(const char *text, const char *word, int pos, int state)
 {
 	/* skip first 4 or 5 chars, "help "*/
 	int l = strlen(text);
@@ -941,7 +941,7 @@
 	{ { NULL }, NULL, NULL, NULL }
 };
 
-static struct ast_cli_entry *find_cli(char *cmds[], int exact)
+static struct ast_cli_entry *find_cli(char *const cmds[], int exact)
 {
 	int x;
 	int y;
@@ -987,7 +987,7 @@
 	return NULL;
 }
 
-static void join(char *dest, size_t destsize, char *w[], int tws)
+static void join(char *dest, size_t destsize, char *const w[], int tws)
 {
 	ast_join(dest, destsize, w);	
 
@@ -995,7 +995,7 @@
 		strncat(dest, " ", destsize - strlen(dest) - 1);
 }
 
-static void join2(char *dest, size_t destsize, char *w[])
+static void join2(char *dest, size_t destsize, char *const w[])
 {
 	int x;
 	/* Join words into a string */
@@ -1186,7 +1186,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *parse_args(char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
+static char *parse_args(const char *s, int *argc, char *argv[], int max, int *trailingwhitespace)
 {
 	char *dup, *cur;
 	int x = 0;
@@ -1247,7 +1247,7 @@
 }
 
 /* This returns the number of unique matches for the generator */
-int ast_cli_generatornummatches(char *text, char *word)
+int ast_cli_generatornummatches(const char *text, const char *word)
 {
 	int matches = 0, i = 0;
 	char *buf = NULL, *oldbuf = NULL;
@@ -1264,7 +1264,7 @@
 	return matches;
 }
 
-char **ast_cli_completion_matches(char *text, char *word)
+char **ast_cli_completion_matches(const char *text, const char *word)
 {
 	char **match_list = NULL, *retstr, *prevstr;
 	size_t match_list_len, max_equal, which, i;
@@ -1303,7 +1303,7 @@
 	return match_list;
 }
 
-static char *__ast_cli_generator(char *text, char *word, int state, int lock)
+static char *__ast_cli_generator(const char *text, const char *word, int state, int lock)
 {
 	char *argv[AST_MAX_ARGS];
 	struct ast_cli_entry *e, *e1, *e2;
@@ -1379,12 +1379,12 @@
 	return NULL;
 }
 
-char *ast_cli_generator(char *text, char *word, int state)
+char *ast_cli_generator(const char *text, const char *word, int state)
 {
 	return __ast_cli_generator(text, word, state, 1);
 }
 
-int ast_cli_command(int fd, char *s)
+int ast_cli_command(int fd, const char *s)
 {
 	char *argv[AST_MAX_ARGS];
 	struct ast_cli_entry *e;

Modified: trunk/include/asterisk/cli.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/cli.h?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/include/asterisk/cli.h (original)
+++ trunk/include/asterisk/cli.h Wed Jan 18 16:17:31 2006
@@ -44,8 +44,7 @@
 
 /*! \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 @@
 	  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 @@
  * 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 @@
  * 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 @@
  * 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)

Modified: trunk/include/asterisk/module.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/module.h?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/include/asterisk/module.h (original)
+++ trunk/include/asterisk/module.h Wed Jan 18 16:17:31 2006
@@ -242,7 +242,7 @@
  * \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.

Modified: trunk/loader.c
URL: http://svn.digium.com/view/asterisk/trunk/loader.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/loader.c (original)
+++ trunk/loader.c Wed Jan 18 16:17:31 2006
@@ -164,7 +164,7 @@
 	return res;
 }
 
-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)
 {
 	struct module *m;
 	int which=0;

Modified: trunk/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/manager.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/manager.c (original)
+++ trunk/manager.c Wed Jan 18 16:17:31 2006
@@ -161,7 +161,7 @@
 	return res;
 }
 
-static char *complete_show_mancmd(char *line, char *word, int pos, int state)
+static char *complete_show_mancmd(const char *line, const char *word, int pos, int state)
 {
 	struct manager_action *cur = first_action;
 	int which = 0;

Modified: trunk/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/pbx.c (original)
+++ trunk/pbx.c Wed Jan 18 16:17:31 2006
@@ -1082,7 +1082,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_function(char *line, char *word, int pos, int state)
+static char *complete_show_function(const char *line, const char *word, int pos, int state)
 {
 	struct ast_custom_function *acf;
 	char *ret = NULL;
@@ -2834,7 +2834,7 @@
  * application at one time. You can type 'show application Dial Echo' and
  * you will see informations about these two applications ...
  */
-static char *complete_show_application(char *line, char *word, int pos, int state)
+static char *complete_show_application(const char *line, const char *word, int pos, int state)
 {
 	struct ast_app *a;
 	char *ret = NULL;
@@ -3067,7 +3067,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_show_applications(char *line, char *word, int pos, int state)
+static char *complete_show_applications(const char *line, const char *word, int pos, int state)
 {
 	int wordlen = strlen(word);
 
@@ -3101,7 +3101,7 @@
 /*
  * 'show dialplan' CLI command implementation functions ...
  */
-static char *complete_show_dialplan_context(char *line, char *word, int pos,
+static char *complete_show_dialplan_context(const char *line, const char *word, int pos,
 	int state)
 {
 	struct ast_context *c = NULL;

Modified: trunk/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_config.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/pbx/pbx_config.c (original)
+++ trunk/pbx/pbx_config.c Wed Jan 18 16:17:31 2006
@@ -143,7 +143,7 @@
 	return RESULT_FAILURE;
 }
 
-static char *complete_context_dont_include(char *line, char *word,
+static char *complete_context_dont_include(const char *line, const char *word,
 	int pos, int state)
 {
 	int which = 0;
@@ -449,7 +449,7 @@
  * It's ugly, I know, but I'm waiting for Mark suggestion if upper is
  * bug or feature ...
  */
-static int fix_complete_args(char *line, char **word, int *pos)
+static int fix_complete_args(const char *line, char **word, int *pos)
 {
 	char *_line, *_strsep_line, *_previous_word = NULL, *_word = NULL;
 	int words = 0;
@@ -481,13 +481,14 @@
 }
 #endif /* BROKEN_READLINE */
 
-static char *complete_context_remove_extension(char *line, char *word, int pos,
+static char *complete_context_remove_extension(const char *line, const char *word2, int pos,
 	int state)
 {
 	char *ret = NULL;
 	int which = 0;
 
 #ifdef BROKEN_READLINE
+	char *word = (char *)word2;	/* fool the compiler. XXX will go away later */
 	/*
 	 * Fix arguments, *word is a new allocated structure, REMEMBER to
 	 * free *word when you want to return from this function ...
@@ -496,6 +497,8 @@
 		ast_log(LOG_ERROR, "Out of free memory\n");
 		return NULL;
 	}
+#else
+	const char *word = word2;
 #endif
 
 	/*
@@ -745,7 +748,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_context_add_include(char *line, char *word, int pos,
+static char *complete_context_add_include(const char *line, const char *word, int pos,
     int state)
 {
 	struct ast_context *c;
@@ -1243,7 +1246,7 @@
 }
 
 /*! add extension 6123,1,Dial,IAX/212.71.138.13/6123 into local */
-static char *complete_context_add_extension(char *line, char *word,
+static char *complete_context_add_extension(const char *line, const char *word,
 	int pos, int state)
 {
 	int which = 0;
@@ -1326,7 +1329,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_context_add_ignorepat(char *line, char *word,
+static char *complete_context_add_ignorepat(const char *line, const char *word,
 	int pos, int state)
 {
 	if (pos == 3) return state == 0 ? strdup("into") : NULL;
@@ -1427,7 +1430,7 @@
 	return RESULT_SUCCESS;
 }
 
-static char *complete_context_remove_ignorepat(char *line, char *word,
+static char *complete_context_remove_ignorepat(const char *line, const char *word,
 	int pos, int state)
 {
 	struct ast_context *c;

Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Wed Jan 18 16:17:31 2006
@@ -2226,7 +2226,7 @@
 	}
 }
 
-static char *complete_peer_helper(char *line, char *word, int pos, int state, int rpos)
+static char *complete_peer_helper(const char *line, const char *word, int pos, int state, int rpos)
 {
 	int which=0;
 	char *ret;
@@ -2251,7 +2251,7 @@
 	return ret;
 }
 
-static char *complete_peer_4(char *line, char *word, int pos, int state)
+static char *complete_peer_4(const char *line, const char *word, int pos, int state)
 {
 	return complete_peer_helper(line, word, pos, state, 3);
 }

Modified: trunk/res/res_clioriginate.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_clioriginate.c?rev=8203&r1=8202&r2=8203&view=diff
==============================================================================
--- trunk/res/res_clioriginate.c (original)
+++ trunk/res/res_clioriginate.c Wed Jan 18 16:17:31 2006
@@ -64,7 +64,7 @@
 "used. If no extension is given, the 's' extension will be used.\n";
 
 static int handle_orig(int fd, int argc, char *argv[]);
-static char *complete_orig(char *line, char *word, int pos, int state);
+static char *complete_orig(const char *line, const char *word, int pos, int state);
 
 struct ast_cli_entry cli_orig = { { "originate", NULL }, handle_orig, "Originate a call", orig_help, complete_orig };
 
@@ -144,7 +144,7 @@
 	return res;
 }
 
-static char *complete_orig(char *line, char *word, int pos, int state)
+static char *complete_orig(const char *line, const char *word, int pos, int state)
 {
 	int wordlen;
 	char *app = "application";



More information about the asterisk-commits mailing list