diff options
author | midipix <writeonce@midipix.org> | 2016-07-07 01:44:58 -0400 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-07-21 03:47:25 -0400 |
commit | 9b8e640378356775d25e39259c8feda7132162b7 (patch) | |
tree | 26ba131bcd32981f98018aa9b3f394f96421268f /src/internal | |
parent | d36400785af317de621e522772914446dba3fb2a (diff) | |
download | ptycon-9b8e640378356775d25e39259c8feda7132162b7.tar.bz2 ptycon-9b8e640378356775d25e39259c8feda7132162b7.tar.xz |
ptyc_driver_ctx_impl(): implementation and integration (static, inline).
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 |