1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
/* PDCurses */
#include <curspriv.h>
/*man-start**************************************************************
termattr
--------
### Synopsis
int baudrate(void);
char erasechar(void);
bool has_ic(void);
bool has_il(void);
char killchar(void);
char *longname(void);
chtype termattrs(void);
attr_t term_attrs(void);
char *termname(void);
int erasewchar(wchar_t *ch);
int killwchar(wchar_t *ch);
char wordchar(void);
### Description
baudrate() is supposed to return the output speed of the terminal. In
PDCurses, it simply returns INT_MAX.
has_ic and has_il() return TRUE. These functions have meaning in some
other implementations of curses.
erasechar() and killchar() return ^H and ^U, respectively -- the
ERASE and KILL characters. In other curses implementations, these may
vary by terminal type. erasewchar() and killwchar() are the wide-
character versions; they take a pointer to a location in which to
store the character, and return OK or ERR.
longname() returns a pointer to a static area containing a verbose
description of the current terminal. The maximum length of the string
is 128 characters. It is defined only after the call to initscr() or
newterm().
termname() returns a pointer to a static area containing a short
description of the current terminal (14 characters).
termattrs() returns a logical OR of all video attributes supported by
the terminal.
wordchar() is a PDCurses extension of the concept behind the
functions erasechar() and killchar(), returning the "delete word"
character, ^W.
### Portability
X/Open ncurses NetBSD
baudrate Y Y Y
erasechar Y Y Y
has_ic Y Y Y
has_il Y Y Y
killchar Y Y Y
longname Y Y Y
termattrs Y Y Y
termname Y Y Y
erasewchar Y Y Y
killwchar Y Y Y
term_attrs Y Y Y
wordchar - - -
**man-end****************************************************************/
#include <string.h>
#include <limits.h>
int baudrate(void)
{
PDC_LOG(("baudrate() - called\n"));
return INT_MAX;
}
char erasechar(void)
{
PDC_LOG(("erasechar() - called\n"));
return _ECHAR; /* character delete char (^H) */
}
bool has_ic(void)
{
PDC_LOG(("has_ic() - called\n"));
return TRUE;
}
bool has_il(void)
{
PDC_LOG(("has_il() - called\n"));
return TRUE;
}
char killchar(void)
{
PDC_LOG(("killchar() - called\n"));
return _DLCHAR; /* line delete char (^U) */
}
char *longname(void)
{
PDC_LOG(("longname() - called\n"));
return ttytype + 9; /* skip "pdcurses|" */
}
chtype termattrs(void)
{
PDC_LOG(("termattrs() - called\n"));
return SP ? SP->termattrs : (chtype)0;
}
attr_t term_attrs(void)
{
PDC_LOG(("term_attrs() - called\n"));
return SP ? SP->termattrs : (attr_t)0;
}
char *termname(void)
{
static char _termname[14] = "pdcurses";
PDC_LOG(("termname() - called\n"));
return _termname;
}
char wordchar(void)
{
PDC_LOG(("wordchar() - called\n"));
return _DWCHAR; /* word delete char */
}
#ifdef PDC_WIDE
int erasewchar(wchar_t *ch)
{
PDC_LOG(("erasewchar() - called\n"));
if (!ch)
return ERR;
*ch = (wchar_t)_ECHAR;
return OK;
}
int killwchar(wchar_t *ch)
{
PDC_LOG(("killwchar() - called\n"));
if (!ch)
return ERR;
*ch = (wchar_t)_DLCHAR;
return OK;
}
#endif
|