diff options
-rw-r--r-- | flexdef.h | 30 | ||||
-rw-r--r-- | sym.c | 37 |
2 files changed, 28 insertions, 39 deletions
@@ -314,30 +314,6 @@ /* Declarations for global variables. */ -/* Variables for symbol tables: - * sctbl - start-condition symbol table - * ndtbl - name-definition symbol table - * ccltab - character class text symbol table - */ - -struct hash_entry - { - struct hash_entry *prev, *next; - char *name; - char *str_val; - int int_val; - } ; - -typedef struct hash_entry **hash_table; - -#define NAME_TABLE_HASH_SIZE 101 -#define START_COND_HASH_SIZE 101 -#define CCL_HASH_SIZE 101 - -extern struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE]; -extern struct hash_entry *sctbl[START_COND_HASH_SIZE]; -extern struct hash_entry *ccltab[CCL_HASH_SIZE]; - /* Variables for flags: * printstats - if true (-v), dump statistics @@ -995,18 +971,12 @@ extern int yywrap PROTO((void)); /* from file sym.c */ -/* Add symbol and definitions to symbol table. */ -extern int addsym PROTO((register char[], char*, int, hash_table, int)); - /* Save the text of a character class. */ extern void cclinstal PROTO ((Char [], int)); /* Lookup the number associated with character class. */ extern int ccllookup PROTO((Char [])); -/* Find symbol in symbol table. */ -extern struct hash_entry *findsym PROTO((register char[], hash_table, int )); - extern void ndinstal PROTO((char[], Char[])); /* install a name definition */ extern Char *ndlookup PROTO((char[])); /* lookup a name definition */ @@ -30,17 +30,36 @@ #include "flexdef.h" +/* Variables for symbol tables: + * sctbl - start-condition symbol table + * ndtbl - name-definition symbol table + * ccltab - character class text symbol table + */ -/* declare functions that have forward references */ +struct hash_entry + { + struct hash_entry *prev, *next; + char *name; + char *str_val; + int int_val; + } ; -int hashfunct PROTO((register char[], int)); +typedef struct hash_entry **hash_table; +#define NAME_TABLE_HASH_SIZE 101 +#define START_COND_HASH_SIZE 101 +#define CCL_HASH_SIZE 101 -struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE]; -struct hash_entry *sctbl[START_COND_HASH_SIZE]; -struct hash_entry *ccltab[CCL_HASH_SIZE]; +static struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE]; +static struct hash_entry *sctbl[START_COND_HASH_SIZE]; +static struct hash_entry *ccltab[CCL_HASH_SIZE]; + + +/* declare functions that have forward references */ -struct hash_entry *findsym(); +static int addsym PROTO((register char[], char*, int, hash_table, int)); +static struct hash_entry *findsym(); +static int hashfunct PROTO((register char[], int)); /* addsym - add symbol and definitions to symbol table @@ -48,7 +67,7 @@ struct hash_entry *findsym(); * -1 is returned if the symbol already exists, and the change not made. */ -int addsym( sym, str_def, int_def, table, table_size ) +static int addsym( sym, str_def, int_def, table, table_size ) register char sym[]; char *str_def; int int_def; @@ -127,7 +146,7 @@ Char ccltxt[]; /* findsym - find symbol in symbol table */ -struct hash_entry *findsym( sym, table, table_size ) +static struct hash_entry *findsym( sym, table, table_size ) register char sym[]; hash_table table; int table_size; @@ -153,7 +172,7 @@ int table_size; /* hashfunct - compute the hash value for "str" and hash size "hash_size" */ -int hashfunct( str, hash_size ) +static int hashfunct( str, hash_size ) register char str[]; int hash_size; { |