add IFF_LOCAL
[unix-history] / usr / src / usr.bin / window / lcmd.c
CommitLineData
6a571c25 1#ifndef lint
94a746af 2static char *sccsid = "@(#)lcmd.c 3.15 84/04/05";
6a571c25
EW
3#endif
4
5#include "defs.h"
1c0ca238
EW
6#include "value.h"
7#include "lcmd.h"
6a571c25 8
4cbe417d 9int l_buffer();
1c0ca238 10int l_close();
7a57b3e2 11int l_cursormodes();
b0640643 12int l_debug();
6a571c25 13int l_escape();
e1dba5dd 14int l_foreground();
94a746af 15int l_iostat();
6a571c25 16int l_label();
1c0ca238 17int l_select();
6a571c25 18int l_source();
1c0ca238 19int l_terse();
94a746af 20int l_time();
b65b69eb 21int l_unset();
1c0ca238 22int l_window();
6a571c25
EW
23int l_write();
24
1c0ca238
EW
25struct lcmd_arg arg_buffer[];
26struct lcmd_arg arg_close[];
7a57b3e2 27struct lcmd_arg arg_cursormodes[];
b0640643 28struct lcmd_arg arg_debug[];
1c0ca238 29struct lcmd_arg arg_escape[];
e1dba5dd 30struct lcmd_arg arg_foreground[];
94a746af 31struct lcmd_arg arg_iostat[];
1c0ca238
EW
32struct lcmd_arg arg_label[];
33struct lcmd_arg arg_select[];
34struct lcmd_arg arg_source[];
35struct lcmd_arg arg_terse[];
94a746af 36struct lcmd_arg arg_time[];
b65b69eb 37struct lcmd_arg arg_unset[];
1c0ca238
EW
38struct lcmd_arg arg_window[];
39struct lcmd_arg arg_write[];
40
41struct lcmd_tab lcmd_tab[] = {
42 "%", 1, l_select, arg_select,
e1dba5dd 43 "buffer", 2, l_buffer, arg_buffer,
7a57b3e2
EW
44 "close", 2, l_close, arg_close,
45 "cursormodes", 2, l_cursormodes, arg_cursormodes,
b0640643 46 "debug", 1, l_debug, arg_debug,
1c0ca238 47 "escape", 1, l_escape, arg_escape,
e1dba5dd 48 "foreground", 1, l_foreground, arg_foreground,
94a746af 49 "iostat", 1, l_iostat, arg_iostat,
1c0ca238
EW
50 "label", 1, l_label, arg_label,
51 "select", 2, l_select, arg_select,
52 "source", 2, l_source, arg_source,
94a746af
EW
53 "terse", 2, l_terse, arg_terse,
54 "time", 2, l_time, arg_time,
b65b69eb 55 "unset", 1, l_unset, arg_unset,
1c0ca238
EW
56 "window", 2, l_window, arg_window,
57 "write", 2, l_write, arg_write,
e1dba5dd 58 0
6a571c25
EW
59};
60
1c0ca238
EW
61struct lcmd_tab *
62lcmd_lookup(name)
63char *name;
6a571c25 64{
1c0ca238 65 register struct lcmd_tab *p;
6a571c25 66
1c0ca238
EW
67 for (p = lcmd_tab; p->lc_name != 0; p++)
68 if (str_match(name, p->lc_name, p->lc_minlen))
69 return p;
6a571c25
EW
70 return 0;
71}
72
1c0ca238
EW
73dosource(filename)
74char *filename;
6a571c25 75{
a40a2f9a 76 if (cx_beginfile(filename) < 0)
1c0ca238
EW
77 return -1;
78 p_start();
79 err_end();
80 cx_end();
81 return 0;
6a571c25
EW
82}
83
1c0ca238
EW
84dolongcmd(buffer)
85char *buffer;
6a571c25 86{
a40a2f9a 87 if (cx_beginbuf(buffer) < 0)
1c0ca238
EW
88 return -1;
89 p_start();
90 err_end();
91 cx_end();
92 return 0;
6a571c25 93}