| iMatix home page | << | < | > | >> |
![]() Version 1.91 |
#include "sflsymb.h" SYMTAB * sym_create_table (void)
Creates a new symbol table. Returns a SYMTAB pointer which you must use in all future references to the symbol table. The symbol table is maintained in memory until the program ends or you use sym delete table() to delete it. Returns null if there was not enough memory to create the symbol table.
{ SYMTAB *table; /* Pointer to created table */ int hash_index; /* Index into hash bucket */ table = mem_alloc (sizeof (SYMTAB)); if (table) { table-> symbols = NULL; /* No symbols attached yet */ table-> size = 0; for (hash_index = 0; hash_index < SYM_HASH_SIZE; hash_index++) table-> hash [hash_index] = NULL; } return (table); }
| << | < | > | >> |
![]() |