3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: ex_screen.c,v 8.8 1993/11/23 10:25:49 bostic Exp $ (Berkeley) $Date: 1993/11/23 10:25:49 $";
12 #include <sys/types.h>
21 * ex_split -- :s[plit] [file ...]
22 * Split the screen, optionally setting the file list.
25 ex_split(sp
, ep
, cmdp
)
30 return (sp
->s_split(sp
, cmdp
->argc
? cmdp
->argv
: NULL
));
43 return (sp
->s_bg(sp
));
56 return (sp
->s_fg(sp
, cmdp
->argc
? cmdp
->argv
[0] : NULL
));
60 * ex_resize -- :resize [change]
61 * Change the screen size.
64 ex_resize(sp
, ep
, cmdp
)
69 if (!F_ISSET(cmdp
, E_COUNT
))
71 return (sp
->s_resize(sp
, cmdp
->count
));
76 * Display the list of screens.
84 int cnt
, col
, len
, sep
;
86 if ((tsp
= sp
->gp
->hq
.cqh_first
) == (void *)&sp
->gp
->hq
) {
87 (void)ex_printf(EXCOOKIE
,
88 "No backgrounded screens to display.\n");
93 for (cnt
= 1; tsp
!= (void *)&sp
->gp
->hq
; tsp
= tsp
->q
.cqe_next
) {
94 col
+= len
= tsp
->frp
->nlen
+ sep
;
95 if (col
>= sp
->cols
- 1) {
98 (void)ex_printf(EXCOOKIE
, "\n");
99 } else if (cnt
!= 1) {
101 (void)ex_printf(EXCOOKIE
, " ");
103 (void)ex_printf(EXCOOKIE
, "%s", FILENAME(tsp
->frp
));
106 (void)ex_printf(EXCOOKIE
, "\n");