diff options
author | midipix <writeonce@midipix.org> | 2021-10-23 18:19:08 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2024-05-19 03:36:18 +0000 |
commit | 9f55a17009446a7586a3694edb0b54988e201e7f (patch) | |
tree | 6127167b34a675b3482d9c918d213527bb879cb7 /src/driver | |
parent | 3179bb713afab5e24853313e36d5fde9b2295238 (diff) | |
download | tpax-9f55a17009446a7586a3694edb0b54988e201e7f.tar.bz2 tpax-9f55a17009446a7586a3694edb0b54988e201e7f.tar.xz |
item queue: implemented tpax_append_prefix_item().
Diffstat (limited to 'src/driver')
-rw-r--r-- | src/driver/tpax_driver_ctx.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/driver/tpax_driver_ctx.c b/src/driver/tpax_driver_ctx.c index 0a92537..c621bb6 100644 --- a/src/driver/tpax_driver_ctx.c +++ b/src/driver/tpax_driver_ctx.c @@ -276,6 +276,12 @@ static struct tpax_driver_ctx_impl * tpax_driver_ctx_alloc( ictx->ctx.errinfp = &ictx->ctx.erriptr[0]; ictx->ctx.erricap = &ictx->ctx.erriptr[--elements]; + elements = sizeof(ictx->ctx.prefptr) / sizeof(*ictx->ctx.prefptr); + + ictx->ctx.prefixv = &ictx->ctx.prefptr[0]; + ictx->ctx.prefixp = &ictx->ctx.prefptr[0]; + ictx->ctx.prefcap = &ictx->ctx.prefptr[--elements]; + ictx->meta = meta; for (entry=meta->entries,units=ictx->units; entry->fopt || entry->arg; entry++) @@ -561,6 +567,7 @@ static void tpax_free_driver_ctx_impl(struct tpax_driver_ctx_alloc * ictx) { void * next; size_t size; + char ** ppref; for (; ictx->ctx.dirents; ) { next = ictx->ctx.dirents->next; @@ -576,6 +583,12 @@ static void tpax_free_driver_ctx_impl(struct tpax_driver_ctx_alloc * ictx) if (ictx->ctx.dirbuff) munmap(ictx->ctx.dirbuff,TPAX_DIRENT_BUFLEN); + for (ppref=ictx->ctx.prefixv; *ppref; ppref++) + free(*ppref); + + if (ictx->ctx.prefixv != ictx->ctx.prefptr) + free(ictx->ctx.prefixv); + argv_free(ictx->meta); free(ictx); } |