2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * %sccs.include.redist.c%
9 static char sccsid
[] = "$Id: ex_display.c,v 8.12 1993/12/02 10:55:03 bostic Exp $ (Berkeley) $Date: 1993/12/02 10:55:03 $";
12 #include <sys/types.h>
21 static int bdisplay
__P((SCR
*, EXF
*));
22 static void db
__P((SCR
*, CB
*));
25 * ex_display -- :display b[uffers] | s[creens] | t[ags]
27 * Display buffers, tags or screens.
30 ex_display(sp
, ep
, cmdp
)
35 switch (cmdp
->argv
[0]->bp
[0]) {
37 return (bdisplay(sp
, ep
));
39 return (ex_sdisplay(sp
, ep
));
41 return (ex_tagdisplay(sp
, ep
));
44 "Unknown display argument %s, use b[uffers], s[creens], or t[ags].",
61 if (sp
->gp
->cutq
.lh_first
== NULL
) {
62 (void)ex_printf(EXCOOKIE
, "No cut buffers to display.");
66 /* Display regular cut buffers. */
67 for (cbp
= sp
->gp
->cutq
.lh_first
; cbp
!= NULL
; cbp
= cbp
->q
.le_next
) {
68 if (isdigit(cbp
->name
))
70 if (cbp
->textq
.cqh_first
!= (void *)&cbp
->textq
)
73 /* Display numbered buffers. */
74 for (cbp
= sp
->gp
->cutq
.lh_first
; cbp
!= NULL
; cbp
= cbp
->q
.le_next
) {
75 if (!isdigit(cbp
->name
))
77 if (cbp
->textq
.cqh_first
!= (void *)&cbp
->textq
)
96 (void)ex_printf(EXCOOKIE
, "********** %s%s\n", charname(sp
, cbp
->name
),
97 F_ISSET(cbp
, CB_LMODE
) ? " (line mode)" : "");
98 for (tp
= cbp
->textq
.cqh_first
;
99 tp
!= (void *)&cbp
->textq
; tp
= tp
->q
.cqe_next
) {
100 for (len
= tp
->len
, p
= tp
->lb
; len
--;)
101 (void)ex_printf(EXCOOKIE
, "%s", charname(sp
, *p
++));
102 (void)ex_printf(EXCOOKIE
, "\n");