mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-12-23 05:54:37 +02:00
gencat/: make library selection variable
For future addition of other types of libraries.
This commit is contained in:
parent
9c0a43e29b
commit
9cf8adf878
@ -43,6 +43,7 @@ static void usage(const char *name)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct lib *lib = &comp_lib;
|
||||
FILE *file;
|
||||
int c;
|
||||
int opt_dump_tree = 0, opt_dump_comp = 0, postscript = 0, portrait = 0;
|
||||
@ -57,10 +58,10 @@ int main(int argc, char **argv)
|
||||
opt_dump_comp = 1;
|
||||
break;
|
||||
case 'L':
|
||||
add_libdir(&comp_lib, optarg);
|
||||
add_libdir(lib, optarg);
|
||||
break;
|
||||
case 'l':
|
||||
add_lib(&comp_lib, optarg);
|
||||
add_lib(lib, optarg);
|
||||
break;
|
||||
case 'P':
|
||||
postscript = 1;
|
||||
@ -93,7 +94,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
read_tree(file);
|
||||
fclose(file);
|
||||
set_libs(tree);
|
||||
set_libs(lib, tree);
|
||||
|
||||
for (arg = argv+optind+1; *arg; arg++) {
|
||||
file = fopen(*arg, "r");
|
||||
|
@ -204,18 +204,18 @@ void read_desc(FILE *file)
|
||||
}
|
||||
|
||||
|
||||
void set_libs(struct node *node)
|
||||
void set_libs(const struct lib *lib, struct node *node)
|
||||
{
|
||||
while (node) {
|
||||
if (!node->child) {
|
||||
node->e = lookup_sym(&comp_lib, node->name);
|
||||
node->e = lookup_sym(lib, node->name);
|
||||
if (!node->e) {
|
||||
fprintf(stderr, "symbol %s not found\n",
|
||||
node->name);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
set_libs(node->child);
|
||||
set_libs(lib, node->child);
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ extern struct node *tree;
|
||||
|
||||
void read_tree(FILE *file);
|
||||
void read_desc(FILE *file);
|
||||
void set_libs(struct node *node);
|
||||
void set_libs(const struct lib *lib, struct node *node);
|
||||
void dump_tree(void);
|
||||
void dump_comp(void);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user