summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-24 18:54:25 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:51 -0500
commitc9c5f77d90d27819aa63a49264cdb37364c663a5 (patch)
treeb5ae312d3b35f2c8d519468e61fd1a789848a199
parente8769a78fcf3df8b492adff165e1bcb3014ad95a (diff)
downloadperk-c9c5f77d90d27819aa63a49264cdb37364c663a5.tar.bz2
perk-c9c5f77d90d27819aa63a49264cdb37364c663a5.tar.xz
driver: added initial error info vector and buffer allocation.
-rw-r--r--src/driver/pe_driver_ctx.c7
-rw-r--r--src/internal/perk_driver_impl.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/driver/pe_driver_ctx.c b/src/driver/pe_driver_ctx.c
index 29fd7c8..7ef510e 100644
--- a/src/driver/pe_driver_ctx.c
+++ b/src/driver/pe_driver_ctx.c
@@ -74,6 +74,7 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc(
size_t size;
struct argv_entry * entry;
const char ** units;
+ int elements;
size = sizeof(struct pe_driver_ctx_alloc);
size += (nunits+1)*sizeof(const char *);
@@ -84,6 +85,11 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc(
if (cctx)
memcpy(&ictx->ctx.cctx,cctx,sizeof(*cctx));
+ 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.cctx.symctx = &ictx->ctx.symctx;
ictx->ctx.cctx.outctx = &ictx->ctx.outctx;
@@ -96,6 +102,7 @@ static struct pe_driver_ctx_impl * pe_driver_ctx_alloc(
*units++ = entry->arg;
ictx->ctx.ctx.units = ictx->units;
+ ictx->ctx.ctx.errv = ictx->ctx.errinfp;
return &ictx->ctx;
}
diff --git a/src/internal/perk_driver_impl.h b/src/internal/perk_driver_impl.h
index 7e9e4f7..5063fa1 100644
--- a/src/internal/perk_driver_impl.h
+++ b/src/internal/perk_driver_impl.h
@@ -29,6 +29,10 @@ struct pe_driver_ctx_impl {
struct pe_io_ctx ioctx;
struct pe_common_ctx cctx;
struct pe_driver_ctx ctx;
+ struct pe_error_info ** errinfp;
+ struct pe_error_info ** erricap;
+ struct pe_error_info * erriptr[64];
+ struct pe_error_info erribuf[64];
};
struct pe_unit_ctx_impl {