1 /* Public Domain Curses */
5 RCSID("$Id: termattr.c,v 1.54 2008/07/13 16:08:18 wmcbrine Exp $")
7 /*man-start**************************************************************
18 chtype termattrs(void);
19 attr_t term_attrs(void);
22 int erasewchar(wchar_t *ch);
23 int killwchar(wchar_t *ch);
28 baudrate() is supposed to return the output speed of the
29 terminal. In PDCurses, it simply returns INT_MAX.
31 has_ic and has_il() return TRUE. These functions have meaning in
32 some other implementations of curses.
34 erasechar() and killchar() return ^H and ^U, respectively -- the
35 ERASE and KILL characters. In other curses implementations,
36 these may vary by terminal type. erasewchar() and killwchar()
37 are the wide-character versions; they take a pointer to a
38 location in which to store the character, and return OK or ERR.
40 longname() returns a pointer to a static area containing a
41 verbose description of the current terminal. The maximum length
42 of the string is 128 characters. It is defined only after the
43 call to initscr() or newterm().
45 termname() returns a pointer to a static area containing a
46 short description of the current terminal (14 characters).
48 termattrs() returns a logical OR of all video attributes
49 supported by the terminal.
51 wordchar() is a PDCurses extension of the concept behind the
52 functions erasechar() and killchar(), returning the "delete
55 Portability X/Open BSD SYS V
69 **man-end****************************************************************/
76 PDC_LOG(("baudrate() - called\n"));
83 PDC_LOG(("erasechar() - called\n"));
85 return _ECHAR
; /* character delete char (^H) */
90 PDC_LOG(("has_ic() - called\n"));
97 PDC_LOG(("has_il() - called\n"));
104 PDC_LOG(("killchar() - called\n"));
106 return _DLCHAR
; /* line delete char (^U) */
111 PDC_LOG(("longname() - called\n"));
113 return ttytype
+ 9; /* skip "pdcurses|" */
116 chtype
termattrs(void)
118 chtype temp
= A_BLINK
| A_BOLD
| A_INVIS
| A_REVERSE
| A_UNDERLINE
;
120 /* note: blink is bold background on some platforms */
122 PDC_LOG(("termattrs() - called\n"));
130 attr_t
term_attrs(void)
132 PDC_LOG(("term_attrs() - called\n"));
134 return WA_BLINK
| WA_BOLD
| WA_INVIS
| WA_LEFT
| WA_REVERSE
|
135 WA_RIGHT
| WA_UNDERLINE
;
138 const char *termname(void)
140 PDC_LOG(("termname() - called\n"));
147 PDC_LOG(("wordchar() - called\n"));
149 return _DWCHAR
; /* word delete char */
153 int erasewchar(wchar_t *ch
)
155 PDC_LOG(("erasewchar() - called\n"));
160 *ch
= (wchar_t)_ECHAR
;
165 int killwchar(wchar_t *ch
)
167 PDC_LOG(("killwchar() - called\n"));
172 *ch
= (wchar_t)_DLCHAR
;