diff options
author | midipix <writeonce@midipix.org> | 2018-05-20 21:59:12 +0000 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2018-05-21 02:23:31 -0400 |
commit | da20d860b28d7b3c1085964b784f58772c7ba263 (patch) | |
tree | b16570e9188530ddd04537e0486542a64dc8102e /src/internal/ntux_driver_impl.h | |
parent | c59ae6812f148839a5d07e1dd266c12fa7f3b2f5 (diff) | |
download | ntux-da20d860b28d7b3c1085964b784f58772c7ba263.tar.bz2 ntux-da20d860b28d7b3c1085964b784f58772c7ba263.tar.xz |
driver & output: error info vector, error strings: initial implementation.
Diffstat (limited to 'src/internal/ntux_driver_impl.h')
-rw-r--r-- | src/internal/ntux_driver_impl.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/internal/ntux_driver_impl.h b/src/internal/ntux_driver_impl.h index 6c635de..38d10cc 100644 --- a/src/internal/ntux_driver_impl.h +++ b/src/internal/ntux_driver_impl.h @@ -26,11 +26,39 @@ struct ntux_driver_ctx_impl { struct ntux_common_ctx cctx; struct ntux_driver_ctx ctx; struct __psx_context xctx; + const struct ntux_unit_ctx *euctx; const char * eunit; struct ntux_error_info ** errinfp; struct ntux_error_info ** erricap; struct ntux_error_info * erriptr[64]; struct ntux_error_info erribuf[64]; + char errsbuf[28]; + int errcode; }; + +static inline struct ntux_driver_ctx_impl * ntux_get_driver_ictx(const struct ntux_driver_ctx * dctx) +{ + uintptr_t addr; + + if (dctx) { + addr = (uintptr_t)dctx - offsetof(struct ntux_driver_ctx_impl,ctx); + return (struct ntux_driver_ctx_impl *)addr; + } + + return 0; +} + +static inline void ntux_driver_set_ectx( + const struct ntux_driver_ctx * dctx, + const struct ntux_unit_ctx * uctx, + const char * unit) +{ + struct ntux_driver_ctx_impl * ictx; + + ictx = ntux_get_driver_ictx(dctx); + ictx->euctx = uctx; + ictx->eunit = unit; +} + #endif |