diff options
author | midipix <writeonce@midipix.org> | 2015-12-06 08:39:15 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-11-10 23:35:31 -0500 |
commit | 1d9a6e49523684f26fdfaa7192914000496552dc (patch) | |
tree | caf10ece35a943305bd962f1772c19a80f586cf2 | |
parent | 76aabf2c240c67ede7734f544be94f64da2c55c5 (diff) | |
download | perk-1d9a6e49523684f26fdfaa7192914000496552dc.tar.bz2 perk-1d9a6e49523684f26fdfaa7192914000496552dc.tar.xz |
API redesign 7/10: place secondary context structures in struct pe_driver_ctx_impl.
-rw-r--r-- | src/driver/pe_driver_ctx.c | 20 | ||||
-rw-r--r-- | src/internal/perk_impl.h | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c index e3e9cdb..aacc2e6 100644 --- a/src/driver/pe_driver_ctx.c +++ b/src/driver/pe_driver_ctx.c @@ -45,10 +45,6 @@ static const struct argv_option options[] = { struct pe_driver_ctx_alloc { struct argv_meta * meta; - struct pe_symbol_ctx symctx; - struct pe_output_ctx outctx; - struct pe_linker_ctx lnkctx; - struct pe_server_ctx srvctx; struct pe_driver_ctx_impl ctx; uint64_t guard; const char * units[]; @@ -101,10 +97,10 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc(struct argv_meta * meta, return 0; ictx->meta = meta; - ictx->ctx.cctx.symctx = &ictx->symctx; - ictx->ctx.cctx.outctx = &ictx->outctx; - ictx->ctx.cctx.lnkctx = &ictx->lnkctx; - ictx->ctx.cctx.srvctx = &ictx->srvctx; + ictx->ctx.cctx.symctx = &ictx->ctx.symctx; + ictx->ctx.cctx.outctx = &ictx->ctx.outctx; + ictx->ctx.cctx.lnkctx = &ictx->ctx.lnkctx; + ictx->ctx.cctx.srvctx = &ictx->ctx.srvctx; ictx->ctx.cctx.ioctx = &ictx->ctx.ioctx; for (entry=meta->entries,units=ictx->units; entry->fopt || entry->arg; entry++) @@ -232,11 +228,11 @@ static void pe_driver_close_fds(struct pe_common_ctx * cctx) static void pe_free_driver_ctx_impl(struct pe_driver_ctx_alloc * ictx) { - if (ictx->symctx.append) - free(ictx->symctx.append); + if (ictx->ctx.symctx.append) + free(ictx->ctx.symctx.append); - if (ictx->symctx.exclude) - free(ictx->symctx.exclude); + if (ictx->ctx.symctx.exclude) + free(ictx->ctx.symctx.exclude); pe_driver_close_fds(&ictx->ctx.cctx); argv_free(ictx->meta); diff --git a/src/internal/perk_impl.h b/src/internal/perk_impl.h index 7cfc590..8d8ecc3 100644 --- a/src/internal/perk_impl.h +++ b/src/internal/perk_impl.h @@ -9,6 +9,10 @@ #include <perk/perk_meta.h> struct pe_driver_ctx_impl { + struct pe_symbol_ctx symctx; + struct pe_output_ctx outctx; + struct pe_linker_ctx lnkctx; + struct pe_server_ctx srvctx; struct pe_io_ctx ioctx; struct pe_common_ctx cctx; struct pe_driver_ctx ctx; |