symboltable.c
/* returns the address of the symbol if found, otherwise, 
  the address of the end of the table 
 */
returns the address of the symbol if found, otherwise,
the address of the end of the table
returns the address of the symbol if found otherwise the address of the end of the table
static int find_symbol_address(symbol_table st, const char *name)
{
	symbol_table_internal *symbol_table_p = reveal(st);
	int num_entries = symbol_table_p->num_entries;
	int i;
	symbol_table_p->found_key = 0;
	for (i=0; i<num_entries; i++)
	{
		if (strcmp(symbol_table_p->sym[i].name, name) == 0)
		{
			symbol_table_p->found_key = 1;
			return i;
		}
	}
	return num_entries;
}
static int find_symbol_address ( symbol_table st , const char * name ) { symbol_table_internal * symbol_table_p = reveal ( st ) ; int num_entries = symbol_table_p -> num_entries ; int i ; symbol_table_p -> found_key = 0 ; for ( i = 0 ; i < num_entries ; i ++ ) { if ( strcmp ( symbol_table_p -> sym [ i ] . name , name ) == 0 ) { symbol_table_p -> found_key = 1 ; return i ; } } return num_entries ; }
returns the address of the symbol if found, otherwise,
the address of the end of the table
returns the address of the symbol if found otherwise the address of the end of the table