[asterisk-commits] tilghman: trunk r43364 - in /trunk: apps/ cdr/ channels/ funcs/ include/aster...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Wed Sep 20 13:40:40 MST 2006


Author: tilghman
Date: Wed Sep 20 15:40:39 2006
New Revision: 43364

URL: http://svn.digium.com/view/asterisk?rev=43364&view=rev
Log:
Constify the result of a config retrieval function, to avoid mutilation (issue 7983).

Modified:
    trunk/apps/app_directory.c
    trunk/apps/app_festival.c
    trunk/apps/app_meetme.c
    trunk/apps/app_privacy.c
    trunk/apps/app_queue.c
    trunk/apps/app_rpt.c
    trunk/apps/app_voicemail.c
    trunk/cdr/cdr_csv.c
    trunk/cdr/cdr_odbc.c
    trunk/channels/chan_iax2.c
    trunk/channels/chan_sip.c
    trunk/channels/chan_zap.c
    trunk/channels/iax2-provision.c
    trunk/funcs/func_odbc.c
    trunk/include/asterisk/config.h
    trunk/main/config.c
    trunk/main/logger.c
    trunk/main/manager.c
    trunk/main/rtp.c
    trunk/main/udptl.c
    trunk/pbx/pbx_config.c

Modified: trunk/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_directory.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_directory.c (original)
+++ trunk/apps/app_directory.c Wed Sep 20 15:40:39 2006
@@ -183,7 +183,7 @@
 }
 #endif
 
