]> diplodocus.org Git - nmh/blob - sbr/seq_print.c
Just reworded the bit about '%s' being safe not to quote (it's only safe not to
[nmh] / sbr / seq_print.c
1
2 /*
3 * seq_print.c -- Routines to print sequence information.
4 *
5 * $Id$
6 */
7
8 #include <h/mh.h>
9
10 #define empty(s) ((s) ? (s) : "")
11
12 /*
13 * Print all the sequences in a folder
14 */
15 void
16 seq_printall (struct msgs *mp)
17 {
18 int i;
19 char *list;
20
21 for (i = 0; mp->msgattrs[i]; i++) {
22 list = seq_list (mp, mp->msgattrs[i]);
23 printf ("%s%s: %s\n", mp->msgattrs[i],
24 is_seq_private (mp, i) ? " (private)" : "", empty(list));
25 }
26 }
27
28
29 /*
30 * Print a particular sequence in a folder
31 */
32 void
33 seq_print (struct msgs *mp, char *seqname)
34 {
35 int i;
36 char *list;
37
38 /* get the index of sequence */
39 i = seq_getnum (mp, seqname);
40
41 /* get sequence information */
42 list = seq_list (mp, seqname);
43
44 printf ("%s%s: %s\n", seqname,
45 (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", empty(list));
46 }