| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
#include "sflsymb.h" SYMTAB * sym_create_table_ ( const char *filename, /* Name of source file making call */ size_t lineno) /* Line number in calling source */
Creates a new symbol table. Use the sym_create_table macro to call this function! 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 */ /* Allocate by going directly to mem_alloc_ function */ table = mem alloc (NULL, sizeof (SYMTAB), filename, lineno); 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); }
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |