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

gencat/: remove awkward callback from set_libs to lookup_sym

This commit is contained in:
Werner Almesberger 2012-07-11 22:14:26 -03:00
parent b3113fca04
commit b34b0917dd
3 changed files with 6 additions and 10 deletions

View File

@ -93,7 +93,7 @@ int main(int argc, char **argv)
}
read_tree(file);
fclose(file);
set_libs(tree, lookup_sym);
set_libs(tree);
for (arg = argv+optind+1; *arg; arg++) {
file = fopen(*arg, "r");

View File

@ -203,21 +203,19 @@ void read_desc(FILE *file)
}
void set_libs(struct node *node,
const char *(*find_lib)(const char *sym, const struct name **names,
int *units))
void set_libs(struct node *node)
{
while (node) {
if (!node->child) {
node->lib =
find_lib(node->name, &node->names, &node->units);
node->lib = lookup_sym(node->name,
&node->names, &node->units);
if (!node->lib) {
fprintf(stderr, "symbol %s not found\n",
node->name);
exit(1);
}
}
set_libs(node->child, find_lib);
set_libs(node->child);
node = node->next;
}
}

View File

@ -39,9 +39,7 @@ extern struct node *tree;
void read_tree(FILE *file);
void read_desc(FILE *file);
void set_libs(struct node *node,
const char *(*find_lib)(const char *sym, const struct name **names,
int *units));
void set_libs(struct node *node);
void dump_tree(void);
void dump_comp(void);