mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 21:01:31 +02:00
genkicat/tree.c: add section comments; fix typo in diagnostic
This commit is contained in:
parent
a6039abcb7
commit
4811fb3d3d
@ -23,6 +23,9 @@
|
|||||||
struct node *tree = NULL;
|
struct node *tree = NULL;
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Tree parsing ------------------------------------------------------ */
|
||||||
|
|
||||||
|
|
||||||
void read_tree(FILE *file)
|
void read_tree(FILE *file)
|
||||||
{
|
{
|
||||||
char buf[1100]; /* more than enough */
|
char buf[1100]; /* more than enough */
|
||||||
@ -56,7 +59,7 @@ next:
|
|||||||
if (*p != ' ' && *p != '\t')
|
if (*p != ' ' && *p != '\t')
|
||||||
e = p;
|
e = p;
|
||||||
if (!last && n) {
|
if (!last && n) {
|
||||||
fprintf(stderr, "first entry must not be intended\n");
|
fprintf(stderr, "first entry must not be indented\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
name = malloc(e-s+2);
|
name = malloc(e-s+2);
|
||||||
@ -94,6 +97,9 @@ next:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ----- Description parsing ----------------------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
static struct node *find_comp(struct node *node, const char *name)
|
static struct node *find_comp(struct node *node, const char *name)
|
||||||
{
|
{
|
||||||
struct node *found;
|
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)
|
void set_libs(const struct lib *lib, struct node *node)
|
||||||
{
|
{
|
||||||
while (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)
|
static void dump_tree_level(const struct node *tree, int level)
|
||||||
{
|
{
|
||||||
const struct node *n;
|
const struct node *n;
|
||||||
|
Loading…
Reference in New Issue
Block a user