summaryrefslogtreecommitdiff
path: root/kicad
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-09-19 04:45:26 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-09-19 04:49:02 (GMT)
commit18915f40fd9ae32472981b7584a29a4ba3a62931 (patch)
treea013d36618e8915360683e9936f1bb3d27235601 /kicad
parent75a30655bf3a87f62d55e8746e3253005c5cec77 (diff)
downloadeeshow-18915f40fd9ae32472981b7584a29a4ba3a62931.zip
eeshow-18915f40fd9ae32472981b7584a29a4ba3a62931.tar.gz
eeshow-18915f40fd9ae32472981b7584a29a4ba3a62931.tar.bz2
kicad/sch-parse.c: record sheet (paper) size
Diffstat (limited to 'kicad')
-rw-r--r--kicad/sch-parse.c5
-rw-r--r--kicad/sch.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/kicad/sch-parse.c b/kicad/sch-parse.c
index d2cc72c..2707eda 100644
--- a/kicad/sch-parse.c
+++ b/kicad/sch-parse.c
@@ -365,6 +365,7 @@ static struct sheet *new_sheet(struct sch_ctx *ctx)
sheet->next_obj = &sheet->objs;
sheet->next = NULL;
+ sheet->size = NULL;
sheet->w = sheet->h = 0;
sheet->has_children = 0;
@@ -573,7 +574,8 @@ static bool parse_line(const struct file *file, void *user, const char *line)
}
break;
case sch_descr:
- if (sscanf(line, "$Descr %*s %d %d",
+ if (sscanf(line, "$Descr %ms %d %d",
+ &ctx->curr_sheet->size,
&ctx->curr_sheet->w, &ctx->curr_sheet->h) == 2)
return 1;
if (sscanf(line, "Title \"%m[^\"]\"", &s) == 1) {
@@ -743,6 +745,7 @@ static void free_sheet(struct sheet *sch)
free((char *) sch->title);
free((char *) sch->file);
free((char *) sch->path);
+ free((char *) sch->size);
free(sch->oid);
for (obj = sch->objs; obj; obj = next) {
next = obj->next;
diff --git a/kicad/sch.h b/kicad/sch.h
index 0a49c71..97e730e 100644
--- a/kicad/sch.h
+++ b/kicad/sch.h
@@ -109,6 +109,7 @@ struct sheet {
struct sch_obj **next_obj;
struct sheet *next;
+ const char *size; /* paper size, from $Descr */
int w, h;
bool has_children; /* aka sub-sheets */