home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
cproto.zip
/
cproto46
/
symbol.h
< prev
next >
Wrap
C/C++ Source or Header
|
1994-10-12
|
939b
|
33 lines
/* $Id: symbol.h,v 4.1 1994/10/12 14:12:48 cthuang Exp $
*
* A symbol table is a collection of string identifiers stored in a
* hash table.
*/
#ifndef SYMBOL_H
#define SYMBOL_H
typedef struct symbol {
struct symbol *next; /* next symbol in list */
char *name; /* name of symbol */
char *value; /* value of symbol (for defines) */
short flags; /* symbol attributes */
} Symbol;
/* The hash table length should be a prime number. */
#define SYM_MAX_HASH 251
typedef struct symbol_table {
Symbol *bucket[SYM_MAX_HASH]; /* hash buckets */
} SymbolTable;
extern SymbolTable *new_symbol_table /* Create symbol table */
ARGS((void));
extern void free_symbol_table /* Destroy symbol table */
ARGS((SymbolTable *s));
extern Symbol *find_symbol /* Lookup symbol name */
ARGS((SymbolTable *s, char *n));
extern Symbol *new_symbol /* Define new symbol */
ARGS((SymbolTable *s, char *n, char *v, int f));
#endif