home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
vol_300
/
310_02
/
symbol.h
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-20
|
841b
|
35 lines
/*
Little Smalltalk string and symbol definitions
*/
/*
for symbols y_size = SYMBOLSIZE
only one text copy of each symbol is kept.
A global symbol table is searched each time a new symbol is
created, and symbols with the same character representation are
given the same entry.
*/
struct symbol_struct {
int y_ref_count;
int y_size;
char *y_value;
} ;
typedef struct symbol_struct symbol;
extern symbol *sy_search(); /* binary search for a symbol */
extern char *w_search(); /* binary search for a word */
# define symbol_value(x) (((symbol *) x)->y_value)
# define new_sym(val) ((object *) sy_search(val, 1))
# define SYMTABMAX 500
/* SYMINITSIZE symbol entries are allocated at the start of execution,
which prevents malloc from being called too many times */
# define SYMINITSIZE 60