]>
diplodocus.org Git - nmh/blob - sbr/seq_nameok.c
1 /* seq_nameok.c -- check if a sequence name is ok
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
16 if (s
== NULL
|| *s
== '\0') {
17 inform("empty sequence name");
22 * Make sure sequence name doesn't clash with one
23 * of the `reserved' sequence names.
25 if (!(strcmp (s
, "new") &&
27 strcmp (s
, "first") &&
30 strcmp (s
, "next"))) {
31 inform("illegal sequence name: %s", s
);
36 * First character in a sequence name must be
37 * an alphabetic character ...
39 if (!isalpha ((unsigned char) *s
)) {
40 inform("illegal sequence name: %s", s
);
45 * and can be followed by zero or more alphanumeric characters
47 for (pp
= s
+ 1; *pp
; pp
++)
48 if (!isalnum ((unsigned char) *pp
)) {
49 inform("illegal sequence name: %s", s
);