summaryrefslogtreecommitdiff
path: root/kicad/delta.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-01 13:41:34 -0300
committerWerner Almesberger <werner@almesberger.net>2016-09-01 13:47:29 -0300
commit9ee3d030c7695af0a7752a2645a924ebdd5d5761 (patch)
treeae0665c67baf89d9372861bbdb91565152238edd /kicad/delta.c
parentd21c4c84e7977e658757b7d82209ec4f87b3285c (diff)
downloadeeshow-9ee3d030c7695af0a7752a2645a924ebdd5d5761.tar.gz
eeshow-9ee3d030c7695af0a7752a2645a924ebdd5d5761.tar.bz2
eeshow-9ee3d030c7695af0a7752a2645a924ebdd5d5761.zip
kicad/sch.h (struct sheet): keep track of file name and schematics path
Diffstat (limited to 'kicad/delta.c')
-rw-r--r--kicad/delta.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kicad/delta.c b/kicad/delta.c
index c45212f..35ed774 100644
--- a/kicad/delta.c
+++ b/kicad/delta.c
@@ -438,6 +438,8 @@ static void free_obj(struct sch_obj *obj)
static void init_res(struct sheet *res)
{
res->title = NULL;
+ res->file = NULL;
+ res->path = NULL;
res->objs = NULL;
res->next_obj = &res->objs;
res->next = NULL;
@@ -462,6 +464,20 @@ void delta(const struct sheet *a, const struct sheet *b,
res_b->title = b->title;
}
+ if (a->file && b->file && !strcmp(a->file, b->file)) {
+ res_ab->file = a->file;
+ } else {
+ res_a->file = a->file;
+ res_b->file = b->file;
+ }
+
+ if (a->path && b->path && !strcmp(a->path, b->path)) {
+ res_ab->path = a->path;
+ } else {
+ res_a->path = a->path;
+ res_b->path = b->path;
+ }
+
objs_a = objs_clone(a->objs);
objs_b = objs_clone(b->objs);