From 8ee13bdb05437190739b61d0fef8eaab8ad4ae1c Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Wed, 11 Jul 2012 23:11:08 -0300 Subject: [PATCH] gencat/libs.[ch]: keep back pointer to lib in "struct file" --- gencat/libs.c | 3 ++- gencat/libs.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gencat/libs.c b/gencat/libs.c index a9b212f..00bd21f 100644 --- a/gencat/libs.c +++ b/gencat/libs.c @@ -70,7 +70,8 @@ void add_lib(struct lib *lib, const char *path) file = alloc_type(struct file); file->path = stralloc(path); file->entries = NULL; - file->next = lib->files; + file->lib = lib; + file->next = lib->files; lib->files = file; lib->add_lib(lib, path); diff --git a/gencat/libs.h b/gencat/libs.h index 4fbe93c..d5d089b 100644 --- a/gencat/libs.h +++ b/gencat/libs.h @@ -27,6 +27,7 @@ struct entry { struct file { const char *path; struct entry *entries; + const struct lib *lib; struct file *next; };