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
|
/* $OpenBSD: term.h.tail,v 1.2 1996/06/18 20:29:41 tholo Exp $ */
/*
* Copyright (c) 1996 SigmaSoft, Th. Lockert <tholo@sigmasoft.com>
* All rights reserved.
*/
typedef struct _terminal {
int fd;
speed_t baudrate;
struct termios pmode;
struct termios smode;
char *name;
char bools[_tBoolCnt];
short nums[_tNumCnt];
char *strs[_tStrCnt];
} TERMINAL;
#define Filedes fd
#define Ottyb smode
#define Nttyb pmode
#define TTY struct termios
#ifndef _CHTYPE_T_
#define _CHTYPE_T_ unsigned long
typedef _CHTYPE_T_ chtype;
#endif
#undef fixterm
#undef putp
#undef resetterm
#undef setterm
#undef vidattr
__BEGIN_DECLS
extern const char * const boolnames[];
extern const char * const boolcodes[];
extern const char * const boolfnames[];
extern const char * const numnames[];
extern const char * const numcodes[];
extern const char * const numfnames[];
extern const char * const strnames[];
extern const char * const strcodes[];
extern const char * const strfnames[];
extern int LINES;
extern int COLS;
extern int TABSIZE;
extern TERMINAL *cur_term;
extern char ttytype[];
int def_prog_mode __P((void));
int def_shell_mode __P((void));
int del_curterm __P((TERMINAL *));
int mvcur __P((int, int, int, int));
int putp __P((const char *));
int reset_prog_mode __P((void));
int reset_shell_mode __P((void));
int restartterm __P((const char *, int, int *));
int setupterm __P((const char *, int, int *));
int setterm __P((const char *));
TERMINAL *set_curterm __P((TERMINAL *));
int tigetflag __P((const char *));
int tigetnum __P((const char *));
char *tigetstr __P((const char *));
char *tparm __P((const char *, ...));
int tputs __P((const char *, int, int (*)(int)));
int tgetent __P((char *, const char *));
int tgetflag __P((const char *));
int tgetnum __P((const char *));
char *tgetstr __P((const char *, char **));
char *tgoto __P((const char *, int, int));
void use_env __P((int));
int vidattr __P((chtype));
int vidputs __P((chtype, int (*)(int)));
int _ti_outc __P((int));
__END_DECLS
#define fixterm() reset_prog_mode()
#define putp(s) tputs(s, 1, _ti_outc)
#define resetterm() reset_shell_mode()
#define setterm(term) setupterm(term, 1, (int *)0)
#define vidattr(s) vidputs(s, _ti_outc)
#ifndef OK
#define OK (0)
#endif /* OK */
#ifndef ERR
#define ERR (-1)
#endif /* ERR */
#ifndef TRUE
#define TRUE (1)
#endif
#ifndef FALSE
#define FALSE (0)
#endif
#ifndef A_ATTRIBUTES
#define A_ATTRIBUTES 0xffffff00
#define A_NORMAL 0x00000000
#define A_STANDOUT 0x00010000
#define A_UNDERLINE 0x00020000
#define A_REVERSE 0x00040000
#define A_BLINK 0x00080000
#define A_DIM 0x00100000
#define A_BOLD 0x00200000
#define A_ALTCHARSET 0x00400000
#define A_INVIS 0x00800000
#define A_PROTECT 0x01000000
#define A_HORIZONTAL 0x02000000
#define A_LEFT 0x04000000
#define A_LOW 0x08000000
#define A_RIGHT 0x10000000
#define A_TOP 0x20000000
#define A_VERTICAL 0x40000000
#define A_CHARTEXT 0x000000ff
#define A_COLOR 0x0000ff00
#endif
#endif /* _TERM_H_ */
|