9 date 92.12.15.00.20.22; author jromine; state Exp;
14 date 91.02.14.14.44.38; author mh; state Exp;
19 date 90.04.05.15.30.40; author sources; state Exp;
24 date 90.04.05.14.44.39; author sources; state Exp;
29 date 90.02.21.16.36.08; author sources; state Exp;
34 date 90.02.21.16.35.38; author sources; state Exp;
39 date 90.02.01.14.07.31; author sources; state Exp;
44 date 90.02.01.14.04.09; author sources; state Exp;
58 @/* m_seq.c - print out a message sequence */
60 static char ident[] = "@@(#)$Id: m_seq.c,v 1.7 1991/02/14 14:44:38 mh Exp jromine $";
66 /* new version from VJ 2/90 - faster? */
76 static char buffer[BUFSIZ*2]; /* for big sequences */
78 if (strcmp (current, cp) == 0) {
79 /* assume this is in sync with msgstats["cur"] */
80 /* see m_seqadd() for details */
82 (void) sprintf(buffer, "%s", m_name(mp->curmsg));
87 for (i = 0; mp->msgattrs[i]; i++)
88 if (strcmp(mp->msgattrs[i], cp) == 0)
91 if (! mp->msgattrs[i])
94 mask = EXISTS | (1 << (FFATTRSLOT + i));
96 for (i = mp->lowmsg; i <= mp->hghmsg; ++i) {
97 if ((mp->msgstats[i] & mask) != mask)
103 (void) sprintf(bp, "%s", m_name(i));
106 for (++i; i <= mp->hghmsg && (mp->msgstats[i] & mask) == mask;
110 (void) sprintf(bp, "-%s", m_name(i - 1));
114 return (bp > buffer? buffer : NULL);
121 @comment unclear code
127 static char ident[] = "@@(#)$Id: m_seq.c,v 1.6 90/04/05 15:30:40 sources Exp Locker: mh $";
139 static char ident[] = "@@(#)$Id:$";
142 if (strcmp(current, cp) == 0) {
144 (void) sprintf(buffer, "%s", m_name(mp->curmsg));
158 static char ident[] = "$Id:";
173 @Fixes from Van Jacobson
178 static char buffer[BUFSIZ];
184 @increase message sequence buffer size by factor of 2. I hope this
185 is worth it, since it'll make things bigger.
203 static char buffer[BUFSIZ * 2];
207 hack = strcmp (current, cp) == 0;
208 for (i = 0; mp -> msgattrs[i]; i++)
209 if (strcmp (mp -> msgattrs[i], cp) == 0) {
212 for (j = mp -> lowmsg; j <= mp -> hghmsg; j++)
213 if ((mp -> msgstats[j] & EXISTS)
214 && (mp -> msgstats[j] & (1 << (bits + i)))) {
215 (void) sprintf (bp, "%s%s", found ? " " : "", m_name (j));
217 for (k = j + 1; k <= mp -> hghmsg
218 && (mp -> msgstats[k] & EXISTS)
219 && (mp -> msgstats[k] & (1 << (bits + i)));
224 (void) sprintf (bp, "-%s", m_name (k));
230 if (found == 0 && hack && mp -> curmsg) {
232 (void) sprintf (buffer, "%s", m_name (mp -> curmsg));
234 return (found > 0 ? buffer : NULL);
249 static char buffer[BUFSIZ];