diff options
author | midipix <writeonce@midipix.org> | 2016-10-25 22:09:44 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-10-25 22:47:15 -0400 |
commit | 7a0b562760299dde7d4a07c430c7c47b67a8e5e7 (patch) | |
tree | cf93216d73781a6751bde117997b081684ea206c /src | |
parent | b03974ba314764900754acca3cc59ccd8fc7ee65 (diff) | |
download | sofort-7a0b562760299dde7d4a07c430c7c47b67a8e5e7.tar.bz2 sofort-7a0b562760299dde7d4a07c430c7c47b67a8e5e7.tar.xz |
driver: added initial error info vector and buffer allocation.
Diffstat (limited to 'src')
-rw-r--r-- | src/driver/sfrt_driver_ctx.c | 7 | ||||
-rw-r--r-- | src/internal/sofort_driver_impl.h | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/driver/sfrt_driver_ctx.c b/src/driver/sfrt_driver_ctx.c index d1d7409..5dc6331 100644 --- a/src/driver/sfrt_driver_ctx.c +++ b/src/driver/sfrt_driver_ctx.c @@ -67,6 +67,7 @@ static struct sfrt_driver_ctx_impl * sfrt_driver_ctx_alloc( size_t size; struct argv_entry * entry; const char ** units; + int elements; size = sizeof(struct sfrt_driver_ctx_alloc); size += (nunits+1)*sizeof(const char *); @@ -81,8 +82,14 @@ static struct sfrt_driver_ctx_impl * sfrt_driver_ctx_alloc( if (!entry->fopt) *units++ = 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.ctx.units = ictx->units; + ictx->ctx.ctx.errv = ictx->ctx.errinfp; return &ictx->ctx; } diff --git a/src/internal/sofort_driver_impl.h b/src/internal/sofort_driver_impl.h index 5ee4952..0808b55 100644 --- a/src/internal/sofort_driver_impl.h +++ b/src/internal/sofort_driver_impl.h @@ -18,8 +18,14 @@ enum app_tags { }; struct sfrt_driver_ctx_impl { - struct sfrt_common_ctx cctx; - struct sfrt_driver_ctx ctx; + struct sfrt_common_ctx cctx; + struct sfrt_driver_ctx ctx; + const struct sfrt_unit_ctx * euctx; + const char * eunit; + struct sfrt_error_info ** errinfp; + struct sfrt_error_info ** erricap; + struct sfrt_error_info * erriptr[64]; + struct sfrt_error_info erribuf[64]; }; struct sfrt_unit_ctx_impl { |