static char *sccsid
= "@(#)lcmd1.c 3.11 83/12/09";
struct lcmd_arg arg_window
[] = {
{ "column", 1, ARG_ANY
},
{ "nlines", 2, ARG_NUM
},
register struct value
*v
;
register struct lcmd_arg
*a
= arg_window
;
int col
, row
, ncol
, nrow
, id
, nline
;
row
= a
->arg_vtype
!= V_NUM
? 1 : a
->arg_num
;
col
= (++a
)->arg_vtype
!= V_NUM
? 0 : a
->arg_num
;
nrow
= (++a
)->arg_vtype
!= V_NUM
? wwnrow
- row
: a
->arg_num
;
ncol
= (++a
)->arg_vtype
!= V_NUM
? wwncol
- col
: a
->arg_num
;
nline
= (++a
)->arg_vtype
== V_ERR
? nbufline
: a
->arg_num
;
label
= (++a
)->arg_vtype
== V_ERR
? 0 : a
->arg_str
;
if (openwin(id
, row
, col
, nrow
, ncol
, nline
, label
) == 0)
struct lcmd_arg arg_buffer
[] = {
{ "nlines", 1, ARG_NUM
},
if (arg_buffer
[0].arg_vtype
!= V_ERR
)
nbufline
= arg_buffer
[0].arg_num
;
struct lcmd_arg arg_select
[] = {
{ "window", 1, ARG_NUM
},
v
->v_num
= selwin
? selwin
->ww_id
+ 1 : -1;
if (arg_select
[0].arg_vtype
== V_ERR
)
if ((w
= vtowin(&arg_select
[0].arg_val
)) == 0)
struct lcmd_arg arg_escape
[] = {
{ "escapec", 1, ARG_NUM
},
if ((v
->v_str
= str_cpy(unctrl(escapec
))) == 0) {
if (arg_escape
[0].arg_type
!= V_ERR
)
setescape(arg_escape
[0].arg_str
);
struct lcmd_arg arg_label
[] = {
{ "window", 1, ARG_NUM
},
register struct lcmd_arg
*a
= arg_label
;
if ((w
= vtowin(&a
->arg_val
)) == 0)
if ((++a
)->arg_vtype
!= V_ERR
&& setlabel(w
, a
->arg_str
) < 0)
struct lcmd_arg arg_terse
[] = {
terse
= vtobool(&arg_terse
[0].arg_val
, 1, terse
);
else if (!v
->v_num
&& terse
)
struct lcmd_arg arg_source
[] = {
{ "filename", 1, ARG_STR
},
if (arg_source
[0].arg_vtype
!= V_ERR
&& dosource(arg_source
[0].arg_str
) < 0) {
error("Can't open %s.", arg_source
[0].arg_str
);
struct lcmd_arg arg_write
[] = {
{ "window", 1, ARG_NUM
},
{ "string", 1, ARG_STR
},
register struct lcmd_arg
*a
= arg_write
;
if ((w
= vtowin(&a
->arg_val
)) == 0)
(void) write(w
->ww_pty
, a
->arg_str
, strlen(a
->arg_str
));
struct lcmd_arg arg_close
[] = {
{ "window", 1, ARG_NUM
},
register struct lcmd_arg
*a
= arg_close
;
if (a
->arg_vtype
== V_ERR
)
else if ((w
= vtowin(&a
->arg_val
)) != 0)
struct lcmd_arg arg_cursormodes
[] = {
register struct value
*v
;
register struct lcmd_arg
*a
= arg_cursormodes
;
v
->v_num
= wwcursormodes
;
if (a
->arg_vtype
!= V_ERR
)
wwsetcursormodes(a
->arg_num
);
register struct value
*v
;
error("Window identifier required.");
error("Number required for window identifier.");
if (v
->v_num
< 1 || v
->v_num
> NWINDOW
|| (w
= window
[v
->v_num
- 1]) == 0) {
error("%d: No such window.", v
->v_num
);
register struct value
*v
;
if (str_match(v
->v_str
, "true", 1)
|| str_match(v
->v_str
, "on", 2)
|| str_match(v
->v_str
, "yes", 1))
else if (str_match(v
->v_str
, "false", 1)
|| str_match(v
->v_str
, "off", 2)
|| str_match(v
->v_str
, "no", 1))
error("%s: Illegal boolean value.", v
->v_str
);