-static char *convert(char *lastname)
+static char *convert(const char *lastname)
 {
 	char *tmp;
 	int lcount = 0;
@@ -342,8 +342,8 @@
 	struct ast_category *cat;
 	struct ast_variable *var;
 	char *mailbox;
-	char *fullname;
-	char *hidefromdir;
+	const char *fullname;
+	const char *hidefromdir;
 	char tmp[100];
 
 	/* Load flat file config. */
@@ -402,7 +402,8 @@
 	int res;
 	int found=0;
 	int lastuserchoice = 0;
-	char *start, *pos, *conv,*stringp=NULL;
+	char *start, *conv, *stringp = NULL;
+	const char *pos;
 
 	if (ast_strlen_zero(context)) {
 		ast_log(LOG_WARNING,
@@ -570,7 +571,8 @@
 	int last = 1;
 	int readext = 0;
 	int fromappvm = 0;
-	char *dirintro, *parse;
+	const char *dirintro;
+	char *parse;
 	AST_DECLARE_APP_ARGS(args,
 		AST_APP_ARG(vmcontext);
 		AST_APP_ARG(dialcontext);

Modified: trunk/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_festival.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_festival.c (original)
+++ trunk/apps/app_festival.c Wed Sep 20 15:40:39 2006
@@ -280,10 +280,10 @@
 	struct ast_hostent ahp;
 	int fd;
 	FILE *fs;
-	char *host;
-	char *cachedir;
-	char *temp;
-	char *festivalcommand;
+	const char *host;
+	const char *cachedir;
+	const char *temp;
+	const char *festivalcommand;
 	int port=1314;
 	int n;
 	char ack[4];

Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Sep 20 15:40:39 2006
@@ -2948,7 +2948,7 @@
 static void load_config_meetme(void)
 {
 	struct ast_config *cfg;
-	char *val;
+	const char *val;
 
 	audio_buffers = DEFAULT_AUDIO_BUFFERS;
 

Modified: trunk/apps/app_privacy.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_privacy.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_privacy.c (original)
+++ trunk/apps/app_privacy.c Wed Sep 20 15:40:39 2006
@@ -82,7 +82,7 @@
 	int maxretries = 3;
 	int minlength = 10;
 	int x = 0;
-	char *s;
+	const char *s;
 	char phone[30];
 	struct ast_module_user *u;
 	struct ast_config *cfg = NULL;

Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Sep 20 15:40:39 2006
@@ -596,7 +596,7 @@
 	return 0;
 }
 
-static struct member *create_queue_member(char *interface, char *membername, int penalty, int paused)
+static struct member *create_queue_member(char *interface, const char *membername, int penalty, int paused)
 {
 	struct member *cur;
 	
@@ -912,7 +912,7 @@
 	}
 }
 
-static void rt_handle_member_record(struct call_queue *q, char *interface, char *membername, const char *penalty_str)
+static void rt_handle_member_record(struct call_queue *q, char *interface, const char *membername, const char *penalty_str)
 {
 	struct member *m, *prev_m;
 	int penalty = 0;
@@ -3691,7 +3691,7 @@
 	struct ast_variable *var;
 	struct member *prev, *cur, *newm;
 	int new;
-	char *general_val = NULL;
+	const char *general_val = NULL;
 	char parse[80];
 	char *interface;
 	char *membername;

Modified: trunk/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_rpt.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_rpt.c (original)
+++ trunk/apps/app_rpt.c Wed Sep 20 15:40:39 2006
@@ -394,17 +394,17 @@
 
 	struct {
 
-		char *ourcontext;
-		char *ourcallerid;
-		char *acctcode;
-		char *ident;
+		const char *ourcontext;
+		const char *ourcallerid;
+		const char *acctcode;
+		const char *ident;
 		char *tonezone;
 		char simple;
-		char *functions;
-		char *link_functions;
-		char *phone_functions;
-		char *dphone_functions;
-		char *nodes;
+		const char *functions;
+		const char *link_functions;
+		const char *phone_functions;
+		const char *dphone_functions;
+		const char *nodes;
 		int hangtime;
 		int totime;
 		int idtime;
@@ -414,9 +414,9 @@
 		int politeid;
 		char *tailmessages[500];
 		int tailmessagemax;
-		char	*memory;
-		char	*macro;
-		char	*startupmacro;
+		const char	*memory;
+		const char	*macro;
+		const char	*startupmacro;
 		int iobase;
 		char funcchar;
 		char endchar;
@@ -900,7 +900,7 @@
 					
 
 
-static int myatoi(char *str)
+static int myatoi(const char *str)
 {
 int	ret;
 
@@ -941,7 +941,7 @@
                                                                                 
 static int retrieve_astcfgint(struct rpt *myrpt,char *category, char *name, int min, int max, int defl)
 {
-        char *var;
+        const char *var;
         int ret;
                                                                                 
         var = ast_variable_retrieve(myrpt->cfg, category, name);
@@ -960,7 +960,8 @@
 
 static void load_rpt_vars(int n,int init)
 {
-char *this,*val;
+char *this;
+	const char *val;
 int	j,longestnode;
 struct ast_variable *vp;
 struct ast_config *cfg;
@@ -1021,11 +1022,11 @@
 	rpt_vars[n].p.idtime = retrieve_astcfgint(&rpt_vars[n],this, "idtime", 60000, 2400000, IDTIME);	/* Enforce a min max */
 	rpt_vars[n].p.politeid = retrieve_astcfgint(&rpt_vars[n],this, "politeid", 30000, 300000, POLITEID); /* Enforce a min max */
 	val = ast_variable_retrieve(cfg,this,"tonezone");
-	if (val) rpt_vars[n].p.tonezone = val;
+	if (val) rpt_vars[n].p.tonezone = ast_strdupa(val);
 	rpt_vars[n].p.tailmessages[0] = 0;
 	rpt_vars[n].p.tailmessagemax = 0;
 	val = ast_variable_retrieve(cfg,this,"tailmessagelist");
-	if (val) rpt_vars[n].p.tailmessagemax = finddelim(val, rpt_vars[n].p.tailmessages, 500);
+	if (val) rpt_vars[n].p.tailmessagemax = finddelim(ast_strdupa(val), rpt_vars[n].p.tailmessages, 500);
 	val = ast_variable_retrieve(cfg,this,"memory");
 	if (!val) val = MEMORY;
 	rpt_vars[n].p.memory = val;
@@ -1069,7 +1070,7 @@
 #ifdef	__RPT_NOTCH
 	val = ast_variable_retrieve(cfg,this,"rxnotch");
 	if (val) {
-		i = finddelim(val,strs,MAXFILTERS * 2);
+		i = finddelim(ast_strdupa(val),strs,MAXFILTERS * 2);
 		i &= ~1; /* force an even number, rounded down */
 		if (i >= 2) for(j = 0; j < i; j += 2)
 		{
@@ -1523,7 +1524,7 @@
 }
 
 
-static int send_morse(struct ast_channel *chan, char *string, int speed, int freq, int amplitude)
+static int send_morse(struct ast_channel *chan, const char *string, int speed, int freq, int amplitude)
 {
 
 static struct morse_bits mbits[] = {
@@ -1685,7 +1686,7 @@
 	return res;
 }
 
-static int send_tone_telemetry(struct ast_channel *chan, char *tonestring)
+static int send_tone_telemetry(struct ast_channel *chan, const char *tonestring)
 {
 	char *stringp;
 	char *tonesubset;
@@ -1737,7 +1738,7 @@
 }
 	
 
-static int sayfile(struct ast_channel *mychannel,char *fname)
+static int sayfile(struct ast_channel *mychannel, const char *fname)
 {
 int	res;
 
@@ -1776,7 +1777,7 @@
 }
 
 
-static int telem_any(struct rpt *myrpt,struct ast_channel *chan, char *entry)
+static int telem_any(struct rpt *myrpt,struct ast_channel *chan, const char *entry)
 {
 	int res;
 	char c;
@@ -1837,8 +1838,8 @@
 	
 	int res;
 	int i;
-	char *entry;
-	char *telemetry;
+	const char *entry;
+	const char *telemetry;
 	char *telemetry_save;
 
 	res = 0;
@@ -1882,7 +1883,7 @@
 static int get_wait_interval(struct rpt *myrpt, int type)
 {
         int interval;
-        char *wait_times;
+        const char *wait_times;
         char *wait_times_save;
                                                                                                                   
         wait_times_save = NULL;
@@ -1960,7 +1961,8 @@
 struct	rpt *myrpt;
 struct	rpt_link *l,*m,linkbase;
 struct	ast_channel *mychannel;
-char *p,*ct,*ct_copy,*ident, *nodename;
+	const char *p, *ct;
+	char *ct_copy, *ident, *nodename;
 time_t t;
 struct tm localtm;
 
@@ -2922,7 +2924,8 @@
 static int function_ilink(struct rpt *myrpt, char *param, char *digits, int command_source, struct rpt_link *mylink)
 {
 
-	char *val, *s, *s1, *s2, *tele;
+	const char *val;
+	char *s, *s1, *s2, *tele;
 	char tmp[300], deststr[300] = "",modechange = 0;
 	char digitbuf[MAXNODESTR];
 	struct rpt_link *l;
@@ -3445,7 +3448,7 @@
 static int function_macro(struct rpt *myrpt, char *param, char *digitbuf, int command_source, struct rpt_link *mylink)
 {
 
-char	*val;
+	const char	*val;
 int	i;
 struct	ast_channel *mychannel;
 
@@ -4920,7 +4923,8 @@
 
 static int function_remote(struct rpt *myrpt, char *param, char *digitbuf, int command_source, struct rpt_link *mylink)
 {
-	char *s,*s1,*s2,*val;
+	char *s,*s1,*s2;
+	const char *val;
 	int i,j,ht,k,l,ls2,m,d,res,offset,offsave, modesave, defmode;
 	char multimode = 0;
 	char oc;
@@ -4954,7 +4958,7 @@
 				sayfile(mychannel,"rpt/memory_notfound");
 				return DC_COMPLETE;
 			}			
-			strncpy(tmp,val,sizeof(tmp) - 1);
+			ast_copy_string(tmp, val, sizeof(tmp));
 			s = strchr(tmp,',');
 			if (!s)
 				return DC_ERROR;
@@ -5773,7 +5777,8 @@
 
 static int attempt_reconnect(struct rpt *myrpt, struct rpt_link *l)
 {
-	char *val, *s, *s1, *s2, *tele;
+	const char *val;
+	char *s, *s1, *s2, *tele;
 	char tmp[300], deststr[300] = "";
 
 	val = ast_variable_retrieve(myrpt->cfg, myrpt->p.nodes, l->name);
@@ -6018,7 +6023,8 @@
 static void *rpt(void *this)
 {
 struct	rpt *myrpt = (struct rpt *)this;
-char *tele,*idtalkover,c;
+	char *tele, c;
+	const char *idtalkover;
 int ms = MSWAIT,i,lasttx=0,val,remrx=0,identqueued,othertelemqueued,tailmessagequeued,ctqueued;
 struct ast_channel *who;
 ZT_CONFINFO ci;  /* conference info */
@@ -7156,7 +7162,8 @@
 int	i,n;
 pthread_attr_t attr;
 struct ast_config *cfg;
-char *this,*val;
+	char *this;
+	const char *val;
 
 	/* go thru all the specified repeaters */
 	this = NULL;
@@ -7442,7 +7449,9 @@
                 struct ast_hostent ahp;
                 struct hostent *hp;
 		struct in_addr ia;
-		char hisip[100],nodeip[100],*val, *s, *s1, *s2, *b,*b1;
+		char hisip[100],nodeip[100];
+		const char *val;
+		char *s, *s1, *s2, *b,*b1;
 
 		/* look at callerid to see what node this comes from */
 		if (!chan->cid.cid_num) /* if doesn't have caller id */

Modified: trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_voicemail.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/apps/app_voicemail.c (original)
+++ trunk/apps/app_voicemail.c Wed Sep 20 15:40:39 2006
@@ -3800,7 +3800,8 @@
 	int res = 0, cmd = 0;
 	struct ast_vm_user *receiver = NULL, *vmtmp;
 	AST_LIST_HEAD_NOLOCK_STATIC(extensions, ast_vm_user);
-	char *stringp, *s;
+	char *stringp;
+	const char *s;
 	int saved_messages = 0, found = 0;
 	int valid_extensions = 0;
 	char *dir;
@@ -4097,7 +4098,7 @@
 	return ast_control_streamfile(chan, file, "#", "*", "1456789", "0", "2", skipms);
 }
 
-static int play_message_category(struct ast_channel *chan, char *category)
+static int play_message_category(struct ast_channel *chan, const char *category)
 {
 	int res = 0;
 
@@ -4112,7 +4113,7 @@
 	return res;
 }
 
-static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, char *origtime, char *filename)
+static int play_message_datetime(struct ast_channel *chan, struct ast_vm_user *vmu, const char *origtime, const char *filename)
 {
 	int res = 0;
 	struct vm_zone *the_zone = NULL;
@@ -4180,7 +4181,7 @@
 
 
 
-static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms, char *cid, char *context, int callback)
+static int play_message_callerid(struct ast_channel *chan, struct vm_state *vms, char *cid, const char *context, int callback)
 {
 	int res = 0;
 	int i;
@@ -4243,7 +4244,7 @@
 	return res;
 }
 
-static int play_message_duration(struct ast_channel *chan, struct vm_state *vms, char *duration, int minduration)
+static int play_message_duration(struct ast_channel *chan, struct vm_state *vms, const char *duration, int minduration)
 {
 	int res = 0;
 	int durationm;
@@ -4412,8 +4413,8 @@
 static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struct vm_state *vms)
 {
 	int res = 0;
-	char filename[256],*origtime, *cid, *context, *duration;
-	char *category;
+	char filename[256], *cid;
+	const char *origtime, *context, *category, *duration;
 	struct ast_config *msg_cfg;
 
 	vms->starting = 0; 
@@ -6851,44 +6852,45 @@
 	struct ast_config *cfg, *ucfg;
 	char *cat;
 	struct ast_variable *var;
-	char *notifystr = NULL;
-	char *smdistr = NULL;
-	char *astattach;
-	char *astsearch;
-	char *astsaycid;
-	char *send_voicemail;
+	const char *notifystr = NULL;
+	const char *smdistr = NULL;
+	const char *astattach;
+	const char *astsearch;
+	const char *astsaycid;
+	const char *send_voicemail;
 #ifdef IMAP_STORAGE
-	char *imap_server;
-	char *imap_port;
-	char *imap_flags;
-	char *auth_user;
-	char *auth_password;
-	char *expunge_on_hangup;
+	const char *imap_server;
+	const char *imap_port;
+	const char *imap_flags;
+	const char *auth_user;
+	const char *auth_password;
+	const char *expunge_on_hangup;
 #endif
-	char *astcallop;
-	char *astreview;
-	char *asttempgreetwarn;
-	char *astskipcmd;
-	char *asthearenv;
-	char *astsaydurationinfo;
-	char *astsaydurationminfo;
-	char *silencestr;
-	char *maxmsgstr;
-	char *astdirfwd;
-	char *thresholdstr;
-	char *fmt;
-	char *astemail;
-	char *ucontext;
-	char *astmailcmd = SENDMAIL;
-	char *astforcename;
-	char *astforcegreet;
-	char *s,*q,*stringp;
-	char *dialoutcxt = NULL;
-	char *callbackcxt = NULL;	
-	char *exitcxt = NULL;	
-	char *extpc;
-	char *emaildateformatstr;
-	char *volgainstr;
+	const char *astcallop;
+	const char *astreview;
+	const char *asttempgreetwarn;
+	const char *astskipcmd;
+	const char *asthearenv;
+	const char *astsaydurationinfo;
+	const char *astsaydurationminfo;
+	const char *silencestr;
+	const char *maxmsgstr;
+	const char *astdirfwd;
+	const char *thresholdstr;
+	const char *fmt;
+	const char *astemail;
+	const char *ucontext;
+	const char *astmailcmd = SENDMAIL;
+	const char *astforcename;
+	const char *astforcegreet;
+	const char *s;
+	char *q,*stringp;
+	const char *dialoutcxt = NULL;
+	const char *callbackcxt = NULL;	
+	const char *exitcxt = NULL;	
+	const char *extpc;
+	const char *emaildateformatstr;
+	const char *volgainstr;
 	int x;
 	int tmpadsi[4];
 
@@ -7474,7 +7476,8 @@
 #endif
 	char filename[256];
 	struct ast_config *msg_cfg;
-	char *origtime, *cid, *context, *name, *num;
+	const char *origtime, *context;
+	char *cid, *name, *num;
 	int retries = 0;
 
 	vms->starting = 0; 

Modified: trunk/cdr/cdr_csv.c
URL: http://svn.digium.com/view/asterisk/trunk/cdr/cdr_csv.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/cdr/cdr_csv.c (original)
+++ trunk/cdr/cdr_csv.c Wed Sep 20 15:40:39 2006
@@ -98,7 +98,7 @@
 {
 	struct ast_config *cfg;
 	struct ast_variable *var;
-	char *tmp;
+	const char *tmp;
 
 	usegmtime = 0;
 	loguniqueid = 0;

Modified: trunk/cdr/cdr_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/cdr/cdr_odbc.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/cdr/cdr_odbc.c (original)
+++ trunk/cdr/cdr_odbc.c Wed Sep 20 15:40:39 2006
@@ -246,7 +246,7 @@
 	int res = 0;
 	struct ast_config *cfg;
 	struct ast_variable *var;
-	char *tmp;
+	const char *tmp;
 
 	ast_mutex_lock(&odbc_lock);
 

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Sep 20 15:40:39 2006
@@ -8796,8 +8796,8 @@
 	int capability=iax2_capability;
 	struct ast_variable *v;
 	char *cat;
-	char *utype;
-	char *tosval;
+	const char *utype;
+	const char *tosval;
 	int format;
 	int portno = IAX_DEFAULT_PORTNO;
 	int  x;
@@ -9051,7 +9051,7 @@
 		struct ast_variable *gen;
 		int genhasiax;
 		int genregisteriax;
-		char *hasiax, *registeriax;
+		const char *hasiax, *registeriax;
 		
 		genhasiax = ast_true(ast_variable_retrieve(ucfg, "general", "hasiax"));
 		genregisteriax = ast_true(ast_variable_retrieve(ucfg, "general", "registeriax"));
@@ -9080,9 +9080,9 @@
 				}
 				if (ast_true(registeriax) || (!registeriax && genregisteriax)) {
 					char tmp[256];
-					char *host = ast_variable_retrieve(ucfg, cat, "host");
-					char *username = ast_variable_retrieve(ucfg, cat, "username");
-					char *secret = ast_variable_retrieve(ucfg, cat, "secret");
+					const char *host = ast_variable_retrieve(ucfg, cat, "host");
+					const char *username = ast_variable_retrieve(ucfg, cat, "username");
+					const char *secret = ast_variable_retrieve(ucfg, cat, "secret");
 					if (!host)
 						host = ast_variable_retrieve(ucfg, "general", "host");
 					if (!username)

Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Sep 20 15:40:39 2006
@@ -15975,7 +15975,7 @@
 	if (ucfg) {
 		struct ast_variable *gen;
 		int genhassip, genregistersip;
-		char *hassip, *registersip;
+		const char *hassip, *registersip;
 		
 		genhassip = ast_true(ast_variable_retrieve(ucfg, "general", "hassip"));
 		genregistersip = ast_true(ast_variable_retrieve(ucfg, "general", "registersip"));
@@ -15995,10 +15995,10 @@
 				}
 				if (ast_true(registersip) || (!registersip && genregistersip)) {
 					char tmp[256];
-					char *host = ast_variable_retrieve(ucfg, cat, "host");
-					char *username = ast_variable_retrieve(ucfg, cat, "username");
-					char *secret = ast_variable_retrieve(ucfg, cat, "secret");
-					char *contact = ast_variable_retrieve(ucfg, cat, "contact");
+					const char *host = ast_variable_retrieve(ucfg, cat, "host");
+					const char *username = ast_variable_retrieve(ucfg, cat, "username");
+					const char *secret = ast_variable_retrieve(ucfg, cat, "secret");
+					const char *contact = ast_variable_retrieve(ucfg, cat, "contact");
 					if (!host)
 						host = ast_variable_retrieve(ucfg, "general", "host");
 					if (!username)

Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Wed Sep 20 15:40:39 2006
@@ -10322,7 +10322,7 @@
 	return __unload_module();
 }
 
-static int build_channels(int iscrv, char *value, int reload, int lineno, int *found_pseudo)
+static int build_channels(int iscrv, const char *value, int reload, int lineno, int *found_pseudo)
 {
 	char *c, *chan;
 	int x, y, start, finish;
@@ -10337,7 +10337,7 @@
 		return -1;
 	}
 
-	c = value;
+	c = ast_strdupa(value);
 
 #ifdef HAVE_PRI
 	pri = NULL;
@@ -11162,7 +11162,7 @@
 	cfg = ast_config_load("users.conf");
 	if (cfg) {
 		char *cat;
-		char *chans;
+		const char *chans;
 		process_zap(ast_variable_browse(cfg, "general"), 1, 1);
 		for (cat = ast_category_browse(cfg, NULL); cat ; cat = ast_category_browse(cfg, cat)) {
 			if (!strcasecmp(cat, "general"))

Modified: trunk/channels/iax2-provision.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/iax2-provision.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/channels/iax2-provision.c (original)
+++ trunk/channels/iax2-provision.c Wed Sep 20 15:40:39 2006
@@ -259,7 +259,7 @@
 	return ret;
 }
 
-static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, char *s, char *def)
+static int iax_template_parse(struct iax_template *cur, struct ast_config *cfg, const char *s, const char *def)
 {
 	struct ast_variable *v;
 	int foundportno = 0;
@@ -269,7 +269,7 @@
 	struct hostent *hp;
 	struct ast_hostent h;
 	struct iax_template *src, tmp;
-	char *t;
+	const char *t;
 	if (def) {
 		t = ast_variable_retrieve(cfg, s ,"template");
 		src = NULL;

Modified: trunk/funcs/func_odbc.c
URL: http://svn.digium.com/view/asterisk/trunk/funcs/func_odbc.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/funcs/func_odbc.c (original)
+++ trunk/funcs/func_odbc.c Wed Sep 20 15:40:39 2006
@@ -350,7 +350,7 @@
 
 static int init_acf_query(struct ast_config *cfg, char *catg, struct acf_odbc_query **query)
 {
-	char *tmp;
+	const char *tmp;
 
 	if (!cfg || !catg) {
 		return -1;

Modified: trunk/include/asterisk/config.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/config.h?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/include/asterisk/config.h (original)
+++ trunk/include/asterisk/config.h Wed Sep 20 15:40:39 2006
@@ -100,7 +100,7 @@
  *
  * Returns the variable value on success, or NULL if unable to find it.
  */
-char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable);
+const char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable);
 
 /*! \brief Retrieve a category if it exists
  * \param config which config to use
@@ -172,7 +172,7 @@
 struct ast_config *ast_config_new(void);
 struct ast_category *ast_config_get_current_category(const struct ast_config *cfg);
 void ast_config_set_current_category(struct ast_config *cfg, const struct ast_category *cat);
-char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var);
+const char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var);
 
 struct ast_category *ast_category_new(const char *name);
 void ast_category_append(struct ast_config *config, struct ast_category *cat);

Modified: trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/trunk/main/config.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/main/config.c (original)
+++ trunk/main/config.c Wed Sep 20 15:40:39 2006
@@ -147,9 +147,9 @@
 	return (cat) ? cat->root : NULL;
 }
 
-char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var)
-{
-	char *tmp;
+const char *ast_config_option(struct ast_config *cfg, const char *cat, const char *var)
+{
+	const char *tmp;
 	tmp = ast_variable_retrieve(cfg, cat, var);
 	if (!tmp)
 		tmp = ast_variable_retrieve(cfg, "general", var);
@@ -157,7 +157,7 @@
 }
 
 
-char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable)
+const char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable)
 {
 	struct ast_variable *v;
 

Modified: trunk/main/logger.c
URL: http://svn.digium.com/view/asterisk/trunk/main/logger.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/main/logger.c (original)
+++ trunk/main/logger.c Wed Sep 20 15:40:39 2006
@@ -286,7 +286,7 @@
 	struct logchannel *chan;
 	struct ast_config *cfg;
 	struct ast_variable *var;
-	char *s;
+	const char *s;
 
 	/* delete our list of log channels */
 	AST_LIST_LOCK(&logchannels);

Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Wed Sep 20 15:40:39 2006
@@ -776,9 +776,9 @@
    ast_instring("this|that|more","this",',') == 1;
 
    feel free to move this to app.c -anthm */
-static int ast_instring(char *bigstr, char *smallstr, char delim) 
-{
-	char *val = bigstr, *next;
+static int ast_instring(const char *bigstr, const char *smallstr, char delim) 
+{
+	const char *val = bigstr, *next;
 
 	do {
 		if ((next = strchr(val, delim))) {
@@ -794,7 +794,7 @@
 	return 0;
 }
 
-static int get_perm(char *instr)
+static int get_perm(const char *instr)
 {
 	int x = 0, ret = 0;
 
@@ -2586,7 +2586,8 @@
 int init_manager(void)
 {
 	struct ast_config *cfg = NULL;
-	char *val, *cat = NULL;
+	const char *val;
+	char *cat = NULL;
 	int oldportno = portno;
 	static struct sockaddr_in ba;
 	int x = 1;

Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Wed Sep 20 15:40:39 2006
@@ -3452,7 +3452,7 @@
 int ast_rtp_reload(void)
 {
 	struct ast_config *cfg;
-	char *s;
+	const char *s;
 
 	rtpstart = 5000;
 	rtpend = 31000;

Modified: trunk/main/udptl.c
URL: http://svn.digium.com/view/asterisk/trunk/main/udptl.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/main/udptl.c (original)
+++ trunk/main/udptl.c Wed Sep 20 15:40:39 2006
@@ -1183,7 +1183,7 @@
 void ast_udptl_reload(void)
 {
 	struct ast_config *cfg;
-	char *s;
+	const char *s;
 
 	udptlstart = 4500;
 	udptlend = 4999;

Modified: trunk/pbx/pbx_config.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_config.c?rev=43364&r1=43363&r2=43364&view=diff
==============================================================================
--- trunk/pbx/pbx_config.c (original)
+++ trunk/pbx/pbx_config.c Wed Sep 20 15:40:39 2006
@@ -2171,7 +2171,7 @@
 	int lastpri = -2;
 	struct ast_context *con;
 	struct ast_variable *v;
-	char *cxt;
+	const char *cxt;
 
 	cfg = ast_config_load(config_file);
 	if (!cfg)
@@ -2340,8 +2340,8 @@
 {
 	struct ast_config *cfg;
 	char *cat, *chan;
-	char *zapchan;
-	char *hasexten;
+	const char *zapchan;
+	const char *hasexten;
 	char tmp[256];
 	char iface[256];
 	char zapcopy[256];



More information about the asterisk-commits mailing list