aboutsummaryrefslogtreecommitdiff
path: root/scripts/permute_conf/menudata.c
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-07-22 11:47:51 +0200
committerKarel Kočí <cynerd@email.cz>2015-07-22 11:47:51 +0200
commitad1a1dd1f2fb8be0c37a31d0c9a53932ec824812 (patch)
treef180482e1c05f15958063057bcec71efcc0633c9 /scripts/permute_conf/menudata.c
parente291e4e7c831f34238bbcda1c39659826f04191c (diff)
downloadlinux-conf-perf-ad1a1dd1f2fb8be0c37a31d0c9a53932ec824812.tar.gz
linux-conf-perf-ad1a1dd1f2fb8be0c37a31d0c9a53932ec824812.tar.bz2
linux-conf-perf-ad1a1dd1f2fb8be0c37a31d0c9a53932ec824812.zip
Remove permute_conf
permute_conf was only temporally program for generating dot_config file. Its main function now has program allconfig. This program has also some text interface, but it wasn't optimal and in the end wasn't used at all.
Diffstat (limited to 'scripts/permute_conf/menudata.c')
-rw-r--r--scripts/permute_conf/menudata.c58
1 files changed, 0 insertions, 58 deletions
diff --git a/scripts/permute_conf/menudata.c b/scripts/permute_conf/menudata.c
deleted file mode 100644
index 88910ab..0000000
--- a/scripts/permute_conf/menudata.c
+++ /dev/null
@@ -1,58 +0,0 @@
-#include "menudata.h"
-
-struct menudata *menudata_new(void) {
- struct menudata *rtn;
- rtn = calloc(1, sizeof(struct menudata));
- return rtn;
-}
-
-void menudata_set_permute(struct menu *m, bool perm) {
- ((struct menudata *) m->data)->permute = perm;
- struct menu *prnt;
- for (prnt = m; prnt != NULL; prnt = prnt->parent) {
- menudata_cal(prnt);
- }
-}
-
-void menudata_set_all_permute(struct menu *m, bool perm) {
- menudata_set_permute(m, perm);
-
- struct menu **stack;
- size_t stack_size = 2, stack_pos = 0;
- stack = malloc(stack_size * sizeof(struct menu *));
-
- m = m->list;
- while (m != NULL) {
- if (m->data == NULL)
- m->data = menudata_new();
- ((struct menudata *) m->data)->permute = perm;
- ((struct menudata *) m->data)->subpermute = perm;
-
- if (m->list != NULL) {
- if (stack_pos >= stack_size) {
- stack_size *= 2;
- stack = realloc(stack, stack_size * sizeof(struct menu *));
- }
- stack[stack_pos++] = m->list;
- }
-
- m = m->next;
- if (m == NULL && stack_pos > 0)
- m = stack[--stack_pos];
- }
-
-}
-
-void menudata_cal(struct menu *m) {
- bool subperm = false;
- struct menu *w;
- for (w = m->list; w != NULL; w = w->next) {
- if (w->data != NULL && (((struct menudata *) w->data)->permute
- || ((struct menudata *) w->data)->
- subpermute)) {
- if (m->data == NULL)
- m->data = menudata_new();
- ((struct menudata *) m->data)->subpermute = subperm;
- }
- }
-}