File: term.h

package info (click to toggle)
epic 3.004-17.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 5,192 kB
  • ctags: 3,197
  • sloc: ansic: 40,843; makefile: 530; sh: 129; perl: 17
file content (174 lines) | stat: -rw-r--r-- 4,697 bytes parent folder | download | duplicates (4)
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
173
174
/*
 * term.h: header file for term.c 
 *
 * Written By Michael Sandrof
 *
 * Copyright(c) 1990 
 *
 * See the COPYRIGHT file, or do a HELP IRCII COPYRIGHT 
 *
 * @(#)$Id: term.h,v 1.8 1994/07/02 02:38:10 mrg Exp $
 */

#ifndef _TERM_H_
# define _TERM_H_

#ifdef MUNIX
# include <sys/ttold.h>
#endif

#include "irc_std.h"

extern	int	term_reset_flag;
extern	char	*CM, *DO, *CE, *CL, *CR, *NL, *SO, *SE, *US, *UE, *MD, *ME, *BL;
extern	int	CO, LI, SG; 

/* 
 * fix suggested by <insert person's name here> that we shouldnt prototype
 * the term stuff on IRIX cause its broke. whee.
 */
#ifdef IRIX
# undef _
#endif

/* If this applies to your system too, then just add it to the list. */
#if defined(NetBSD)
#define PUTCHAR_X_RETURN void
#else
#define PUTCHAR_X_RETURN int
#endif

extern PUTCHAR_X_RETURN putchar_x _((int));

/* 
 * On some systems (ie, netbsd) this stuff is defined in <curses.h>
 * which for some reason we dont include... I plan on investigating
 * how linux, sunos, and other major UNIXes handle these, and will
 * change this header file accordingly.  In the meantime, i will hope
 * that including these decs doesnt break anything. :P
 *
 * This will make gcc shut up on netbsd.  Other system will still
 * get the warnings unless you port this to your system.  (if you
 * do, let me know =)
 */
#ifdef NetBSD
extern void  tputs _((char *, int, PUTCHAR_X_RETURN (*) _((int)) ));
extern char *tgoto _((char *, int, int));
extern int   tgetnum _((char *));
extern int   tgetflag _((char *));
#endif

#define tputs_x(s)		(tputs(s, 0, putchar_x))
#define term_underline_on()	(tputs_x(US))
#define term_underline_off()	(tputs_x(UE))
#define term_standout_on()	(tputs_x(SO))
#define term_standout_off()	(tputs_x(SE))
#define term_clear_screen()	(tputs_x(CL))
#define term_move_cursor(c, r)	(tputs_x(tgoto(CM, (c), (r))))
#define term_cr()		(tputs_x(CR))
#define term_newline()		(tputs_x(NL))
/* Idea for not having the client beep you when /set BEEP off
 * from Genesis K.
 */
#define term_beep()		if (get_int_var(BEEP_VAR))	\
				{				\
				      tputs_x(BL);		\
				      fflush(current_screen ? 	\
					current_screen->fpout : \
					stdout);		\
				}
#define	term_bold_on()		(tputs_x(MD))
#define	term_bold_off()		(tputs_x(ME))

extern	RETSIGTYPE	term_cont _((int));
extern	int	term_echo _((int));
extern	void	term_init _((void));
#ifndef STTY_ONLY
extern	int	term_resize _((void));
#endif
extern	void	term_pause _((char, char *));
extern	void	term_putchar _((unsigned char));
extern	int	term_puts _((char *, int));
extern	void	term_flush _((void));
extern	int	(*term_scroll) _((int, int, int));
extern	int	(*term_insert) _((char));
extern	int	(*term_delete) _((void));
extern	int	(*term_cursor_right) _((void));
extern	int	(*term_cursor_left) _((void));
extern	int	(*term_clear_to_eol) _((void));
extern	void	term_space_erase _((int));
extern	void	term_reset _((void));

extern  void    copy_window_size _((int *, int *));
extern	int	term_eight_bit _((void));
extern	void	set_term_eight_bit _((int));

#if defined(ISC22) || defined(MUNIX)
/* Structure for terminal special characters */
struct	tchars
{
	char	t_intrc;	/* Interrupt			*/
	char	t_quitc;	/* Quit 			*/
	char	t_startc;	/* Start output 		*/
	char	t_stopc;	/* Stop output			*/
	char	t_eofc;		/* End-of-file (EOF)		*/
	char	t_brkc;		/* Input delimiter (like nl)	*/
}

struct ltchars
{
	char	t_suspc;	/* stop process signal		*/
	char	t_dsuspc;	/* delayed stop process signal	*/
	char	t_rprntc;	/* reprint line			*/
	char	t_flushc;	/* flush output (toggles)	*/
	char	t_werasc;	/* word erase			*/
	char	t_lnextc;	/* literal next character	*/
};
#endif /* ISC22 || MUNIX */

#if defined(_HPUX_SOURCE)

#ifndef _TTY_CHARS_ST_
#define _TTY_CHARS_ST_

/* Structure for terminal special characters */
struct tchars
{
	char	t_intrc;	/* Interrupt			*/
	char	t_quitc;	/* Quit 			*/
	char	t_startc;	/* Start output 		*/
	char	t_stopc;	/* Stop output			*/
	char	t_eofc;		/* End-of-file (EOF)		*/
	char	t_brkc;		/* Input delimiter (like nl)	*/
};

#endif /* _TTY_CHARS_ST_ */

#ifndef TIOCSETC
# define TIOCSETC	_IOW('t', 17, struct tchars)	/* set special chars */
#endif /* TIOCSETC */

#ifndef TIOCGETC
# define TIOCGETC	_IOR('t', 18, struct tchars)	/* get special chars */
#endif /* TIOCGETC */

#ifndef CBREAK
# define CBREAK		0x02	/* Half-cooked mode */
#endif /* CBREAK */

#ifndef SIGWINCH
# define    SIGWINCH    SIGWINDOW
#endif /* SIGWINCH */

#endif /* _HPUX_SOURCE */

/* well, it works */
/* This is lame. This means you cant do window create on ultrix/irix/etc */
#if 0
#ifdef mips
# define fputc(c,f) write(1,&(c),1)
# define fwrite(buffer,len,cnt,f) write(1,buffer,len)
#endif /*mips*/
#endif

#endif /* _TERM_H_ */