1466fc833Selan #ifndef _G_curses_h
2466fc833Selan 
3466fc833Selan #include <_G_config.h>
4466fc833Selan 
5466fc833Selan #if _G_HAVE_CURSES
6466fc833Selan 
7466fc833Selan #ifdef __curses_h_recursive
8466fc833Selan #include_next <curses.h>
9466fc833Selan #else
10466fc833Selan #define __curses_h_recursive
11466fc833Selan 
12466fc833Selan extern "C" {
13466fc833Selan #include_next <curses.h>
14466fc833Selan 
15466fc833Selan /* Some systems (SVR4 for example) allow the definition of CHTYPE to set the
16466fc833Selan    type of some arguments to the curses functions.  It can be set to "char"
17466fc833Selan    to save space, or it can be set to something longer to store both a
18466fc833Selan    character and some attributes.  By default they do not define CHTYPE,
19466fc833Selan    and when CHTYPE is not defined, the default type is "unsigned long" instead
20466fc833Selan    of the traditional "char".  However, SVR4 <curses.h> does define
21466fc833Selan    _VR3_COMPAT_CODE, so we can use that to detect when we should use the SVR4
22466fc833Selan    default if CHTYPE is not defined.  For other systems, just default to the
23466fc833Selan    traditional default "char". */
24466fc833Selan 
25466fc833Selan #ifdef CHTYPE
26466fc833Selan       typedef CHTYPE _G_chtype;		/* Use specified type. */
27466fc833Selan #else
28466fc833Selan #ifdef _VR3_COMPAT_CODE
29466fc833Selan       typedef unsigned long _G_chtype;	/* SVR4 default is "unsigned long" */
30466fc833Selan #elif defined(hpux)
31466fc833Selan       typedef unsigned int _G_chtype;
32466fc833Selan #else
33466fc833Selan       typedef char _G_chtype;		/* Traditional default is "char" */
34466fc833Selan #endif
35466fc833Selan #endif
36466fc833Selan 
37466fc833Selan /* Some args are conceptually const, but SVR4 (and others?) get it wrong. */
38466fc833Selan #define _C_const /* const */
39466fc833Selan 
40466fc833Selan WINDOW * (newwin)(int lines, int cols, int sy, int sx);
41466fc833Selan WINDOW * (subwin)(WINDOW *w, int lines, int cols, int sy, int sx);
42466fc833Selan WINDOW * (initscr)();
43fc4b957eSelan int      (box) (WINDOW*, int, int);
44466fc833Selan int      (delwin)(WINDOW*);
45466fc833Selan int      (getcurx)(WINDOW*);
46466fc833Selan int      (getcury)(WINDOW*);
47466fc833Selan int      (mvcur)(int, int, int, int);
48466fc833Selan int      (overlay)(WINDOW*, WINDOW*);
49466fc833Selan int      (overwrite)(WINDOW*, WINDOW*);
50466fc833Selan int      (scroll)(WINDOW*);
51466fc833Selan int      (touchwin)(WINDOW*);
52fc4b957eSelan int      (waddch)(WINDOW*, int);
53466fc833Selan int      (waddstr)(WINDOW*, _C_const char*);
54466fc833Selan int      (wclear)(WINDOW*);
55466fc833Selan int      (wclrtobot)(WINDOW*);
56466fc833Selan int      (wclrtoeol)(WINDOW*);
57466fc833Selan int      (wdelch)(WINDOW*);
58466fc833Selan int      (wdeleteln)(WINDOW*);
59466fc833Selan int      (werase)(WINDOW*);
60466fc833Selan int      (wgetch)(WINDOW*);
61466fc833Selan int      (wgetstr)(WINDOW*, char*);
62fc4b957eSelan int      (winsch)(WINDOW*, int);
63466fc833Selan int      (winsertln)(WINDOW*);
64466fc833Selan int      (wmove)(WINDOW*, int, int);
65466fc833Selan int      (wrefresh)(WINDOW*);
66*6b292a66Sbostic int	 (wstandend)(WINDOW*);
67*6b292a66Sbostic int	 (wstandout)(WINDOW*);
68466fc833Selan 
69466fc833Selan // SVR4 rather inanely bundles the format-string parameter with the '...'.
70466fc833Selan // This breaks VMS, and I don't want to penalize VMS for being right for once!
71466fc833Selan #ifdef _VR3_COMPAT_CODE /* Magic cookie to recognize SVR4 */
72466fc833Selan #define _CURSES_FORMAT_ARG /*const char* fmt, */
73466fc833Selan #else
74466fc833Selan #define _CURSES_FORMAT_ARG const char* fmt,
75466fc833Selan #endif
76466fc833Selan 
77466fc833Selan int      (wprintw)(WINDOW*, _CURSES_FORMAT_ARG ...);
78466fc833Selan int      (mvwprintw)(WINDOW*, int y, int x, _CURSES_FORMAT_ARG ...);
79466fc833Selan int      (wscanw)(WINDOW*, _CURSES_FORMAT_ARG ...);
80466fc833Selan int      (mvwscanw)(WINDOW*, int, int, _CURSES_FORMAT_ARG ...);
81466fc833Selan int      (endwin)();
82466fc833Selan 
83466fc833Selan }
84466fc833Selan #define _G_curses_h
85466fc833Selan #endif
86466fc833Selan #endif /* _G_HAVE_CURSES */
87466fc833Selan #endif /* _G_curses_h */
88