Move ValidSegName into segnames.c

git-svn-id: svn://svn.cc65.org/cc65/trunk@1940 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2003-02-08 09:53:44 +00:00
parent b9e04d5242
commit 07cb34ba61
6 changed files with 77 additions and 27 deletions

View File

@@ -33,10 +33,7 @@
#include <string.h>
/* common */
#include "chartype.h"
#include "xmalloc.h"
#include "segdefs.h"
@@ -83,24 +80,3 @@ SegDef* DupSegDef (const SegDef* Def)
int ValidSegName (const char* Name)
/* Return true if the given segment name is valid, return false otherwise */
{
/* Must start with '_' or a letter */
if ((*Name != '_' && !IsAlpha(*Name)) || strlen(Name) > 80) {
return 0;
}
/* Can have letters, digits or the underline */
while (*++Name) {
if (*Name != '_' && !IsAlNum(*Name)) {
return 0;
}
}
/* Name is ok */
return 1;
}