1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-04 23:05:21 +02:00

aeeshow/sch.h, sch-parse.c: record subsheets in parent, for future caching

This commit is contained in:
Werner Almesberger 2016-08-10 16:33:40 -03:00
parent b6975e3998
commit 77c0e07590
2 changed files with 13 additions and 2 deletions

View File

@ -288,6 +288,10 @@ static struct sheet *new_sheet(struct sch_ctx *ctx)
sheet->next_obj = &sheet->objs;
sheet->next = NULL;
sheet->children = NULL;
sheet->next_child = &sheet->children;
sheet->next_sib = NULL;
sheet->parent = ctx->curr_sheet;
ctx->curr_sheet = sheet;
@ -312,7 +316,7 @@ static const struct sheet *recurse_sheet(struct sch_ctx *ctx,
const struct file *related)
{
const char *name = ctx->obj.u.sheet.file;
const struct sheet *sheet;
struct sheet *sheet;
struct file file;
bool res;
@ -326,6 +330,10 @@ static const struct sheet *recurse_sheet(struct sch_ctx *ctx,
return NULL; /* caller MUST clean up */
end_sheet(ctx);
*ctx->curr_sheet->next_child = sheet;
ctx->curr_sheet->next_child = &sheet->next_sib;
sheet->next_sib = NULL;
return sheet;
}
@ -640,4 +648,3 @@ void sch_free(struct sch_ctx *ctx)
ctx->sheets = next;
}
}

View File

@ -98,6 +98,10 @@ struct sheet {
struct sch_obj **next_obj;
struct sheet *parent;
struct sheet *next;
struct sheet *children; /* "child" sub-sheets */
struct sheet **next_child;
struct sheet *next_sib; /* siblings sub-sheets of this sheet */
};
struct sch_ctx {