]>
diplodocus.org Git - nmh/blob - sbr/seq_nameok.c
72b37fe1fdaf37043d9b432440d3e0a643642423
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.
17 if (s
== NULL
|| *s
== '\0') {
18 inform("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 inform("illegal sequence name: %s", s
);
37 * First character in a sequence name must be
38 * an alphabetic character ...
40 if (!isalpha ((unsigned char) *s
)) {
41 inform("illegal sequence name: %s", s
);
46 * and can be followed by zero or more alphanumeric characters
48 for (pp
= s
+ 1; *pp
; pp
++)
49 if (!isalnum ((unsigned char) *pp
)) {
50 inform("illegal sequence name: %s", s
);