1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-26 21:36:16 +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); read_tree(file);
fclose(file); fclose(file);
set_libs(tree, lookup_sym); set_libs(tree);
for (arg = argv+optind+1; *arg; arg++) { for (arg = argv+optind+1; *arg; arg++) {
file = fopen(*arg, "r"); file = fopen(*arg, "r");

View File

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

View File

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