summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-10-28 11:38:25 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-10-28 11:38:25 (GMT)
commit4dffb6a41499a68fe99f080223f8f42a2794a88e (patch)
treed20a18a4d0116fef52573984222c89b4001e9467 /kicad
parent346956c202739c66b23a0ed9d648b1ffbc972705 (diff)
downloadeeshow-4dffb6a41499a68fe99f080223f8f42a2794a88e.zip
eeshow-4dffb6a41499a68fe99f080223f8f42a2794a88e.tar.gz
eeshow-4dffb6a41499a68fe99f080223f8f42a2794a88e.tar.bz2
kicad/sch.h, sch-parse.c: keep the file's mtime also in "struct sheet"
Diffstat (limited to 'kicad')
-rw-r--r--kicad/sch-parse.c3
-rw-r--r--kicad/sch.h2
2 files changed, 5 insertions, 0 deletions
diff --git a/kicad/sch-parse.c b/kicad/sch-parse.c
index e2de34f..5caed69 100644
--- a/kicad/sch-parse.c
+++ b/kicad/sch-parse.c
@@ -372,6 +372,7 @@ static struct sheet *new_sheet(struct sch_ctx *ctx)
sheet = alloc_type(struct sheet);
sheet->title = NULL;
sheet->file = NULL;
+ sheet->mtime = 0;
sheet->path = NULL;
sheet->objs = NULL;
sheet->next_obj = &sheet->objs;
@@ -415,6 +416,7 @@ static struct sheet *recurse_sheet(struct sch_ctx *ctx,
sheet = new_sheet(ctx);
// should get what file_open really uses @@@
sheet->file = stralloc(sanitize_file_name(file.name));
+ sheet->mtime = file.mtime;
alloc_printf(&tmp, "%s%s/", parent->path,
ctx->obj.u.sheet.name ? ctx->obj.u.sheet.name : "");
sheet->path = tmp;
@@ -730,6 +732,7 @@ bool sch_parse(struct sch_ctx *ctx, struct file *file, const struct lib *lib,
const struct sch_ctx *prev)
{
ctx->curr_sheet->file = stralloc(sanitize_file_name(file->name));
+ ctx->curr_sheet->mtime = file->mtime;
ctx->curr_sheet->path = stralloc("/");
ctx->lib = lib;
ctx->prev = prev;
diff --git a/kicad/sch.h b/kicad/sch.h
index 92e6de9..c22d907 100644
--- a/kicad/sch.h
+++ b/kicad/sch.h
@@ -111,6 +111,8 @@ struct sheet {
struct sch_obj **next_obj;
struct sheet *next;
+ time_t mtime; /* file / commit time */
+
/* header items */
const char *size; /* paper size, from $Descr */
int w, h;