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