diff --git a/genkicat/tree.c b/genkicat/tree.c index 200a044..6b5da60 100644 --- a/genkicat/tree.c +++ b/genkicat/tree.c @@ -23,6 +23,9 @@ struct node *tree = NULL; +/* ----- Tree parsing ------------------------------------------------------ */ + + void read_tree(FILE *file) { char buf[1100]; /* more than enough */ @@ -56,7 +59,7 @@ next: if (*p != ' ' && *p != '\t') e = p; if (!last && n) { - fprintf(stderr, "first entry must not be intended\n"); + fprintf(stderr, "first entry must not be indented\n"); exit(1); } name = malloc(e-s+2); @@ -94,6 +97,9 @@ next: } +/* ----- Description parsing ----------------------------------------------- */ + + static struct node *find_comp(struct node *node, const char *name) { struct node *found; @@ -206,6 +212,9 @@ void read_desc(FILE *file) } +/* ----- Associate library entries with tree nodes ------------------------- */ + + void set_libs(const struct lib *lib, struct node *node) { while (node) { @@ -223,6 +232,9 @@ void set_libs(const struct lib *lib, struct node *node) } +/* ----- Debug dumps ------------------------------------------------------- */ + + static void dump_tree_level(const struct node *tree, int level) { const struct node *n;