#ifndef CURSES_WRAPPER_H #define CURSES_WRAPPER_H /* * These macros need to be wrapped because they expect to manipulate * a typed pointer, and the Foreign Function Interface only supplied * void pointers. */ #define xwattrset(win,at) wattrset((WINDOW *)(win),(at)) #define xtouchwin(win) touchwin((WINDOW *)(win)) /* * These macros need to be wrapped because they don't work like C functions. */ /* This needs gcc's "embedded statements" extension */ #define getx(win) ({ int x, y; getyx((WINDOW *)(win), y, x); x; }) #define gety(win) ({ int x, y; getyx((WINDOW *)(win), y, x); y; }) /* This needs gcc's "embedded statements" extension */ /* Calling them getmaxx and getmaxy interferes with some ncurses macros */ #define getmax_x(win) ({ int x, y; getmaxyx((WINDOW *)(win), y, x); x; }) #define getmax_y(win) ({ int x, y; getmaxyx((WINDOW *)(win), y, x); y; }) #endif