2 * Copyright (c) 1993, 1994
3 * The Regents of the University of California. All rights reserved.
4 * Copyright (c) 1993, 1994, 1995, 1996
5 * Keith Bostic. All rights reserved.
7 * See the LICENSE file for redistribution information.
12 #include <sys/types.h>
13 #include <sys/queue.h>
16 #include <bitstring.h>
22 #include "../common/common.h"
29 * PUBLIC: int ex_bg(SCR *, EXCMD *);
32 ex_bg(SCR *sp, EXCMD *cmdp)
41 * PUBLIC: int ex_fg(SCR *, EXCMD *);
44 ex_fg(SCR *sp, EXCMD *cmdp)
49 newscreen = F_ISSET(cmdp, E_NEWSCREEN);
50 if (vs_fg(sp, &nsp, cmdp->argc ? cmdp->argv[0]->bp : NULL, newscreen))
53 /* Set up the switch. */
56 F_SET(sp, SC_SSWITCH);
62 * ex_resize -- :resize [+-]rows
63 * Change the screen size.
65 * PUBLIC: int ex_resize(SCR *, EXCMD *);
68 ex_resize(SCR *sp, EXCMD *cmdp)
72 switch (FL_ISSET(cmdp->iflags,
73 E_C_COUNT | E_C_COUNT_NEG | E_C_COUNT_POS)) {
77 case E_C_COUNT | E_C_COUNT_NEG:
80 case E_C_COUNT | E_C_COUNT_POS:
84 ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE);
87 return (vs_resize(sp, cmdp->count, adj));
92 * Display the list of screens.
94 * PUBLIC: int ex_sdisplay(SCR *);
101 int cnt, col, len, sep;
104 if ((tsp = TAILQ_FIRST(gp->hq)) == NULL) {
105 msgq(sp, M_INFO, "149|No background screens to display");
110 for (cnt = 1; tsp != NULL && !INTERRUPTED(sp);
111 tsp = TAILQ_NEXT(tsp, q)) {
112 col += len = strlen(tsp->frp->name) + sep;
113 if (col >= sp->cols - 1) {
116 (void)ex_puts(sp, "\n");
117 } else if (cnt != 1) {
119 (void)ex_puts(sp, " ");
121 (void)ex_puts(sp, tsp->frp->name);
124 if (!INTERRUPTED(sp))
125 (void)ex_puts(sp, "\n");