mirror of
git://projects.qi-hardware.com/eda-tools.git
synced 2024-11-26 09:28:24 +02:00
aeeshow/sch.h, sch-parse.c: record subsheets in parent, for future caching
This commit is contained in:
parent
b6975e3998
commit
77c0e07590
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user