aboutsummaryrefslogtreecommitdiff
path: root/scripts/parse_kconfig/symlist.h
blob: 7d24bd10196377f31e8fca127ab8e1ba51ac8553 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <search.h>

#include "cnfbuild.h"
#include "output.h"

#ifndef _SYMLIST_H_
#define _SYMLIST_H_

struct symlist_el {
    char *name;
    bool prompt;
    struct cnfexpr *def;
    size_t def_size;

    struct cnfexpr *dep, *rev_dep;
};

struct symlist {
    struct symlist_el *array;
    size_t size, pos;
    unsigned lastsym;
};

struct symlist *symlist_create();
void symlist_add(struct symlist *sl, char *name);
void symlist_closesym(struct symlist *sl);
unsigned symlist_adddummy(struct symlist *sl);
struct symlist_el *symlist_find(struct symlist *sl, char *name);
size_t symlist_id(struct symlist *sl, char *name);
void symlist_print(struct symlist *sl);
void symlist_free(struct symlist *sl);

#endif /* _SYMLIST_H_ */