File: nullterm.c

package info (click to toggle)
vile 9.5-i1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 8,248 kB
  • ctags: 8,023
  • sloc: ansic: 86,640; lex: 8,291; sh: 3,073; perl: 2,926; cpp: 2,891; makefile: 779; awk: 276
file content (243 lines) | stat: -rw-r--r-- 3,089 bytes parent folder | download
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
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
 * Define an empty terminal type for machines where we cannot use 'dumb_term',
 * so that command-line prompting will have something to talk to.
 *
 * $Header: /usr/build/vile/vile/RCS/nullterm.c,v 1.3 2006/01/12 23:37:46 tom Exp $
 */

#include	<estruct.h>
#include	<edef.h>

static void
nullterm_open(void)
{
}

static void
nullterm_close(void)
{
}

static int
nullterm_getch(void)
{
    return esc_c;
}

/*ARGSUSED*/
static OUTC_DCL
nullterm_putch(OUTC_ARGS)
{
    OUTC_RET c;
}

static int
nullterm_typahead(void)
{
    return FALSE;
}

static void
nullterm_flush(void)
{
}

/*ARGSUSED*/
static void
nullterm_curmove(int row GCC_UNUSED, int col GCC_UNUSED)
{
}

static void
nullterm_eeol(void)
{
}

static void
nullterm_eeop(void)
{
}

static void
nullterm_beep(void)
{
}

/*ARGSUSED*/
static void
nullterm_rev(UINT state GCC_UNUSED)
{
}

#if OPT_COLOR
#define NO_COLOR(name,value) name = value;
#else
#define NO_COLOR(name,value)	/*nothing */
#endif

/*
 * These are public, since we'll use them as placeholders for unimplemented
 * device methods.
 */
/*ARGSUSED*/
int
nullterm_setdescrip(const char *res GCC_UNUSED)
{
    return (FALSE);
}

/*ARGSUSED*/
int
nullterm_watchfd(int fd GCC_UNUSED, WATCHTYPE type GCC_UNUSED, long *idp GCC_UNUSED)
{
    return 0;
}

/*ARGSUSED*/
void
nullterm_clean(int f GCC_UNUSED)
{
}

void
nullterm_unclean(void)
{
}

void
nullterm_openup(void)
{
}

/*ARGSUSED*/
void
nullterm_cursorvis(int flag GCC_UNUSED)
{
}

/*ARGSUSED*/
void
nullterm_icursor(int c GCC_UNUSED)
{
}

/*ARGSUSED*/
void
nullterm_kclose(void)
{
}

/*ARGSUSED*/
void
nullterm_kopen(void)
{
}

/*ARGSUSED*/
void
nullterm_pflush(void)
{
}

/*ARGSUSED*/
void
nullterm_scroll(int f GCC_UNUSED, int t GCC_UNUSED, int n GCC_UNUSED)
{
}

/*ARGSUSED*/
void
nullterm_setback(int b GCC_UNUSED)
{
    NO_COLOR(gbcolor, C_BLACK)
}

/*ARGSUSED*/
void
nullterm_setccol(int c GCC_UNUSED)
{
    NO_COLOR(gccolor, ENUM_UNKNOWN)
}

/*ARGSUSED*/
void
nullterm_setfore(int f GCC_UNUSED)
{
    NO_COLOR(gbcolor, C_WHITE)
}

/*ARGSUSED*/
void
nullterm_setpal(const char *p GCC_UNUSED)
{
}

/*ARGSUSED*/
void
nullterm_settitle(const char *t GCC_UNUSED)
{
}

/*ARGSUSED*/
void
nullterm_unwatchfd(int fd GCC_UNUSED, long id GCC_UNUSED)
{
}

/*ARGSUSED*/
void
nullterm_mopen(void)
{
}

/*ARGSUSED*/
void
nullterm_mclose(void)
{
}

/*ARGSUSED*/
void
nullterm_mevent(void)
{
}

TERM null_term =
{
    1,
    1,
    80,
    80,
    0,				/* NPAUSE */
    nullterm_open,
    nullterm_close,
    nullterm_kopen,
    nullterm_kclose,
    nullterm_clean,
    nullterm_unclean,
    nullterm_openup,
    nullterm_getch,
    nullterm_putch,
    nullterm_typahead,
    nullterm_flush,
    nullterm_curmove,
    nullterm_eeol,
    nullterm_eeop,
    nullterm_beep,
    nullterm_rev,
    nullterm_setdescrip,
    nullterm_setfore,
    nullterm_setback,
    nullterm_setpal,
    nullterm_setccol,
    nullterm_scroll,
    nullterm_pflush,
    nullterm_icursor,
    nullterm_settitle,
    nullterm_watchfd,
    nullterm_unwatchfd,
    nullterm_cursorvis,
    nullterm_mopen,
    nullterm_mclose,
    nullterm_mevent,
};