3 * seq_nameok.c -- check if a sequence name is ok
7 * This code is Copyright (c) 2002, by the authors of nmh. See the
8 * COPYRIGHT file in the root directory of the nmh distribution for
9 * complete copyright information.
20 if (s == NULL || *s == '\0') {
21 advise (NULL, "empty sequence name");
26 * Make sure sequence name doesn't clash with one
27 * of the `reserved' sequence names.
29 if (!(strcmp (s, "new") &&
31 strcmp (s, "first") &&
34 strcmp (s, "next"))) {
35 advise (NULL, "illegal sequence name: %s", s);
40 * First character in a sequence name must be
41 * an alphabetic character ...
44 advise (NULL, "illegal sequence name: %s", s);
49 * and can be followed by zero or more alphanumeric characters
51 for (pp = s + 1; *pp; pp++)
53 advise (NULL, "illegal sequence name: %s", s);