* Copyright (c) 1983 Regents of the University of California.
* Redistribution and use in source and binary forms are permitted
* provided that the above copyright notice and this paragraph are
* duplicated in all such forms and that any documentation,
* advertising materials, and other materials related to such
* distribution and use acknowledge that the software was developed
* by the University of California, Berkeley. The name of the
* University may not be used to endorse or promote products derived
* from this software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
static char sccsid
[] = "@(#)main.c 3.38 (Berkeley) %G%";
#define next(a) (*++*(a) ? *(a) : (*++(a) ? *(a) : (char *)usage()))
if (p
= rindex(*argv
, '/'))
debug
= strcmp(p
, "a.out") == 0;
"Only one -c allowed.\n");
if ((p
= getenv("SHELL")) == 0)
if ((default_shellfile
= str_cpy(p
)) == 0) {
(void) fprintf(stderr
, "Out of memory.\n");
if (p
= rindex(default_shellfile
, '/'))
(void) gettimeofday(&starttime
, (struct timezone
*)0);
(void) fprintf(stderr
, "%s.\n", wwerror());
wwnewtty
.ww_tchars
.t_quitc
= wwoldtty
.ww_tchars
.t_quitc
;
wwnewtty
.ww_tchars
.t_stopc
= wwoldtty
.ww_tchars
.t_stopc
;
wwnewtty
.ww_tchars
.t_startc
= wwoldtty
.ww_tchars
.t_startc
;
(void) wwsettty(0, &wwnewtty
, &wwoldtty
);
if ((cmdwin
= wwopen(wwbaud
> 2400 ? WWO_REVERSE
: 0, 1, wwncol
,
(void) fprintf(stderr
, "%s.\r\n", wwerror());
if ((framewin
= wwopen(WWO_GLASS
|WWO_FRAME
, wwnrow
, wwncol
, 0, 0, 0))
(void) fprintf(stderr
, "%s.\r\n", wwerror());
wwadd(framewin
, &wwhead
);
if ((boxwin
= wwopen(WWO_GLASS
, wwnrow
, wwncol
, 0, 0, 0)) == 0) {
(void) fprintf(stderr
, "%s.\r\n", wwerror());
(void) dolongcmd(cmd
, (struct value
*)0, 0);
if (dflag
|| doconfig() < 0)
(void) fprintf(stderr
, "Usage: window [-e escape-char] [-c command] [-t] [-f] [-d]\n");