/* * genex.c - Generate expanded component view * * 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. */ #include #include #include #include "comp.h" #include "libs.h" #include "pdf.h" static void usage(const char *name) { fprintf(stderr, "usage: %s [-L libdir ...] [-l lib ...] hierarchy\n", name); exit(1); } int main(int argc, char **argv) { FILE *file; int c; while ((c = getopt(argc, argv, "L:l:")) != EOF) switch (c) { case 'L': add_libdir(optarg); break; case 'l': add_lib(optarg); break; default: usage(*argv); } if (argc-optind != 1) usage(*argv); file = fopen(argv[optind], "r"); if (!file) { perror(argv[optind]); exit(1); } read_tree(file); set_libs(tree, lookup_sym); fclose(file); // dump_tree(); make_pdf(); return 0; }