[svn-commits] murf: branch murf/bug8684-trunk r81188 - in /team/murf/bug8684-trunk: apps/ c...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 27 18:56:42 CDT 2007


Author: murf
Date: Mon Aug 27 18:56:41 2007
New Revision: 81188

URL: http://svn.digium.com/view/asterisk?view=rev&rev=81188
Log:
A crude start to writing out include trees-- gather the info you'll need later.

Modified:
    team/murf/bug8684-trunk/apps/app_directory.c
    team/murf/bug8684-trunk/apps/app_minivm.c
    team/murf/bug8684-trunk/apps/app_parkandannounce.c
    team/murf/bug8684-trunk/apps/app_voicemail.c
    team/murf/bug8684-trunk/channels/chan_iax2.c
    team/murf/bug8684-trunk/channels/chan_sip.c
    team/murf/bug8684-trunk/channels/chan_skinny.c
    team/murf/bug8684-trunk/channels/iax2-parser.c
    team/murf/bug8684-trunk/include/asterisk/config.h
    team/murf/bug8684-trunk/main/channel.c
    team/murf/bug8684-trunk/main/config.c
    team/murf/bug8684-trunk/main/http.c
    team/murf/bug8684-trunk/main/manager.c
    team/murf/bug8684-trunk/pbx/pbx_spool.c
    team/murf/bug8684-trunk/res/res_config_odbc.c
    team/murf/bug8684-trunk/res/res_config_pgsql.c
    team/murf/bug8684-trunk/res/res_config_sqlite.c
    team/murf/bug8684-trunk/utils/extconf.c

Modified: team/murf/bug8684-trunk/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/apps/app_directory.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/apps/app_directory.c (original)
+++ team/murf/bug8684-trunk/apps/app_directory.c Mon Aug 27 18:56:41 2007
@@ -402,7 +402,7 @@
 		snprintf(tmp, sizeof(tmp), "no-password,%s,hidefromdir=%s",
 			 fullname ? fullname : "",
 			 hidefromdir ? hidefromdir : "no");
-		var = ast_variable_new(mailbox, tmp);
+		var = ast_variable_new(mailbox, tmp, "");
 		if (var)
 			ast_variable_append(cat, var);
 		else

