summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-02 16:38:21 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-02 16:38:21 -0300
commit8473f728db4bb377d76094821de67ebaec7f254d (patch)
treeb7115ffb907e5dac98f51a751923d7eff2f7c65a /diff.c
parent29fe8c46c08fcaae008181d0dc8383f28782de39 (diff)
downloadeeshow-8473f728db4bb377d76094821de67ebaec7f254d.tar.gz
eeshow-8473f728db4bb377d76094821de67ebaec7f254d.tar.bz2
eeshow-8473f728db4bb377d76094821de67ebaec7f254d.zip
eeshow/: make libraries "related" to the [main] schematics sheet
That way, we can use relative paths on the command line, ideally just ./eeshow foo.lib bar.lib com/plex/path/foo.sch
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/diff.c b/diff.c
index a825c82..f6e1a23 100644
--- a/diff.c
+++ b/diff.c
@@ -20,6 +20,7 @@
#include "util.h"
#include "main.h"
#include "cro.h"
+#include "file.h"
#include "sch.h"
#include "lib.h"
#include "diff.h"
@@ -111,6 +112,7 @@ static void *diff_init(int argc, char *const *argv)
char c;
int arg;
struct sch_ctx new_sch;
+ struct file sch_file;
struct lib new_lib;
diff = alloc_type(struct diff);
@@ -136,9 +138,11 @@ static void *diff_init(int argc, char *const *argv)
if (argc - optind < 1)
usage(*argv);
+ file_open(&sch_file, argv[argc - 1], NULL);
for (arg = optind; arg != argc - 1; arg++)
- lib_parse(&new_lib, argv[arg]);
- sch_parse(&new_sch, argv[argc - 1], &new_lib);
+ lib_parse(&new_lib, argv[arg], &sch_file);
+ sch_parse(&new_sch, &sch_file, &new_lib);
+ file_close(&sch_file);
optind = 0;
gfx_init(&cro_img_ops, argc, argv);