[svn-commits] kpfleming: trunk r948 - /trunk/menuselect.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Oct 14 17:46:20 CDT 2011


Author: kpfleming
Date: Fri Oct 14 17:46:17 2011
New Revision: 948

URL: http://svnview.digium.com/svn/menuselect?view=rev&rev=948
Log:
Ensure that support-level separator items are skipped in every process that
iterates over members of categories in the menuselect tree.


Modified:
    trunk/menuselect.c

Modified: trunk/menuselect.c
URL: http://svnview.digium.com/svn/menuselect/trunk/menuselect.c?view=diff&rev=948&r1=947&r2=948
==============================================================================
--- trunk/menuselect.c (original)
+++ trunk/menuselect.c Fri Oct 14 17:46:17 2011
@@ -260,7 +260,7 @@
 }
 
 /*! \gets const separator strings from support level values */
-static char* separator_name_from_value(int support_level)
+static char *separator_name_from_value(int support_level)
 {
 	switch (support_level) {
 	case SUPPORT_CORE:
@@ -324,7 +324,6 @@
 			break;
 		}
 	}
-
 
 	if (tail_index == -1) { /* None of the nodes that should come before the list were in use, so use head. */
 		if (add_member_head(mem, cat)) { /* Failure to insert the node... */
@@ -574,6 +573,9 @@
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
 			old_failure = mem->depsfailed;
 			AST_LIST_TRAVERSE(&mem->deps, dep, list) {
 				if (dep->member)
@@ -606,6 +608,10 @@
 
 		AST_LIST_TRAVERSE(&categories, cat, list) {
 			AST_LIST_TRAVERSE(&cat->members, mem, list) {
+				if (mem->is_separator) {
+					continue;
+				}
+
 				old_failure = mem->depsfailed;
 
 				if (mem->depsfailed == HARD_FAILURE)
@@ -661,6 +667,10 @@
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			old_failure = mem->conflictsfailed;
 			AST_LIST_TRAVERSE(&mem->conflicts, cnf, list) {
 				if (cnf->member)
@@ -696,6 +706,10 @@
 
 		AST_LIST_TRAVERSE(&categories, cat, list) {
 			AST_LIST_TRAVERSE(&cat->members, mem, list) {
+				if (mem->is_separator) {
+					continue;
+				}
+
 				old_failure = mem->conflictsfailed;
 
 				if (mem->conflictsfailed == HARD_FAILURE)
@@ -832,8 +846,16 @@
 	/* Traverse through each module's dependency list and determine whether each is another module */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			AST_LIST_TRAVERSE(&mem->deps, dep, list) {
 				AST_LIST_TRAVERSE(&cat->members, mem2, list) {
+					if (mem->is_separator) {
+						continue;
+					}
+
 					if (strcasecmp(mem2->name, dep->name))
 						continue;
 
@@ -845,6 +867,10 @@
 
 				AST_LIST_TRAVERSE(&categories, cat2, list) {
 					AST_LIST_TRAVERSE(&cat2->members, mem2, list) {
+						if (mem->is_separator) {
+							continue;
+						}
+
 						if (strcasecmp(mem2->name, dep->name))
 							continue;
 
@@ -861,8 +887,16 @@
 	/* Traverse through each module's use list and determine whether each is another module */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			AST_LIST_TRAVERSE(&mem->uses, use, list) {
 				AST_LIST_TRAVERSE(&cat->members, mem2, list) {
+					if (mem->is_separator) {
+						continue;
+					}
+
 					if (strcasecmp(mem2->name, use->name))
 						continue;
 
@@ -874,6 +908,10 @@
 
 				AST_LIST_TRAVERSE(&categories, cat2, list) {
 					AST_LIST_TRAVERSE(&cat2->members, mem2, list) {
+						if (mem->is_separator) {
+							continue;
+						}
+
 						if (strcasecmp(mem2->name, use->name))
 							continue;
 
@@ -891,6 +929,10 @@
 #if !defined(HAVE_ATTRIBUTE_weak_import) && !defined(HAVE_ATTRIBUTE_weakref) && !defined(HAVE_ATTRIBUTE_weak)
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			AST_LIST_TRAVERSE_SAFE_BEGIN(&mem->uses, use, list) {
 				if (use->member) {
 					AST_LIST_REMOVE_CURRENT(&mem->uses, list);
@@ -908,7 +950,15 @@
 			continue;
 
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			AST_LIST_TRAVERSE(&cat->members, mem2, list) {
+				if (mem->is_separator) {
+					continue;
+				}
+
 				if (mem2 == mem)
 					continue;
 
@@ -925,8 +975,16 @@
 	/* Traverse through each category and determine whether named conflicts for each module are other modules */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			AST_LIST_TRAVERSE(&mem->conflicts, cnf, list) {
 				AST_LIST_TRAVERSE(&cat->members, mem2, list) {
+					if (mem->is_separator) {
+						continue;
+					}
+
 					if (strcasecmp(mem2->name, cnf->name))
 						continue;
 
@@ -938,6 +996,10 @@
 
 				AST_LIST_TRAVERSE(&categories, cat2, list) {
 					AST_LIST_TRAVERSE(&cat2->members, mem2, list) {
+						if (mem->is_separator) {
+							continue;
+						}
+
 						if (strcasecmp(mem2->name, cnf->name))
 							continue;
 
@@ -991,6 +1053,10 @@
 		if (strcmp(category, cat->name))
 			continue;
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if (!strcmp(member, mem->name)) {
 				mem->was_enabled = mem->enabled = (negate ? !cat->positive_output : cat->positive_output);
 				print_debug("Just set %s enabled to %d\n", mem->name, mem->enabled);
@@ -1099,6 +1165,10 @@
 	int i = 0;
 
 	AST_LIST_TRAVERSE(&cat->members, mem, list) {
+		if (mem->is_separator) {
+			continue;
+		}
+
 		if (i++ == index)
 			break;
 	}
@@ -1127,6 +1197,10 @@
 	int i = 0;
 
 	AST_LIST_TRAVERSE(&cat->members, mem, list) {
+		if (mem->is_separator) {
+			continue;
+		}
+
 		if (i++ == index)
 			break;
 	}
@@ -1159,6 +1233,10 @@
 		if (strcasecmp(cat->name, cat_name))
 			continue;
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if (strcasecmp(mem->name, mem_name))
 				continue;
 
@@ -1259,6 +1337,10 @@
 	 */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			AST_LIST_TRAVERSE(&mem->uses, use, list) {
 				if (use->member) {
 					use->met = 0;
@@ -1276,6 +1358,10 @@
 	/* Traverse all categories and members and output dependencies for each member */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			unsigned char header_printed = 0;
 
 			if (AST_LIST_EMPTY(&mem->deps) && AST_LIST_EMPTY(&mem->uses))
@@ -1343,6 +1429,10 @@
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		fprintf(f, "%s=", cat->name);
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if ((!cat->positive_output && (!mem->enabled || mem->depsfailed || mem->conflictsfailed)) ||
 			    (cat->positive_output && mem->enabled && !mem->depsfailed && !mem->conflictsfailed))
 				fprintf(f, "%s ", mem->name);
@@ -1356,6 +1446,10 @@
 	fprintf(f, "MENUSELECT_BUILD_DEPS=");
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if ((!cat->positive_output && (!mem->enabled || mem->depsfailed || mem->conflictsfailed)) ||
 			    (cat->positive_output && mem->enabled && !mem->depsfailed && !mem->conflictsfailed))
 				continue;
@@ -1390,6 +1484,10 @@
 	/* Output which members were disabled because of failed dependencies or conflicts */
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if (mem->depsfailed != HARD_FAILURE && mem->conflictsfailed != HARD_FAILURE)
 				continue;
 
@@ -1415,6 +1513,10 @@
 		char *file, *buf;
 
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if ((mem->enabled == mem->was_enabled) && !mem->was_defaulted)
 				continue;
 
@@ -1473,6 +1575,10 @@
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		fprintf(stderr, "Category: '%s'\n", cat->name);
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			fprintf(stderr, "   ==>> Member: '%s'  (%s)", mem->name, mem->enabled ? "Enabled" : "Disabled");
 			fprintf(stderr, "        Was %s\n", mem->was_enabled ? "Enabled" : "Disabled");
 			if (mem->defaultenabled)
@@ -1533,6 +1639,9 @@
 		if (mem->enabled == val)
 			continue;
 
+		if (mem->is_separator)
+			continue;
+
 		if ((mem->depsfailed == HARD_FAILURE) || (mem->conflictsfailed == HARD_FAILURE))
 			continue;
 
@@ -1608,6 +1717,10 @@
 		group_header_printed = 0;
 		AST_LIST_TRAVERSE(&categories, cat, list) {
 			AST_LIST_TRAVERSE(&cat->members, mem, list) {
+				if (mem->is_separator) {
+					continue;
+				}
+
 				if (!mem->enabled) {
 					continue;
 				}
@@ -1632,6 +1745,10 @@
 		group_header_printed = 0;
 		AST_LIST_TRAVERSE(&categories, cat, list) {
 			AST_LIST_TRAVERSE(&cat->members, mem, list) {
+				if (mem->is_separator) {
+					continue;
+				}
+
 				if (!mem->enabled) {
 					continue;
 				}
@@ -1662,6 +1779,10 @@
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if ((mem->depsfailed || mem->conflictsfailed) && mem->enabled) {
 				fprintf(stderr, "\n"
 					"***********************************************************\n"
@@ -1692,6 +1813,10 @@
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if (!mem->defaultenabled)
 				continue;
 
@@ -1721,6 +1846,10 @@
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		AST_LIST_TRAVERSE(&cat->members, mem, list) {
+			if (mem->is_separator) {
+				continue;
+			}
+
 			if (!strcasecmp(name, mem->name)) {
 				return mem;
 			}
@@ -1862,6 +1991,10 @@
 			struct member *mem;
 			AST_LIST_TRAVERSE(&categories, cat, list) {
 				AST_LIST_TRAVERSE(&cat->members, mem, list) {
+					if (mem->is_separator) {
+						continue;
+					}
+
 					fprintf(stdout, "%c %-30.30s %s\n", mem->enabled ? '+' : '-', mem->name, cat->name);
 				}
 			}
@@ -1870,6 +2003,10 @@
 			struct member *mem;
 			if ((cat = find_category(list_group))) {
 				AST_LIST_TRAVERSE(&cat->members, mem, list) {
+					if (mem->is_separator) {
+						continue;
+					}
+
 					fprintf(stdout, "%c %s\n", mem->enabled ? '+' : '-', mem->name);
 				}
 			}




More information about the svn-commits mailing list