[asterisk-commits] branch russell/menuselect_buildoptions r34490 - /team/russell/menuselect_buil...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jun 16 09:10:34 MST 2006


Author: russell
Date: Fri Jun 16 11:10:33 2006
New Revision: 34490

URL: http://svn.digium.com/view/asterisk?rev=34490&view=rev
Log:
remove some old changes that were still there

Modified:
    team/russell/menuselect_buildoptions/build_tools/menuselect.c
    team/russell/menuselect_buildoptions/build_tools/menuselect.h

Modified: team/russell/menuselect_buildoptions/build_tools/menuselect.c
URL: http://svn.digium.com/view/asterisk/team/russell/menuselect_buildoptions/build_tools/menuselect.c?rev=34490&r1=34489&r2=34490&view=diff
==============================================================================
--- team/russell/menuselect_buildoptions/build_tools/menuselect.c (original)
+++ team/russell/menuselect_buildoptions/build_tools/menuselect.c Fri Jun 16 11:10:33 2006
@@ -73,6 +73,18 @@
 /*! Force a clean of the source tree */
 static int force_clean = 0;
 
+static int add_category(struct category *cat);
+static int add_member(struct member *mem, struct category *cat);
+static int parse_makeopts_xml(const char *makeopts_xml);
+static int process_deps(void);
+static int build_member_list(void);
+static void mark_as_present(const char *member, const char *category);
+static void process_prev_failed_deps(char *buf);
+static int parse_existing_config(const char *infile);
+static int generate_makeopts_file(void);
+static void free_member_list(void);
+static void free_trees(void);
+
 /*! \brief return a pointer to the first non-whitespace character */
 static inline char *skip_blanks(char *str)
 {
@@ -117,53 +129,15 @@
 	return 0;
 }
 
-/*! \brief Free a member structure and all of its members */
-static void free_member(struct member *mem)
-{
+/*! \brief Parse an input makeopts file */
+static int parse_makeopts_xml(const char *makeopts_xml)
+{
+	FILE *f;
+	struct category *cat;
+	struct tree *tree;
+	struct member *mem;
 	struct depend *dep;
 	struct conflict *cnf;
-	struct buildopt *bop;
-
-	while ((dep = AST_LIST_REMOVE_HEAD(&mem->deps, list)))
-		free(dep);
-	while ((cnf = AST_LIST_REMOVE_HEAD(&mem->conflicts, list)))
-		free(cnf);
-	while ((bop = AST_LIST_REMOVE_HEAD(&mem->buildopts, list)))
-		free(bop);
-	free(mem);
-}
-
-/*! \brief Free all categories and their members */
-static void free_member_list(void)
-{
-	struct category *cat;
-	struct member *mem;
-
-	while ((cat = AST_LIST_REMOVE_HEAD(&categories, list))) {
-		while ((mem = AST_LIST_REMOVE_HEAD(&cat->members, list)))
-			free_member(mem);
-		free(cat);
-	}
-}
-
-/*! \brief Free all of the XML trees */
-static void free_trees(void)
-{
-	struct tree *tree;
-
-	while ((tree = AST_LIST_REMOVE_HEAD(&trees, list))) {
-		mxmlDelete(tree->root);
-		free(tree);
-	}
-}
-
-/*! \brief Parse an input makeopts file */
-static int parse_makeopts_xml(const char *makeopts_xml)
-{
-	FILE *f;
-	struct category *cat;
-	struct tree *tree;
-	struct member *mem;
 	mxml_node_t *cur;
 	mxml_node_t *cur2;
 	mxml_node_t *cur3;
@@ -229,11 +203,8 @@
 			     cur3 && cur3->child;
 			     cur3 = mxmlFindElement(cur3, cur2, "depend", NULL, NULL, MXML_DESCEND))
 			{
-				struct depend *dep;
-				if (!(dep = calloc(1, sizeof(*dep)))) {
-					free_member(mem);
+				if (!(dep = calloc(1, sizeof(*dep))))
 					return -1;
-				}
 				if (!strlen_zero(cur3->child->value.opaque)) {
 					dep->name = cur3->child->value.opaque;
 					AST_LIST_INSERT_HEAD(&mem->deps, dep, list);
@@ -245,11 +216,8 @@
 			     cur3 && cur3->child;
 			     cur3 = mxmlFindElement(cur3, cur2, "conflict", NULL, NULL, MXML_DESCEND))
 			{
-				struct conflict *cnf;
-				if (!(cnf = calloc(1, sizeof(*cnf)))) {
-					free_member(mem);
+				if (!(cnf = calloc(1, sizeof(*cnf))))
 					return -1;
-				}
 				if (!strlen_zero(cur3->child->value.opaque)) {
 					cnf->name = cur3->child->value.opaque;
 					AST_LIST_INSERT_HEAD(&mem->conflicts, cnf, list);
@@ -257,24 +225,8 @@
 					free(cnf);
 			}
 
-			for (cur3 = mxmlFindElement(cur2, cur2, "buildopt", NULL, NULL, MXML_DESCEND);
-			     cur3 && cur3->child;
-			     cur3 = mxmlFindElement(cur3, cur2, "buildopt", NULL, NULL, MXML_DESCEND))
-			{
-				struct buildopt *bop;
-				if (!(bop = calloc(1, sizeof(*bop)))) {
-					free_member(mem);
-					return -1;
-				}
-				if (!strlen_zero(cur3->child->value.opaque)) {
-					bop->name = cur3->child->value.opaque;
-					AST_LIST_INSERT_HEAD(&mem->buildopts, bop, list);
-				} else
-					free(bop);
-			}
-
 			if (add_member(mem, cat))
-				free_member(mem);
+				free(mem);
 		}
 	}
 
@@ -561,7 +513,6 @@
 	struct member *mem;
 	struct depend *dep;
 	struct conflict *cnf;
-	struct buildopt *bop;
 
 	AST_LIST_TRAVERSE(&categories, cat, list) {
 		fprintf(stderr, "Category: '%s'\n", cat->name);
@@ -575,12 +526,41 @@
 				fprintf(stderr, "      --> Conflicts with: '%s'\n", cnf->name);
 			if (!AST_LIST_EMPTY(&mem->conflicts))
 				fprintf(stderr, "      --> Conflicts Found: %s\n", mem->conflictsfailed ? "Yes" : "No");
-			AST_LIST_TRAVERSE(&mem->buildopts, bop, list)
-				fprintf(stderr, "      --> Build Option: %s\n", bop->name);
 		}
 	}
 }
 #endif
