2012-03-31 00:53:51 +03:00
|
|
|
/*
|
2012-06-26 03:12:26 +03:00
|
|
|
* tree.h - Component hierarchy
|
2012-03-31 00:53:51 +03:00
|
|
|
*
|
|
|
|
* Copyright 2012 by Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
2012-06-26 03:12:26 +03:00
|
|
|
#ifndef TREE_H
|
|
|
|
#define TREE_H
|
2012-03-31 00:53:51 +03:00
|
|
|
|
2012-06-26 03:14:48 +03:00
|
|
|
#include "comp.h"
|
2012-04-17 14:45:20 +03:00
|
|
|
|
|
|
|
|
2012-04-17 11:39:32 +03:00
|
|
|
struct line {
|
|
|
|
char *s;
|
|
|
|
struct line *next;
|
|
|
|
};
|
|
|
|
|
2012-03-31 00:53:51 +03:00
|
|
|
struct node {
|
|
|
|
const char *name;
|
2012-04-13 00:07:59 +03:00
|
|
|
const char *lib; /* NULL if intermediate node */
|
2012-04-17 14:45:20 +03:00
|
|
|
const struct name *names;
|
|
|
|
/* canonical name and aliases of component */
|
2012-04-17 11:39:32 +03:00
|
|
|
int units; /* number of units; undefined if intermediate */
|
|
|
|
struct line *comment; /* NULL if intermediate node */
|
2012-03-31 00:53:51 +03:00
|
|
|
int indent; /* level of indentation (characters) */
|
|
|
|
struct node *parent;
|
|
|
|
struct node *child;
|
|
|
|
struct node *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
extern struct node *tree;
|
|
|
|
|
|
|
|
|
|
|
|
void read_tree(FILE *file);
|
2012-04-17 11:39:32 +03:00
|
|
|
void read_desc(FILE *file);
|
2012-03-31 00:53:51 +03:00
|
|
|
void set_libs(struct node *node,
|
2012-04-17 14:45:20 +03:00
|
|
|
const char *(*find_lib)(const char *sym, const struct name **names,
|
2012-04-12 05:10:42 +03:00
|
|
|
int *units));
|
2012-03-31 00:53:51 +03:00
|
|
|
void dump_tree(void);
|
2012-04-18 04:18:12 +03:00
|
|
|
void dump_comp(void);
|
2012-03-31 00:53:51 +03:00
|
|
|
|
2012-06-26 03:12:26 +03:00
|
|
|
#endif /* !TREE_H */
|