X-Git-Url: http://git.marmaro.de/?p=mmh;a=blobdiff_plain;f=sbr%2Fm_convert.c;h=cd18406465f029fb8f480f5663eec73c5205ca89;hp=ee9ba5b975af659c134c0bb07444251fecb5950e;hb=ced6090a330d3d83d0bce709f756aa3d7d65fea4;hpb=a485ed478abbd599d8c9aab48934e7a26733ecb1 diff --git a/sbr/m_convert.c b/sbr/m_convert.c index ee9ba5b..cd18406 100644 --- a/sbr/m_convert.c +++ b/sbr/m_convert.c @@ -1,17 +1,17 @@ /* - * m_convert.c -- parse a message range or sequence and set SELECTED - * - * 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. - */ +** m_convert.c -- parse a message range or sequence and set SELECTED +** +** 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 /* - * error codes for sequence - * and message range processing - */ +** error codes for sequence +** and message range processing +*/ #define BADMSG (-2) #define BADRNG (-3) #define BADNEW (-4) @@ -27,8 +27,8 @@ static int convdir; /* convert direction */ static char *delimp; /* - * static prototypes - */ +** static prototypes +*/ static int m_conv (struct msgs *, char *, int); static int attr (struct msgs *, char *); @@ -50,15 +50,15 @@ m_convert (struct msgs *mp, char *name) else if (err > 0) return 1; /* - * else err == 0, so continue - */ + ** else err == 0, so continue + */ found = 0; /* - * Check for special "new" sequence, which - * is valid only if ALLOW_NEW is set. - */ + ** Check for special "new" sequence, which + ** is valid only if ALLOW_NEW is set. + */ if ((mp->msgflags & ALLOW_NEW) && !strcmp (cp, "new")) { if ((err = first = getnew (mp)) <= 0) goto badmsg; @@ -75,7 +75,8 @@ m_convert (struct msgs *mp, char *name) cp = delimp; if (*cp != '\0' && *cp != '-' && *cp != ':') { badelim: - advise (NULL, "illegal argument delimiter: `%c'(0%o)", *delimp, *delimp); + advise (NULL, "illegal argument delimiter: `%c'(0%o)", + *delimp, *delimp); return 0; } @@ -93,7 +94,8 @@ badmsg: break; case BADRNG: - advise (NULL, "message %s out of range 1-%d", cp, mp->hghmsg); + advise (NULL, "message %s out of range 1-%d", + cp, mp->hghmsg); break; case BADLST: @@ -102,7 +104,8 @@ badlist: break; case BADNEW: - advise (NULL, "folder full, no %s message", name); + advise (NULL, "folder full, no %s message", + name); break; default: @@ -170,12 +173,12 @@ rangerr: single: /* - * Single Message - * - * If ALLOW_NEW is set, then allow selecting of an - * empty slot. If ALLOW_NEW is not set, then we - * check if message is in-range and exists. - */ + ** Single Message + ** + ** If ALLOW_NEW is set, then allow selecting of an + ** empty slot. If ALLOW_NEW is not set, then we + ** check if message is in-range and exists. + */ if (mp->msgflags & ALLOW_NEW) { set_select_empty (mp, first); } else { @@ -193,10 +196,10 @@ single: } /* - * Cycle through the range and select the messages - * that exist. If ALLOW_NEW is set, then we also check - * if we are selecting an empty slot. - */ + ** Cycle through the range and select the messages + ** that exist. If ALLOW_NEW is set, then we also check + ** if we are selecting an empty slot. + */ for (; first <= last; first++) { if (does_exist (mp, first) || ((mp->msgflags & ALLOW_NEW) && is_select_empty (mp, first))) { @@ -219,17 +222,17 @@ single: } /* - * Convert the various message names to - * their numeric values. - * - * n (integer) - * prev - * next - * first - * last - * cur - * . (same as cur) - */ +** Convert the various message names to +** their numeric values. +** +** n (integer) +** prev +** next +** first +** last +** cur +** . (same as cur) +*/ static int m_conv (struct msgs *mp, char *str, int call) @@ -305,18 +308,18 @@ m_conv (struct msgs *mp, char *str, int call) } /* - * Handle user defined sequences. - * They can take the following forms: - * - * seq - * seq:prev - * seq:next - * seq:first - * seq:last - * seq:+n - * seq:-n - * seq:n - */ +** Handle user defined sequences. +** They can take the following forms: +** +** seq +** seq:prev +** seq:next +** seq:first +** seq:last +** seq:+n +** seq:-n +** seq:n +*/ static int attr (struct msgs *mp, char *cp) @@ -351,11 +354,11 @@ attr (struct msgs *mp, char *cp) range = 1; /* - * seq:prev (or) - * seq:next (or) - * seq:first (or) - * seq:last - */ + ** seq:prev (or) + ** seq:next (or) + ** seq:first (or) + ** seq:last + */ if (isalpha (*dp)) { if (!strcmp (dp, "prev")) { convdir = -1; @@ -373,10 +376,10 @@ attr (struct msgs *mp, char *cp) return BADLST; } else { /* - * seq:n (or) - * seq:+n (or) - * seq:-n - */ + ** seq:n (or) + ** seq:+n (or) + ** seq:-n + */ if (*dp == '+') dp++; else if (*dp == '-') { @@ -418,9 +421,9 @@ attr (struct msgs *mp, char *cp) found++; /* - * If we have a range, then break out - * once we've found enough. - */ + ** If we have a range, then break out + ** once we've found enough. + */ if (range && found >= range) break; }