From f3746821348959e38d6aaca5ed580ba7c0ed2ae6 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 15 Dec 2019 05:22:12 -0500 Subject: [PATCH] panelreel: add tablet curry accessors --- include/notcurses.h | 3 +++ src/lib/panelreel.c | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/include/notcurses.h b/include/notcurses.h index 348782989..08879b2a0 100644 --- a/include/notcurses.h +++ b/include/notcurses.h @@ -1430,6 +1430,9 @@ API struct tablet* panelreel_prev(struct panelreel* pr); // underlying WINDOW. Returns non-zero on failure. API int panelreel_destroy(struct panelreel* pr); +API void* tablet_userptr(struct tablet* t); +API const void* tablet_userptr_const(const struct tablet* t); + #define PREFIXSTRLEN 7 // Does not include a '\0' (xxx.xxU) #define IPREFIXSTRLEN 8 // Does not include a '\0' (xxxx.xxU) #define BPREFIXSTRLEN 9 // Does not include a '\0' (xxxx.xxUi), i == prefix diff --git a/src/lib/panelreel.c b/src/lib/panelreel.c index 2db466c1a..d093c0ab6 100644 --- a/src/lib/panelreel.c +++ b/src/lib/panelreel.c @@ -740,6 +740,14 @@ int panelreel_destroy(panelreel* preel){ return ret; } +void* tablet_userptr(tablet* t){ + return t->curry; +} + +const void* tablet_userptr_const(const tablet* t){ + return t->curry; +} + int panelreel_tabletcount(const panelreel* preel){ return preel->tabletcount; }