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