diff options
Diffstat (limited to 'src/internal')
-rw-r--r-- | src/internal/ptycon_driver_impl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/internal/ptycon_driver_impl.h b/src/internal/ptycon_driver_impl.h index a51c5a1..c46e146 100644 --- a/src/internal/ptycon_driver_impl.h +++ b/src/internal/ptycon_driver_impl.h @@ -31,4 +31,16 @@ struct ptyc_driver_ctx_impl { struct ptyc_driver_ctx ctx; }; +static inline struct ptyc_driver_ctx_impl * ptyc_get_driver_ictx(struct ptyc_driver_ctx * dctx) +{ + uintptr_t addr; + + if (dctx) { + addr = (uintptr_t)dctx - offsetof(struct ptyc_driver_ctx_impl,ctx); + return (struct ptyc_driver_ctx_impl *)addr; + } + + return 0; +} + #endif |