From 5334b12f17944df8a163d338479fe2090f97ce6b Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 26 Oct 2016 16:27:18 -0400 Subject: driver: added initial error info vector and buffer allocation. --- src/driver/amgc_driver_ctx.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/driver') diff --git a/src/driver/amgc_driver_ctx.c b/src/driver/amgc_driver_ctx.c index 66c9ba9..728ecf5 100644 --- a/src/driver/amgc_driver_ctx.c +++ b/src/driver/amgc_driver_ctx.c @@ -87,6 +87,7 @@ static struct amgc_driver_ctx_impl * amgc_driver_ctx_alloc( size_t size; struct argv_entry * entry; const char ** aunits; + int elements; size = sizeof(struct amgc_driver_ctx_alloc); size += (nunits+1)*sizeof(const char *); @@ -106,11 +107,17 @@ static struct amgc_driver_ctx_impl * amgc_driver_ctx_alloc( if (!entry->fopt) *aunits++ = entry->arg; + elements = sizeof(ictx->ctx.erribuf) / sizeof(*ictx->ctx.erribuf); + + ictx->ctx.errinfp = &ictx->ctx.erriptr[0]; + ictx->ctx.erricap = &ictx->ctx.erriptr[--elements]; + ictx->meta = meta; ictx->ctx.fdtmpin = -1; ictx->actions = actions; ictx->ctx.actions = actions; ictx->ctx.ctx.units = ictx->units; + ictx->ctx.ctx.errv = ictx->ctx.errinfp; return &ictx->ctx; } -- cgit v1.2.3