Move the ValidSegName function into common (segdefs)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1669 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
34f42ce630
commit
cf2162f5da
4 changed files with 3 additions and 26 deletions
|
@ -44,6 +44,7 @@
|
||||||
#include "cmdline.h"
|
#include "cmdline.h"
|
||||||
#include "fname.h"
|
#include "fname.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
|
#include "segdefs.h"
|
||||||
#include "target.h"
|
#include "target.h"
|
||||||
#include "tgttrans.h"
|
#include "tgttrans.h"
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
/* common */
|
/* common */
|
||||||
|
#include "segdefs.h"
|
||||||
#include "tgttrans.h"
|
#include "tgttrans.h"
|
||||||
|
|
||||||
/* cc65 */
|
/* cc65 */
|
||||||
|
@ -47,7 +48,6 @@
|
||||||
#include "litpool.h"
|
#include "litpool.h"
|
||||||
#include "scanner.h"
|
#include "scanner.h"
|
||||||
#include "scanstrbuf.h"
|
#include "scanstrbuf.h"
|
||||||
#include "segments.h"
|
|
||||||
#include "symtab.h"
|
#include "symtab.h"
|
||||||
#include "pragma.h"
|
#include "pragma.h"
|
||||||
|
|
||||||
|
|
|
@ -103,27 +103,6 @@ void NewSegName (segment_t Seg, const char* Name)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static Segments* NewSegments (SymEntry* Func)
|
static Segments* NewSegments (SymEntry* Func)
|
||||||
/* Initialize a Segments structure (set all fields to NULL) */
|
/* Initialize a Segments structure (set all fields to NULL) */
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* */
|
/* */
|
||||||
/* (C) 2000-2001 Ullrich von Bassewitz */
|
/* (C) 2000-2002 Ullrich von Bassewitz */
|
||||||
/* Wacholderweg 14 */
|
/* Wacholderweg 14 */
|
||||||
/* D-70597 Stuttgart */
|
/* D-70597 Stuttgart */
|
||||||
/* EMail: uz@cc65.org */
|
/* EMail: uz@cc65.org */
|
||||||
|
@ -108,9 +108,6 @@ void InitSegNames (void);
|
||||||
void NewSegName (segment_t Seg, const char* Name);
|
void NewSegName (segment_t Seg, const char* Name);
|
||||||
/* Set a new name for a segment */
|
/* Set a new name for a segment */
|
||||||
|
|
||||||
int ValidSegName (const char* Name);
|
|
||||||
/* Return true if the given segment name is valid, return false otherwise */
|
|
||||||
|
|
||||||
Segments* PushSegments (struct SymEntry* Func);
|
Segments* PushSegments (struct SymEntry* Func);
|
||||||
/* Make the new segment list current but remember the old one */
|
/* Make the new segment list current but remember the old one */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue