diff sbr/m_setseq.c @ 0:bce86c4163a3

Initial revision
author kono
date Mon, 18 Apr 2005 23:46:02 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sbr/m_setseq.c	Mon Apr 18 23:46:02 2005 +0900
@@ -0,0 +1,32 @@
+/* m_setseq.c - set the previous-sequence */
+
+#include "../h/mh.h"
+#include <stdio.h>
+
+
+void m_setseq (mp)
+register struct msgs *mp;
+{
+    register int    msgnum;
+    register char  *cp,
+                   *dp,
+                  **ap;
+
+    dp = NULL;
+    if ((cp = m_find (psequence)) == NULL
+	    || (ap = brkstring (dp = getcpy (cp), " ", "\n")) == NULL
+	    || *ap == NULL) {
+	if (dp)
+	    free (dp);
+	return;
+    }
+
+    for (; *ap; ap++)
+	if (m_seqnew (mp, *ap, -1))
+	    for (msgnum = mp -> lowsel; msgnum <= mp -> hghsel; msgnum++)
+		if (mp -> msgstats[msgnum] & SELECTED)
+		    (void) m_seqadd (mp, *ap, msgnum, -1);
+
+    if (dp)
+	free (dp);
+}