3 * seq_nameok.c -- check if a sequence name is ok
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
14 seq_nameok (unsigned char *s)
18 if (s == NULL || *s == '\0') {
19 advise (NULL, "empty sequence name");
24 * Make sure sequence name doesn't clash with one
25 * of the `reserved' sequence names.
27 if (!(strcmp (s, "new") &&
29 strcmp (s, "first") &&
32 strcmp (s, "next"))) {
33 advise (NULL, "illegal sequence name: %s", s);
38 * First character in a sequence name must be
39 * an alphabetic character ...
42 advise (NULL, "illegal sequence name: %s", s);
47 * and can be followed by zero or more alphanumeric characters
49 for (pp = s + 1; *pp; pp++)
51 advise (NULL, "illegal sequence name: %s", s);