1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-12-23 00:18:59 +02:00

genkicat/tree.c: add section comments; fix typo in diagnostic

This commit is contained in:
Werner Almesberger 2012-07-14 21:07:44 -03:00
parent a6039abcb7
commit 4811fb3d3d

View File

@ -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;