]> diplodocus.org Git - nmh/blob - sbr/seq_print.c
new.c: Order two return statements to match comment.
[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
10 /*
11 * Print all the sequences in a folder
12 */
13 void
14 seq_printall (struct msgs *mp)
15 {
16 size_t i;
17 char *list;
18
19 for (i = 0; i < svector_size (mp->msgattrs); i++) {
20 list = seq_list (mp, svector_at (mp->msgattrs, i));
21 printf ("%s%s: %s\n", svector_at (mp->msgattrs, i),
22 is_seq_private (mp, i) ? " (private)" : "", FENDNULL(list));
23 }
24 }
25
26
27 /*
28 * Print a particular sequence in a folder
29 */
30 void
31 seq_print (struct msgs *mp, char *seqname)
32 {
33 int i;
34 char *list;
35
36 /* get the index of sequence */
37 i = seq_getnum (mp, seqname);
38
39 /* get sequence information */
40 list = seq_list (mp, seqname);
41
42 printf ("%s%s: %s\n", seqname,
43 (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", FENDNULL(list));
44 }