2 * seq_nameok.c -- check if a sequence name is ok
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.
13 seq_nameok (unsigned char *s)
17 if (s == NULL || *s == '\0') {
18 advise (NULL, "empty sequence name");
23 * Make sure sequence name doesn't clash with one
24 * of the `reserved' sequence names.
26 if (!(strcmp (s, "new") &&
28 strcmp (s, "first") &&
31 strcmp (s, "next"))) {
32 advise (NULL, "illegal sequence name: %s", s);
37 * First character in a sequence name must be
38 * an alphabetic character ...
41 advise (NULL, "illegal sequence name: %s", s);
46 * and can be followed by zero or more alphanumeric characters
48 for (pp = s + 1; *pp; pp++)
50 advise (NULL, "illegal sequence name: %s", s);