Modified: team/murf/bug8684-trunk/apps/app_minivm.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/apps/app_minivm.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/apps/app_minivm.c (original)
+++ team/murf/bug8684-trunk/apps/app_minivm.c Mon Aug 27 18:56:41 2007
@@ -2141,7 +2141,7 @@
 			if (varname && (varval = strchr(varname, '='))) {
 				*varval = '\0';
 				varval++;
-				if ((tmpvar = ast_variable_new(varname, varval))) {
+				if ((tmpvar = ast_variable_new(varname, varval, ""))) {
 					tmpvar->next = vmu->chanvars;
 					vmu->chanvars = tmpvar;
 				}

Modified: team/murf/bug8684-trunk/apps/app_parkandannounce.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/apps/app_parkandannounce.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/apps/app_parkandannounce.c (original)
+++ team/murf/bug8684-trunk/apps/app_parkandannounce.c Mon Aug 27 18:56:41 2007
@@ -130,7 +130,7 @@
 
 	snprintf(buf, sizeof(buf), "%d", lot);
 	oh.parent_channel = chan;
-	oh.vars = ast_variable_new("_PARKEDAT", buf);
+	oh.vars = ast_variable_new("_PARKEDAT", buf, "");
 	dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, args.dial, 30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh);
 
 	if (dchan) {

Modified: team/murf/bug8684-trunk/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/apps/app_voicemail.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/apps/app_voicemail.c (original)
+++ team/murf/bug8684-trunk/apps/app_voicemail.c Mon Aug 27 18:56:41 2007
@@ -960,7 +960,7 @@
 			if (!strcasecmp(category, vmu->mailbox)) {
 				if (!(tmp = ast_variable_retrieve(cfg, category, "vmsecret"))) {
 					ast_debug(3, "looks like we need to make vmsecret!\n");
-					var = ast_variable_new("vmsecret", newpassword);
+					var = ast_variable_new("vmsecret", newpassword, "");
 				} 
 				new = alloca(strlen(newpassword)+1);
 				sprintf(new, "%s", newpassword);

Modified: team/murf/bug8684-trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/channels/chan_iax2.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/channels/chan_iax2.c (original)
+++ team/murf/bug8684-trunk/channels/chan_iax2.c Mon Aug 27 18:56:41 2007
@@ -5247,7 +5247,7 @@
 		/* We found our match (use the first) */
 		/* copy vars */
 		for (v = user->vars ; v ; v = v->next) {
-			if((tmpvar = ast_variable_new(v->name, v->value))) {
+			if((tmpvar = ast_variable_new(v->name, v->value, v->file))) {
 				tmpvar->next = iaxs[callno]->vars; 
 				iaxs[callno]->vars = tmpvar;
 			}
@@ -9763,7 +9763,7 @@
 				if (varname && (varval = strchr(varname,'='))) {
 					*varval = '\0';
 					varval++;
-					if((tmpvar = ast_variable_new(varname, varval))) {
+					if((tmpvar = ast_variable_new(varname, varval, ""))) {
 						tmpvar->next = user->vars; 
 						user->vars = tmpvar;
 					}

Modified: team/murf/bug8684-trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/channels/chan_sip.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/channels/chan_sip.c (original)
+++ team/murf/bug8684-trunk/channels/chan_sip.c Mon Aug 27 18:56:41 2007
@@ -10028,7 +10028,7 @@
 	struct ast_variable *res = NULL, *tmp, *v = NULL;
 
 	for (v = src ; v ; v = v->next) {
-		if ((tmp = ast_variable_new(v->name, v->value))) {
+		if ((tmp = ast_variable_new(v->name, v->value, v->file))) {
 			tmp->next = res;
 			res = tmp;
 		}
@@ -17140,7 +17140,7 @@
 	
 	if ((varval = strchr(varname,'='))) {
 		*varval++ = '\0';
-		if ((tmpvar = ast_variable_new(varname, varval))) {
+		if ((tmpvar = ast_variable_new(varname, varval, ""))) {
 			tmpvar->next = list;
 			list = tmpvar;
 		}

Modified: team/murf/bug8684-trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/channels/chan_skinny.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/channels/chan_skinny.c (original)
+++ team/murf/bug8684-trunk/channels/chan_skinny.c Mon Aug 27 18:56:41 2007
@@ -1463,7 +1463,7 @@
 
 	if ((varval = strchr(varname,'='))) {
 		*varval++ = '\0';
-		if ((tmpvar = ast_variable_new(varname, varval))) {
+		if ((tmpvar = ast_variable_new(varname, varval, ""))) {
 			tmpvar->next = list;
 			list = tmpvar;
 		}

Modified: team/murf/bug8684-trunk/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/channels/iax2-parser.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/channels/iax2-parser.c (original)
+++ team/murf/bug8684-trunk/channels/iax2-parser.c Mon Aug 27 18:56:41 2007
@@ -917,7 +917,7 @@
 					int len = strlen(var2->value) + strlen(tmp2) + 1;
 					char *tmp3 = alloca(len);
 					snprintf(tmp3, len, "%s%s", var2->value, tmp2);
-					var = ast_variable_new(tmp, tmp3);
+					var = ast_variable_new(tmp, tmp3, var2->file);
 					var->next = var2->next;
 					if (prev)
 						prev->next = var;
@@ -928,7 +928,7 @@
 				}
 			}
 			if (!var2) {
-				var = ast_variable_new(tmp, tmp2);
+				var = ast_variable_new(tmp, tmp2, "");
 				var->next = ies->vars;
 				ies->vars = var;
 			}

Modified: team/murf/bug8684-trunk/include/asterisk/config.h
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/include/asterisk/config.h?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/include/asterisk/config.h (original)
+++ team/murf/bug8684-trunk/include/asterisk/config.h Mon Aug 27 18:56:41 2007
@@ -52,6 +52,7 @@
 struct ast_variable {
 	char *name;
 	char *value;
+	char *file;
 	int lineno;
 	int object;		/*!< 0 for variable, 1 for object */
 	int blanklines; 	/*!< Number of blanklines following entry */
@@ -249,11 +250,13 @@
 struct ast_variable *ast_category_detach_variables(struct ast_category *cat);
 void ast_category_rename(struct ast_category *cat, const char *name);
 
-struct ast_variable *ast_variable_new(const char *name, const char *value);
+struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename);
+struct ast_config_include *ast_include_new(const char *from_file, const char *included_file, int is_exec, int from_lineno);
+	void ast_include_append(struct ast_config *conf, struct ast_config_include *incl);
 void ast_variable_append(struct ast_category *category, struct ast_variable *variable);
 int ast_variable_delete(struct ast_category *category, const char *variable, const char *match);
 int ast_variable_update(struct ast_category *category, const char *variable, 
-	const char *value, const char *match, unsigned int object);
+						const char *value, const char *match, unsigned int object);
 
 int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator);
 

Modified: team/murf/bug8684-trunk/main/channel.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/main/channel.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/main/channel.c (original)
+++ team/murf/bug8684-trunk/main/channel.c Mon Aug 27 18:56:41 2007
@@ -177,10 +177,10 @@
 	struct ast_variable *var=NULL, *prev = NULL;
 	AST_LIST_TRAVERSE(&backends, cl, list) {
 		if (prev)  {
-			if ((prev->next = ast_variable_new(cl->tech->type, cl->tech->description)))
+			if ((prev->next = ast_variable_new(cl->tech->type, cl->tech->description, "")))
 				prev = prev->next;
 		} else {
-			var = ast_variable_new(cl->tech->type, cl->tech->description);
+			var = ast_variable_new(cl->tech->type, cl->tech->description, "");
 			prev = var;
 		}
 	}

Modified: team/murf/bug8684-trunk/main/config.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/main/config.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/main/config.c (original)
+++ team/murf/bug8684-trunk/main/config.c Mon Aug 27 18:56:41 2007
@@ -195,22 +195,51 @@
 	struct ast_category *last_browse;		/*!< used to cache the last category supplied via category_browse */
 	int include_level;
 	int max_include_level;
+	struct ast_config_include *includes;  /*!< a list of inclusions, which should describe the entire tree */
 };
 
-struct ast_variable *ast_variable_new(const char *name, const char *value) 
+struct ast_config_include {
+	char *include_location_file; /*!< file name in which the include occurs */
+	int  include_location_lineno; /*!< lineno where include occurred */
+	int  exec; /*!< set to non-zero if itsa #exec statement */
+	char *included_file; /*!< file name included */
+	
+	struct ast_config_include *next; /*!< ptr to next inclusion in the list */
+};
+
+struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename) 
 {
 	struct ast_variable *variable;
 	int name_len = strlen(name) + 1;	
 
-	if ((variable = ast_calloc(1, name_len + strlen(value) + 1 + sizeof(*variable)))) {
+	if ((variable = ast_calloc(1, name_len + strlen(value) + 1 + strlen(filename) + 1 + sizeof(*variable)))) {
 		variable->name = variable->stuff;
 		variable->value = variable->stuff + name_len;		
+		variable->file = variable->stuff + name_len + strlen(value) + 1;		
 		strcpy(variable->name,name);
 		strcpy(variable->value,value);
-	}
-
+		strcpy(variable->file,filename);
+	}
 	return variable;
 }
+
+struct ast_config_include *ast_include_new(const char *from_file, const char *included_file, int is_exec, int from_lineno)
+{
+	struct ast_config_include *inc = ast_calloc(1,sizeof(struct ast_config_include));
+	
+	inc->include_location_file = ast_strdup(from_file);
+	inc->include_location_lineno = from_lineno;
+	inc->included_file = (char *)included_file;
+	inc->exec = is_exec;
+	return inc;
+}
+
+void ast_include_append(struct ast_config *conf, struct ast_config_include *incl)
+{
+	incl->next = conf->includes;
+	conf->includes = incl;
+}
+
 
 void ast_variable_append(struct ast_category *category, struct ast_variable *variable)
 {
@@ -281,11 +310,12 @@
 
 static struct ast_variable *variable_clone(const struct ast_variable *old)
 {
-	struct ast_variable *new = ast_variable_new(old->name, old->value);
+	struct ast_variable *new = ast_variable_new(old->name, old->value, old->file);
 
 	if (new) {
 		new->lineno = old->lineno;
 		new->object = old->object;
+		new->file = old->file;
 		new->blanklines = old->blanklines;
 		/* TODO: clone comments? */
 	}
@@ -494,13 +524,10 @@
 }
 
 int ast_variable_update(struct ast_category *category, const char *variable, 
-	const char *value, const char *match, unsigned int object)
+						const char *value, const char *match, unsigned int object)
 {
 	struct ast_variable *cur, *prev=NULL, *newer;
 
-	if (!(newer = ast_variable_new(variable, value)))
-		return -1;
-	
 	newer->object = object;
 
 	for (cur = category->root; cur; prev = cur, cur = cur->next) {
@@ -508,6 +535,9 @@
 			(!ast_strlen_zero(match) && strcasecmp(cur->value, match)))
 			continue;
 
+		if (!(newer = ast_variable_new(variable, value, cur->file)))
+			return -1;
+	
 		newer->next = cur->next;
 		newer->object = cur->object || object;
 		if (prev)
@@ -814,7 +844,7 @@
 				c++;
 			} else
 				object = 0;
-			if ((v = ast_variable_new(ast_strip(cur), ast_strip(c)))) {
+			if ((v = ast_variable_new(ast_strip(cur), ast_strip(c), configfile))) {
 				v->lineno = lineno;
 				v->object = object;
 				/* Put and reset comments */

Modified: team/murf/bug8684-trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/main/http.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/main/http.c (original)
+++ team/murf/bug8684-trunk/main/http.c Mon Aug 27 18:56:41 2007
@@ -567,7 +567,7 @@
 			else 
 				val = "";
 			ast_uri_decode(var);
-			if ((v = ast_variable_new(var, val))) {
+			if ((v = ast_variable_new(var, val, ""))) {
 				if (vars)
 					prev->next = v;
 				else
@@ -778,7 +778,7 @@
 			value = ast_skip_blanks(value);
 			if (ast_strlen_zero(value))
 				continue;
-			var = ast_variable_new(name, value);
+			var = ast_variable_new(name, value, "");
 			if (!var)
 				continue;
 			var->next = headers;
@@ -818,7 +818,7 @@
 			vval++;
 		if ( (l = strlen(vval)) )
 			vval[l - 1] = '\0';	/* trim trailing quote */
-		var = ast_variable_new(vname, vval);
+		var = ast_variable_new(vname, vval, "");
 		if (var) {
 			if (prev)
 				prev->next = var;

Modified: team/murf/bug8684-trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/main/manager.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/main/manager.c (original)
+++ team/murf/bug8684-trunk/main/manager.c Mon Aug 27 18:56:41 2007
@@ -791,7 +791,7 @@
 			strsep(&val, "=");
 			if (!val || ast_strlen_zero(var))
 				continue;
-			cur = ast_variable_new(var, val);
+			cur = ast_variable_new(var, val, "");
 			cur->next = head;
 			head = cur;
 		}
@@ -1276,7 +1276,7 @@
 		} else if (!strcasecmp(action, "append")) {
 			if (!ast_strlen_zero(cat) && !ast_strlen_zero(var) &&
 				(category = ast_category_get(cfg, cat)) &&
-				(v = ast_variable_new(var, value))){
+				(v = ast_variable_new(var, value, ""))){
 				if (object || (match && !strcasecmp(match, "object")))
 					v->object = 1;
 				ast_variable_append(category, v);

Modified: team/murf/bug8684-trunk/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/pbx/pbx_spool.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/pbx/pbx_spool.c (original)
+++ team/murf/bug8684-trunk/pbx/pbx_spool.c Mon Aug 27 18:56:41 2007
@@ -219,7 +219,7 @@
 					c2 = c;
 					strsep(&c2, "=");
 					if (c2) {
-						var = ast_variable_new(c, c2);
+						var = ast_variable_new(c, c2, fn);
 						if (var) {
 							var->next = o->vars;
 							o->vars = var;

Modified: team/murf/bug8684-trunk/res/res_config_odbc.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/res/res_config_odbc.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/res/res_config_odbc.c (original)
+++ team/murf/bug8684-trunk/res/res_config_odbc.c Mon Aug 27 18:56:41 2007
@@ -219,11 +219,11 @@
 			chunk = strsep(&stringp, ";");
 			if (!ast_strlen_zero(ast_strip(chunk))) {
 				if (prev) {
-					prev->next = ast_variable_new(coltitle, chunk);
+					prev->next = ast_variable_new(coltitle, chunk, "");
 					if (prev->next)
 						prev = prev->next;
 				} else 
-					prev = var = ast_variable_new(coltitle, chunk);
+					prev = var = ast_variable_new(coltitle, chunk, "");
 			}
 		}
 	}
@@ -366,7 +366,7 @@
 				if (!ast_strlen_zero(ast_strip(chunk))) {
 					if (initfield && !strcmp(initfield, coltitle))
 						ast_category_rename(cat, chunk);
-					var = ast_variable_new(coltitle, chunk);
+					var = ast_variable_new(coltitle, chunk, "");
 					ast_variable_append(cat, var);
 				}
 			}
@@ -700,7 +700,7 @@
 			ast_category_append(cfg, cur_cat);
 		}
 
-		new_v = ast_variable_new(q.var_name, q.var_val);
+		new_v = ast_variable_new(q.var_name, q.var_val, "");
 		ast_variable_append(cur_cat, new_v);
 	}
 

Modified: team/murf/bug8684-trunk/res/res_config_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/res/res_config_pgsql.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/res/res_config_pgsql.c (original)
+++ team/murf/bug8684-trunk/res/res_config_pgsql.c Mon Aug 27 18:56:41 2007
@@ -175,12 +175,12 @@
 					chunk = strsep(&stringp, ";");
 					if (!ast_strlen_zero(ast_strip(chunk))) {
 						if (prev) {
-							prev->next = ast_variable_new(fieldnames[i], chunk);
+							prev->next = ast_variable_new(fieldnames[i], chunk, "");
 							if (prev->next) {
 								prev = prev->next;
 							}
 						} else {
-							prev = var = ast_variable_new(fieldnames[i], chunk);
+							prev = var = ast_variable_new(fieldnames[i], chunk, "");
 						}
 					}
 				}
@@ -323,7 +323,7 @@
 						if (initfield && !strcmp(initfield, fieldnames[i])) {
 							ast_category_rename(cat, chunk);
 						}
-						var = ast_variable_new(fieldnames[i], chunk);
+						var = ast_variable_new(fieldnames[i], chunk, "");
 						ast_variable_append(cat, var);
 					}
 				}
@@ -697,7 +697,7 @@
 				last_cat_metric = atoi(field_cat_metric);
 				ast_category_append(cfg, cur_cat);
 			}
-			new_v = ast_variable_new(field_var_name, field_var_val);
+			new_v = ast_variable_new(field_var_name, field_var_val, "");
 			ast_variable_append(cur_cat, new_v);
 		}
 	} else {

Modified: team/murf/bug8684-trunk/res/res_config_sqlite.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/res/res_config_sqlite.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/res/res_config_sqlite.c (original)
+++ team/murf/bug8684-trunk/res/res_config_sqlite.c Mon Aug 27 18:56:41 2007
@@ -755,7 +755,7 @@
 	}
 
 	var = ast_variable_new(argv[RES_SQLITE_CONFIG_VAR_NAME],
-		 argv[RES_SQLITE_CONFIG_VAR_VAL]);
+						   argv[RES_SQLITE_CONFIG_VAR_VAL], "");
 
 	if (!var) {
 		ast_log(LOG_WARNING, "Unable to allocate variable");
@@ -856,7 +856,7 @@
 		if (!argv[i])
 			continue;
 
-		if (!(var = ast_variable_new(columnNames[i], argv[i])))
+		if (!(var = ast_variable_new(columnNames[i], argv[i], "")))
 			return 1;
 
 		if (!args->var)
@@ -1001,7 +1001,7 @@
 		if (!argv[i] || !strcmp(args->initfield, columnNames[i]))
 			continue;
 
-		if (!(var = ast_variable_new(columnNames[i], argv[i]))) {
+		if (!(var = ast_variable_new(columnNames[i], argv[i], ""))) {
 			ast_log(LOG_WARNING, "Unable to allocate variable\n");
 			return 1;
 		}

Modified: team/murf/bug8684-trunk/utils/extconf.c
URL: http://svn.digium.com/view/asterisk/team/murf/bug8684-trunk/utils/extconf.c?view=diff&rev=81188&r1=81187&r2=81188
==============================================================================
--- team/murf/bug8684-trunk/utils/extconf.c (original)
+++ team/murf/bug8684-trunk/utils/extconf.c Mon Aug 27 18:56:41 2007
@@ -658,6 +658,7 @@
 struct ast_variable {
 	char *name;
 	char *value;
+	char *file;
 	int lineno;
 	int object;		/*!< 0 for variable, 1 for object */
 	int blanklines; 	/*!< Number of blanklines following entry */
@@ -676,18 +677,20 @@
 static void ast_variables_destroy(struct ast_variable *v);
 static void ast_config_destroy(struct ast_config *cfg);
 
-static struct ast_variable *ast_variable_new(const char *name, const char *value);
-
-static struct ast_variable *ast_variable_new(const char *name, const char *value) 
+static struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename);
+
+static struct ast_variable *ast_variable_new(const char *name, const char *value, const char *filename) 
 {
 	struct ast_variable *variable;
 	int name_len = strlen(name) + 1;	
 
-	if ((variable = ast_calloc(1, name_len + strlen(value) + 1 + sizeof(*variable)))) {
+	if ((variable = ast_calloc(1, name_len + strlen(value) + 1 + strlen(filename) + 1 + sizeof(*variable)))) {
 		variable->name = variable->stuff;
 		variable->value = variable->stuff + name_len;		
+		variable->file = variable->value + strlen(value) + 1;		
 		strcpy(variable->name,name);
 		strcpy(variable->value,value);
+		strcpy(variable->file,filename);
 	}
 
 	return variable;
@@ -768,7 +771,7 @@
 
 static struct ast_variable *variable_clone(const struct ast_variable *old)
 {
-	struct ast_variable *new = ast_variable_new(old->name, old->value);
+	struct ast_variable *new = ast_variable_new(old->name, old->value, old->file);
 
 	if (new) {
 		new->lineno = old->lineno;
@@ -3447,7 +3450,7 @@
 				c++;
 			} else
 				object = 0;
-			if ((v = ast_variable_new(ast_strip(cur), ast_strip(c)))) {
+			if ((v = ast_variable_new(ast_strip(cur), ast_strip(c), configfile))) {
 				v->lineno = lineno;
 				v->object = object;
 				/* Put and reset comments */




More information about the svn-commits mailing list