Don't put an uninitialized string into the blanker environment.
[screen-lua.git] / src / comm.c
blob02337f0c022741783b9743acace64f2a2e1803bc
1 /* Copyright (c) 1993-2002
2 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de)
3 * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de)
4 * Copyright (c) 1987 Oliver Laumann
6 #ifdef HAVE_BRAILLE
7 * Modified by:
8 * Authors: Hadi Bargi Rangin bargi@dots.physics.orst.edu
9 * Bill Barry barryb@dots.physics.orst.edu
11 * Modifications Copyright (c) 1995 by
12 * Science Access Project, Oregon State University.
13 #endif
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2, or (at your option)
18 * any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program (see the file COPYING); if not, write to the
27 * Free Software Foundation, Inc.,
28 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
30 ****************************************************************
33 #include "config.h"
34 #include "acls.h"
35 #include "comm.h"
37 #define bcopy :-( /* or include screen.h here */
39 /* Must be in alpha order ! */
41 struct comm comms[RC_LAST + 1] =
43 #ifdef MULTIUSER
44 { "acladd", ARGS_1234 },
45 { "aclchg", ARGS_23 },
46 { "acldel", ARGS_1 },
47 { "aclgrp", ARGS_12 },
48 { "aclumask", ARGS_1|ARGS_ORMORE },
49 #endif
50 { "activity", ARGS_1 },
51 #ifdef MULTIUSER
52 { "addacl", ARGS_1234 },
53 #endif
54 { "allpartial", NEED_DISPLAY|ARGS_1 },
55 { "altscreen", ARGS_01 },
56 { "at", NEED_DISPLAY|ARGS_2|ARGS_ORMORE },
57 #ifdef COLOR
58 { "attrcolor", ARGS_12 },
59 #endif
60 { "autodetach", ARGS_1 },
61 #ifdef AUTO_NUKE
62 { "autonuke", NEED_DISPLAY|ARGS_1 },
63 #endif
64 { "backtick", ARGS_1|ARGS_ORMORE },
65 #ifdef COLOR
66 { "bce", NEED_FORE|ARGS_01 },
67 #endif
69 #ifdef HAVE_BRAILLE
70 /* keywords for braille display (bd) */
71 { "bd_bc_down", ARGS_0 },
72 { "bd_bc_left", ARGS_0 },
73 { "bd_bc_right", ARGS_0 },
74 { "bd_bc_up", ARGS_0 },
75 { "bd_bell", ARGS_01 },
76 { "bd_braille_table", ARGS_01 },
77 { "bd_eightdot", ARGS_01 },
78 { "bd_info", ARGS_01 },
79 { "bd_link", ARGS_01 },
80 { "bd_lower_left", ARGS_0 },
81 { "bd_lower_right", ARGS_0 },
82 { "bd_ncrc", ARGS_01 },
83 { "bd_port", ARGS_01 },
84 { "bd_scroll", ARGS_01 },
85 { "bd_skip", ARGS_01 },
86 { "bd_start_braille", ARGS_01 },
87 { "bd_type", ARGS_01 },
88 { "bd_upper_left", ARGS_0 },
89 { "bd_upper_right", ARGS_0 },
90 { "bd_width", ARGS_01 },
91 #endif
93 { "bell", ARGS_01 },
94 { "bell_msg", ARGS_01 },
95 { "bind", ARGS_1|ARGS_ORMORE },
96 #ifdef MAPKEYS
97 { "bindkey", ARGS_0|ARGS_ORMORE },
98 #endif
99 { "blanker", NEED_DISPLAY|ARGS_0},
100 #ifdef BLANKER_PRG
101 { "blankerprg", ARGS_1|ARGS_ORMORE },
102 #endif
103 { "break", NEED_FORE|ARGS_01 },
104 { "breaktype", NEED_FORE|ARGS_01 },
105 #ifdef COPY_PASTE
106 { "bufferfile", ARGS_01 },
107 #endif
108 { "c1", NEED_FORE|ARGS_01 },
109 { "caption", ARGS_12 },
110 #ifdef MULTIUSER
111 { "chacl", ARGS_23 },
112 #endif
113 { "charset", NEED_FORE|ARGS_1 },
114 { "chdir", ARGS_01 },
115 #ifdef DW_CHARS
116 { "cjkwidth", ARGS_01 },
117 #endif
118 { "clear", NEED_FORE|ARGS_0 },
119 { "colon", NEED_LAYER|ARGS_01 },
120 { "command", NEED_DISPLAY|ARGS_02 },
121 #ifdef COPY_PASTE
122 { "compacthist", ARGS_01 },
123 #endif
124 { "console", NEED_FORE|ARGS_01 },
125 #ifdef COPY_PASTE
126 { "copy", NEED_FORE|NEED_DISPLAY|ARGS_0 },
127 { "crlf", ARGS_01 },
128 #endif
129 { "debug", ARGS_01 },
130 #ifdef AUTO_NUKE
131 { "defautonuke", ARGS_1 },
132 #endif
133 #ifdef COLOR
134 { "defbce", ARGS_1 },
135 #endif
136 { "defbreaktype", ARGS_01 },
137 { "defc1", ARGS_1 },
138 { "defcharset", ARGS_01 },
139 #ifdef ENCODINGS
140 { "defencoding", ARGS_1 },
141 #endif
142 { "defescape", ARGS_1 },
143 { "defflow", ARGS_12 },
144 { "defgr", ARGS_1 },
145 { "defhstatus", ARGS_01 },
146 #ifdef ENCODINGS
147 { "defkanji", ARGS_1 },
148 #endif
149 { "deflog", ARGS_1 },
150 #if defined(UTMPOK) && defined(LOGOUTOK)
151 { "deflogin", ARGS_1 },
152 #endif
153 { "defmode", ARGS_1 },
154 { "defmonitor", ARGS_1 },
155 #ifdef MULTI
156 { "defnonblock", ARGS_1 },
157 #endif
158 { "defobuflimit", ARGS_1 },
159 #ifdef COPY_PASTE
160 { "defscrollback", ARGS_1 },
161 #endif
162 { "defshell", ARGS_1 },
163 { "defsilence", ARGS_1 },
164 { "defslowpaste", ARGS_1 },
165 #ifdef UTF8
166 { "defutf8", ARGS_1 },
167 #endif
168 { "defwrap", ARGS_1 },
169 { "defwritelock", ARGS_1 },
170 #ifdef DETACH
171 { "detach", NEED_DISPLAY|ARGS_01 },
172 #endif
173 { "digraph", NEED_LAYER|ARGS_01 },
174 { "dinfo", NEED_DISPLAY|ARGS_0 },
175 { "displays", NEED_LAYER|ARGS_0 },
176 { "dumptermcap", NEED_FORE|ARGS_0 },
177 { "echo", ARGS_12 },
178 #ifdef ENCODINGS
179 { "encoding", ARGS_12 },
180 #endif
181 { "escape", ARGS_1 },
182 { "eval", ARGS_1|ARGS_ORMORE },
183 #ifdef PSEUDOS
184 { "exec", NEED_FORE|ARGS_0|ARGS_ORMORE },
185 #endif
186 { "fit", NEED_DISPLAY|ARGS_0 },
187 { "flow", NEED_FORE|ARGS_01 },
188 { "focus", NEED_DISPLAY|ARGS_01 },
189 { "focusminsize", ARGS_02 },
190 { "gr", NEED_FORE|ARGS_01 },
191 { "group", NEED_FORE|ARGS_01 },
192 { "hardcopy", ARGS_012 },
193 { "hardcopy_append", ARGS_1 },
194 { "hardcopydir", ARGS_01 },
195 { "hardstatus", ARGS_012 },
196 { "height", ARGS_0123 },
197 { "help", NEED_LAYER|ARGS_02 },
198 #ifdef COPY_PASTE
199 { "history", NEED_DISPLAY|NEED_FORE|ARGS_0 },
200 #endif
201 { "hstatus", NEED_FORE|ARGS_1 },
202 { "idle", ARGS_0|ARGS_ORMORE },
203 { "ignorecase", ARGS_01 },
204 { "info", NEED_LAYER|ARGS_0 },
205 #ifdef ENCODINGS
206 { "kanji", NEED_FORE|ARGS_12 },
207 #endif
208 { "kill", NEED_FORE|ARGS_0 },
209 { "lastmsg", NEED_DISPLAY|ARGS_0 },
210 { "layout", ARGS_1|ARGS_ORMORE},
211 { "license", NEED_LAYER|ARGS_0 },
212 #ifdef LOCK
213 { "lockscreen", NEED_DISPLAY|ARGS_0 },
214 #endif
215 { "log", NEED_FORE|ARGS_01 },
216 { "logfile", ARGS_012 },
217 #if defined(UTMPOK) && defined(LOGOUTOK)
218 { "login", NEED_FORE|ARGS_01 },
219 #endif
220 { "logtstamp", ARGS_012 },
221 #ifdef MAPKEYS
222 { "mapdefault", NEED_DISPLAY|ARGS_0 },
223 { "mapnotnext", NEED_DISPLAY|ARGS_0 },
224 { "maptimeout", ARGS_01 },
225 #endif
226 #ifdef COPY_PASTE
227 { "markkeys", ARGS_1 },
228 #endif
229 { "maxwin", ARGS_1 },
230 { "meta", NEED_LAYER|ARGS_0 },
231 { "monitor", NEED_FORE|ARGS_01 },
232 { "msgminwait", ARGS_1 },
233 { "msgwait", ARGS_1 },
234 #ifdef MULTIUSER
235 { "multiuser", ARGS_1 },
236 #endif
237 #ifdef NETHACK
238 { "nethack", ARGS_1 },
239 #endif
240 { "next", ARGS_0 },
241 #ifdef MULTI
242 { "nonblock", NEED_DISPLAY|ARGS_01 },
243 #endif
244 { "number", NEED_FORE|ARGS_01 },
245 { "obuflimit", NEED_DISPLAY|ARGS_01 },
246 { "only", NEED_DISPLAY|ARGS_0 },
247 { "other", ARGS_0 },
248 { "partial", NEED_FORE|ARGS_01 },
249 #ifdef PASSWORD
250 { "password", ARGS_01 },
251 #endif
252 #ifdef COPY_PASTE
253 { "paste", NEED_LAYER|ARGS_012 },
254 { "pastefont", ARGS_01 },
255 #endif
256 { "pow_break", NEED_FORE|ARGS_01 },
257 #if defined(DETACH) && defined(POW_DETACH)
258 { "pow_detach", NEED_DISPLAY|ARGS_0 },
259 { "pow_detach_msg", ARGS_01 },
260 #endif
261 { "prev", ARGS_0 },
262 { "printcmd", ARGS_01 },
263 { "process", NEED_DISPLAY|ARGS_01 },
264 { "quit", ARGS_0 },
265 #ifdef COPY_PASTE
266 { "readbuf", ARGS_0123 },
267 #endif
268 { "readreg", ARGS_0|ARGS_ORMORE },
269 { "redisplay", NEED_DISPLAY|ARGS_0 },
270 { "register", ARGS_24 },
271 { "remove", NEED_DISPLAY|ARGS_0 },
272 #ifdef COPY_PASTE
273 { "removebuf", ARGS_0 },
274 #endif
275 { "reset", NEED_FORE|ARGS_0 },
276 { "resize", NEED_DISPLAY|ARGS_0|ARGS_ORMORE },
277 { "screen", ARGS_0|ARGS_ORMORE },
278 #ifdef COPY_PASTE
279 { "scrollback", NEED_FORE|ARGS_1 },
280 #endif
281 { "select", ARGS_01 },
282 { "sessionname", ARGS_01 },
283 { "setenv", ARGS_012 },
284 { "setsid", ARGS_1 },
285 { "shell", ARGS_1 },
286 { "shelltitle", ARGS_1 },
287 { "silence", NEED_FORE|ARGS_01 },
288 { "silencewait", ARGS_1 },
289 { "sleep", ARGS_1 },
290 { "slowpaste", NEED_FORE|ARGS_01 },
291 { "sorendition", ARGS_012 },
292 { "source", ARGS_1 },
293 { "split", NEED_DISPLAY|ARGS_01 },
294 { "startup_message", ARGS_1 },
295 { "stuff", NEED_LAYER|ARGS_12 },
296 #ifdef MULTIUSER
297 { "su", NEED_DISPLAY|ARGS_012 },
298 #endif
299 #ifdef BSDJOBS
300 { "suspend", NEED_DISPLAY|ARGS_0 },
301 #endif
302 { "term", ARGS_1 },
303 { "termcap", ARGS_23 },
304 { "termcapinfo", ARGS_23 },
305 { "terminfo", ARGS_23 },
306 { "time", ARGS_01 },
307 { "title", NEED_FORE|ARGS_01 },
308 { "umask", ARGS_1|ARGS_ORMORE },
309 { "unsetenv", ARGS_1 },
310 #ifdef UTF8
311 { "utf8", NEED_FORE|ARGS_012 },
312 #endif
313 { "vbell", ARGS_01 },
314 { "vbell_msg", ARGS_01 },
315 { "vbellwait", ARGS_1 },
316 { "verbose", ARGS_01 },
317 { "version", ARGS_0 },
318 { "wall", NEED_DISPLAY|ARGS_1},
319 { "width", ARGS_0123 },
320 { "windowlist", ARGS_012 },
321 { "windows", NEED_DISPLAY|ARGS_0 },
322 { "wrap", NEED_FORE|ARGS_01 },
323 #ifdef COPY_PASTE
324 { "writebuf", ARGS_0123 },
325 #endif
326 { "writelock", NEED_FORE|ARGS_01 },
327 { "xoff", NEED_LAYER|ARGS_0 },
328 { "xon", NEED_LAYER|ARGS_0 },
329 #ifdef ZMODEM
330 { "zmodem", ARGS_012 },
331 #endif
332 { "zombie", ARGS_012 }