1 #ifndef _G_curses_h 2 3 #include <_G_config.h> 4 5 #if _G_HAVE_CURSES 6 7 #ifdef __curses_h_recursive 8 #include_next <curses.h> 9 #else 10 #define __curses_h_recursive 11 12 extern "C" { 13 #include_next <curses.h> 14 15 /* Some systems (SVR4 for example) allow the definition of CHTYPE to set the 16 type of some arguments to the curses functions. It can be set to "char" 17 to save space, or it can be set to something longer to store both a 18 character and some attributes. By default they do not define CHTYPE, 19 and when CHTYPE is not defined, the default type is "unsigned long" instead 20 of the traditional "char". However, SVR4 <curses.h> does define 21 _VR3_COMPAT_CODE, so we can use that to detect when we should use the SVR4 22 default if CHTYPE is not defined. For other systems, just default to the 23 traditional default "char". */ 24 25 #ifdef CHTYPE 26 typedef CHTYPE _G_chtype; /* Use specified type. */ 27 #else 28 #ifdef _VR3_COMPAT_CODE 29 typedef unsigned long _G_chtype; /* SVR4 default is "unsigned long" */ 30 #elif defined(hpux) 31 typedef unsigned int _G_chtype; 32 #else 33 typedef char _G_chtype; /* Traditional default is "char" */ 34 #endif 35 #endif 36 37 /* Some args are conceptually const, but SVR4 (and others?) get it wrong. */ 38 #define _C_const /* const */ 39 40 WINDOW * (newwin)(int lines, int cols, int sy, int sx); 41 WINDOW * (subwin)(WINDOW *w, int lines, int cols, int sy, int sx); 42 WINDOW * (initscr)(); 43 int (box) (WINDOW*, _G_chtype, _G_chtype); 44 int (delwin)(WINDOW*); 45 int (getcurx)(WINDOW*); 46 int (getcury)(WINDOW*); 47 int (mvcur)(int, int, int, int); 48 int (overlay)(WINDOW*, WINDOW*); 49 int (overwrite)(WINDOW*, WINDOW*); 50 int (scroll)(WINDOW*); 51 int (touchwin)(WINDOW*); 52 int (waddch)(WINDOW*, _G_chtype); 53 int (waddstr)(WINDOW*, _C_const char*); 54 int (wclear)(WINDOW*); 55 int (wclrtobot)(WINDOW*); 56 int (wclrtoeol)(WINDOW*); 57 int (wdelch)(WINDOW*); 58 int (wdeleteln)(WINDOW*); 59 int (werase)(WINDOW*); 60 int (wgetch)(WINDOW*); 61 int (wgetstr)(WINDOW*, char*); 62 int (winsch)(WINDOW*, _G_chtype); 63 int (winsertln)(WINDOW*); 64 int (wmove)(WINDOW*, int, int); 65 int (wrefresh)(WINDOW*); 66 int (wstandend)(WINDOW*); 67 int (wstandout)(WINDOW*); 68 69 // SVR4 rather inanely bundles the format-string parameter with the '...'. 70 // This breaks VMS, and I don't want to penalize VMS for being right for once! 71 #ifdef _VR3_COMPAT_CODE /* Magic cookie to recognize SVR4 */ 72 #define _CURSES_FORMAT_ARG /*const char* fmt, */ 73 #else 74 #define _CURSES_FORMAT_ARG const char* fmt, 75 #endif 76 77 int (wprintw)(WINDOW*, _CURSES_FORMAT_ARG ...); 78 int (mvwprintw)(WINDOW*, int y, int x, _CURSES_FORMAT_ARG ...); 79 int (wscanw)(WINDOW*, _CURSES_FORMAT_ARG ...); 80 int (mvwscanw)(WINDOW*, int, int, _CURSES_FORMAT_ARG ...); 81 int (endwin)(); 82 83 } 84 #define _G_curses_h 85 #endif 86 #endif /* _G_HAVE_CURSES */ 87 #endif /* _G_curses_h */ 88