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-07-12 04:54:07 +03:00
|
|
|
#include "libs.h"
|
|
|
|
|
|
|
|
|
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-07-12 04:54:07 +03:00
|
|
|
const struct entry *e; /* NULL if intermediate node */
|
2012-04-17 11:39:32 +03:00
|
|
|
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-07-12 06:29:21 +03:00
|
|
|
void set_libs(const struct lib *lib, struct node *node);
|
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 */
|