aboutsummaryrefslogtreecommitdiff
path: root/scripts/write_config/symlist.c
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2015-07-24 17:19:22 +0200
committerKarel Kočí <cynerd@email.cz>2015-07-24 17:19:22 +0200
commit4df04029a616013e1d795102eab790c628d6dac1 (patch)
treedc6c194934e371cae82d3b511673dec4b1f1f612 /scripts/write_config/symlist.c
parent2088e7c783964176076f83d8df04dac5adc9781d (diff)
downloadlinux-conf-perf-4df04029a616013e1d795102eab790c628d6dac1.tar.gz
linux-conf-perf-4df04029a616013e1d795102eab790c628d6dac1.tar.bz2
linux-conf-perf-4df04029a616013e1d795102eab790c628d6dac1.zip
Rewrite write_config
Write config don't need to load jobfiles any more. We only have to load file passed via argument and save using kconfig code. Configuration checking is disabled. It needs more editing.
Diffstat (limited to 'scripts/write_config/symlist.c')
-rw-r--r--scripts/write_config/symlist.c54
1 files changed, 0 insertions, 54 deletions
diff --git a/scripts/write_config/symlist.c b/scripts/write_config/symlist.c
deleted file mode 100644
index fd0aca8..0000000
--- a/scripts/write_config/symlist.c
+++ /dev/null
@@ -1,54 +0,0 @@
-#include "symlist.h"
-
-#define NONAMEGEN "NONAMEGEN"
-
-struct symlist *symlist_read(FILE * f) {
- struct symlist *ret;
- ret = malloc(sizeof(struct symlist));
- ret->size = 1;
- ret->maxid = 0;
- ret->array = malloc(ret->size * sizeof(struct symlist_el));
-
- unsigned int id;
- char *w;
- size_t w_pos = 0, w_size = 2;
- w = malloc((w_size + 1) * sizeof(char));
-
- int c;
- do {
- c = fgetc(f);
- if (c == '\n') {
- w[w_pos] = '\0';
- if ((size_t) id > ret->size) {
- ret->size *= 2;
- ret->array =
- realloc(ret->array,
- ret->size * sizeof(struct symlist_el));
- }
- if (id > ret->maxid)
- ret->maxid = id;
- ret->array[(size_t) id - 1].id = id;
- if (!strncmp(w, NONAMEGEN, strlen(NONAMEGEN)))
- ret->array[(size_t) id - 1].sym = NULL;
- else
- ret->array[(size_t) id - 1].sym = sym_lookup(w, 0);
- w_pos = 0;
- } else if (c == ':') {
- w[w_pos] = '\0';
- id = atoi(w);
- w_pos = 0;
- } else {
- if (w_pos >= w_size) {
- w_size *= 2;
- w = realloc(w, (w_size + 1) * sizeof(char));
- }
- w[w_pos++] = (char) c;
- }
- } while (c != EOF);
-
- return ret;
-}
-
-struct symbol *symlist_get(struct symlist *sl, unsigned int id) {
- return sl->array[id].sym;
-}