]> diplodocus.org Git - nmh/blob - sbr/seq_getnum.c
mhbuildsbr.c: Flip logic, moving goto to then-block; no need for else.
[nmh] / sbr / seq_getnum.c
1 /* seq_getnum.c -- find the index for a sequence
2 * -- return -1 if sequence doesn't exist
3 *
4 * This code is Copyright (c) 2002, by the authors of nmh. See the
5 * COPYRIGHT file in the root directory of the nmh distribution for
6 * complete copyright information.
7 */
8
9 #include <h/mh.h>
10
11
12 int
13 seq_getnum (struct msgs *mp, char *seqname)
14 {
15 size_t i;
16
17 for (i = 0; i < svector_size (mp->msgattrs); i++)
18 if (!strcmp (svector_at (mp->msgattrs, i), seqname))
19 return i;
20
21 return -1;
22 }