summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-10-26 16:27:18 -0400
committermidipix <writeonce@midipix.org>2016-10-26 22:10:18 -0400
commit5334b12f17944df8a163d338479fe2090f97ce6b (patch)
tree4e182f952bee6ac18a89ac31306c05634f50c402
parent615ccce232a31e0323b5079f5d67ccffd2904230 (diff)
downloadapimagic-5334b12f17944df8a163d338479fe2090f97ce6b.tar.bz2
apimagic-5334b12f17944df8a163d338479fe2090f97ce6b.tar.xz
driver: added initial error info vector and buffer allocation.
-rw-r--r--src/driver/amgc_driver_ctx.c7
-rw-r--r--src/internal/apimagic_driver_impl.h7
2 files changed, 14 insertions, 0 deletions
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;
}
diff --git a/src/internal/apimagic_driver_impl.h b/src/internal/apimagic_driver_impl.h
index c2d7dee..2e42ce4 100644
--- a/src/internal/apimagic_driver_impl.h
+++ b/src/internal/apimagic_driver_impl.h
@@ -31,6 +31,13 @@ struct amgc_driver_ctx_impl {
struct amgc_action * actions;
struct compilation_env_t ccenv;
int fdtmpin;
+ const struct amgc_unit_ctx * euctx;
+ const char * eunit;
+ struct amgc_error_info ** errinfp;
+ struct amgc_error_info ** erricap;
+ struct amgc_error_info * erriptr[64];
+ struct amgc_error_info erribuf[64];
+
};
struct amgc_unit_ctx_impl {