+
+/*! \brief Free all categories and their members */
+static void free_member_list(void)
+{
+	struct category *cat;
+	struct member *mem;
+	struct depend *dep;
+	struct conflict *cnf;
+
+	while ((cat = AST_LIST_REMOVE_HEAD(&categories, list))) {
+		while ((mem = AST_LIST_REMOVE_HEAD(&cat->members, list))) {
+			while ((dep = AST_LIST_REMOVE_HEAD(&mem->deps, list)))
+				free(dep);
+			while ((cnf = AST_LIST_REMOVE_HEAD(&mem->conflicts, list)))
+				free(cnf);
+			free(mem);
+		}
+		free(cat);
+	}
+}
+
+/*! \brief Free all of the XML trees */
+static void free_trees(void)
+{
+	struct tree *tree;
+
+	while ((tree = AST_LIST_REMOVE_HEAD(&trees, list))) {
+		mxmlDelete(tree->root);
+		free(tree);
+	}
+}
 
 /*! \brief Enable/Disable all members of a category as long as dependencies have been met and no conflicts are found */
 void set_all(struct category *cat, int val)

Modified: team/russell/menuselect_buildoptions/build_tools/menuselect.h
URL: http://svn.digium.com/view/asterisk/team/russell/menuselect_buildoptions/build_tools/menuselect.h?rev=34490&r1=34489&r2=34490&view=diff
==============================================================================
--- team/russell/menuselect_buildoptions/build_tools/menuselect.h (original)
+++ team/russell/menuselect_buildoptions/build_tools/menuselect.h Fri Jun 16 11:10:33 2006
@@ -45,15 +45,6 @@
 	AST_LIST_ENTRY(conflict) list;
 };
 
-struct buildopt {
-	/*! the name of the build option */
-	const char *name;
-	/*! whether this build option is currently enabled */
-	int enabled:1;
-	/*! for linking */
-	AST_LIST_ENTRY(buildopt) list;
-};
-
 struct member {
 	/*! What will be sent to the makeopts file */
 	const char *name;
@@ -71,8 +62,6 @@
 	AST_LIST_HEAD_NOLOCK(, depend) deps;
 	/*! conflicts of this module */
 	AST_LIST_HEAD_NOLOCK(, conflict) conflicts;
-	/*! a list of build options for this member */
-	AST_LIST_HEAD_NOLOCK(, buildopt) buildopts;
 	/*! for making a list of modules */
 	AST_LIST_ENTRY(member) list;
 };



More information about the asterisk-commits mailing list