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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user