home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Interactive Guide
/
c-cplusplus-interactive-guide.iso
/
c_ref
/
csource4
/
231_01
/
symbol.h
< prev
next >
Wrap
Text File
|
1987-06-17
|
896b
|
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