]> diplodocus.org Git - nmh/blob - sbr/seq_print.c
Cope with sasl_decode64() returning SASL_CONTINUE as well as SASL_OK.
[nmh] / sbr / seq_print.c
1
2 /*
3 * seq_print.c -- Routines to print sequence information.
4 *
5 * $Id$
6 *
7 * This code is Copyright (c) 2002, by the authors of nmh. See the
8 * COPYRIGHT file in the root directory of the nmh distribution for
9 * complete copyright information.
10 */
11
12 #include <h/mh.h>
13
14 #define empty(s) ((s) ? (s) : "")
15
16 /*
17 * Print all the sequences in a folder
18 */
19 void
20 seq_printall (struct msgs *mp)
21 {
22 int i;
23 char *list;
24
25 for (i = 0; mp->msgattrs[i]; i++) {
26 list = seq_list (mp, mp->msgattrs[i]);
27 printf ("%s%s: %s\n", mp->msgattrs[i],
28 is_seq_private (mp, i) ? " (private)" : "", empty(list));
29 }
30 }
31
32
33 /*
34 * Print a particular sequence in a folder
35 */
36 void
37 seq_print (struct msgs *mp, char *seqname)
38 {
39 int i;
40 char *list;
41
42 /* get the index of sequence */
43 i = seq_getnum (mp, seqname);
44
45 /* get sequence information */
46 list = seq_list (mp, seqname);
47
48 printf ("%s%s: %s\n", seqname,
49 (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", empty(list));
50 }