summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-09-02 14:23:23 -0400
committermidipix <writeonce@midipix.org>2016-09-03 14:36:44 -0400
commit41c05b4fa291ab46245cc1b7e64e55f2a75a2190 (patch)
tree8513405ae602ebd6029542378a47da69dacb85af
parent6dc88795d8414d03ce8cd9c99a2107841c56d484 (diff)
downloadslibtool-41c05b4fa291ab46245cc1b7e64e55f2a75a2190.tar.bz2
slibtool-41c05b4fa291ab46245cc1b7e64e55f2a75a2190.tar.xz
driver: added initial error info vector and buffer allocation.
-rw-r--r--src/driver/slbt_driver_ctx.c7
-rw-r--r--src/internal/slibtool_driver_impl.h4
2 files changed, 11 insertions, 0 deletions
diff --git a/src/driver/slbt_driver_ctx.c b/src/driver/slbt_driver_ctx.c
index baf08fb..3ca33c1 100644
--- a/src/driver/slbt_driver_ctx.c
+++ b/src/driver/slbt_driver_ctx.c
@@ -152,6 +152,7 @@ static struct slbt_driver_ctx_impl * slbt_driver_ctx_alloc(
size_t size;
struct argv_entry * entry;
const char ** units;
+ int elements;
size = sizeof(struct slbt_driver_ctx_alloc);
size += (nunits+1)*sizeof(const char *);
@@ -166,8 +167,14 @@ static struct slbt_driver_ctx_impl * slbt_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/slibtool_driver_impl.h b/src/internal/slibtool_driver_impl.h
index 19549ad..132e0e5 100644
--- a/src/internal/slibtool_driver_impl.h
+++ b/src/internal/slibtool_driver_impl.h
@@ -75,6 +75,10 @@ struct slbt_driver_ctx_impl {
char * libname;
char ** targv;
char ** cargv;
+ struct slbt_error_info**errinfp;
+ struct slbt_error_info**erricap;
+ struct slbt_error_info *erriptr[64];
+ struct slbt_error_info erribuf[64];
};
struct slbt_unit_ctx_impl {