From 6a35abb6ca683d35d5eefd55081c29af4893fec6 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 18 Mar 2020 16:52:33 +0100 Subject: shm: new functions: shm_cookie_*() These functions return a SHM cookie given a terminal instance. --- shm.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'shm.h') diff --git a/shm.h b/shm.h index 18da7a1f..eb9987ed 100644 --- a/shm.h +++ b/shm.h @@ -28,3 +28,8 @@ struct buffer *shm_get_buffer( void shm_fini(void); void shm_purge(struct wl_shm *shm, unsigned long cookie); + +struct terminal; +static inline unsigned long shm_cookie_grid(const struct terminal *term) { return (unsigned long)((uintptr_t)term + 0); } +static inline unsigned long shm_cookie_search(const struct terminal *term) { return (unsigned long)((uintptr_t)term + 1); } +static inline unsigned long shm_cookie_csd(const struct terminal *term, int n) { return (unsigned long)((uintptr_t)term + 2 + (n)); } -- cgit v1.3