]> diplodocus.org Git - nmh/blobdiff - sbr/seq_print.c
Also trap ambiguous post switch.
[nmh] / sbr / seq_print.c
index 81a1f5ca56de84768bc3cf9f29be87a463345583..4e4b9462bebdbf61994800b64baea5b5f8b533de 100644 (file)
@@ -1,17 +1,14 @@
-
-/*
- * seq_print.c -- Routines to print sequence information.
- *
- * $Id$
+/* seq_print.c -- Routines to print sequence information.
  *
  * This code is Copyright (c) 2002, by the authors of nmh.  See the
  * COPYRIGHT file in the root directory of the nmh distribution for
  * complete copyright information.
  */
 
-#include <h/mh.h>
-
-#define empty(s) ((s) ? (s) : "")
+#include "h/mh.h"
+#include "seq_list.h"
+#include "seq_getnum.h"
+#include "seq_print.h"
 
 /*
  * Print all the sequences in a folder
 void
 seq_printall (struct msgs *mp)
 {
-    int i;
+    size_t i;
     char *list;
 
-    for (i = 0; mp->msgattrs[i]; i++) {
-       list = seq_list (mp, mp->msgattrs[i]);
-       printf ("%s%s: %s\n", mp->msgattrs[i],
-           is_seq_private (mp, i) ? " (private)" : "", empty(list));
+    for (i = 0; i < svector_size (mp->msgattrs); i++) {
+       list = seq_list (mp, svector_at (mp->msgattrs, i));
+       printf ("%s%s: %s\n", svector_at (mp->msgattrs, i),
+           is_seq_private (mp, i) ? " (private)" : "", FENDNULL(list));
     }
 }
 
@@ -46,5 +43,5 @@ seq_print (struct msgs *mp, char *seqname)
     list = seq_list (mp, seqname);
 
     printf ("%s%s: %s\n", seqname,
-       (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", empty(list));
+       (i == -1) ? "" : is_seq_private(mp, i) ? " (private)" : "", FENDNULL(list));
 }