static char sccsid
[] = "@(#)cmd1.c 3.29 %G%";
* Copyright (c) 1983 Regents of the University of California,
* All rights reserved. Redistribution permitted subject to
* the terms of the Berkeley Software License Agreement.
int col
, row
, xcol
, xrow
;
wwputs("New window (upper left corner): ", cmdwin
);
wwadd(boxwin
, framewin
->ww_back
);
wwbox(boxwin
, row
- 1, col
- 1, 3, 3);
switch (getpos(&row
, &col
, row
> 1, 0,
wwnrow
- 1, wwncol
- 1)) {
wwputs("\nNew window (lower right corner): ", cmdwin
);
wwbox(boxwin
, row
- 1, col
- 1,
xrow
- row
+ 3, xcol
- col
+ 3);
switch (getpos(&xrow
, &xcol
, row
, col
, wwnrow
- 1, wwncol
- 1))
(void) openwin(id
, row
, col
, xrow
-row
+1, xcol
-col
+1, nbufline
,
(char *) 0, 1, 1, shellfile
, shell
);
getpos(row
, col
, minrow
, mincol
, maxrow
, maxcol
)
int oldrow
= *row
, oldcol
= *col
;
while ((c
= wwgetc()) >= 0) {
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
scount
= scount
* 10 + c
- '0';
count
= scount
? scount
: 1;
if ((*col
-= count
) < mincol
)
if ((*col
+= count
) > maxcol
)
if ((*row
+= count
) > maxrow
)
if ((*row
-= count
) < minrow
)
wwputs("\nCanceled. ", cmdwin
);
wwputs("\nType [hjklHJKL] to move, return to enter position, escape to cancel.", cmdwin
);
return oldrow
!= *row
|| oldcol
!= *col
;