symboltable.c
/* return a new symbol table with all the symbols with a name matching the pattern */
return a new symbol table with all the symbols with a name matching the pattern
return a new symbol table with all the symbols with a name matching the pattern
symbol_table collect_matching(symbol_table st, const char *pattern)
{
	rexp_info *info = create_pattern(pattern);
	symbol_table result = init_symbol_table();
	symbol_table_internal *symbol_table_p = reveal(st);
	int num_entries = symbol_table_p->num_entries;
	int i;
	for (i=0; i<num_entries; i++)
	{
		if (execute_pattern(info, symbol_table_p->sym[i].name) == 0)
		{
			set_string_value(result, symbol_table_p->sym[i].name, symbol_table_p->sym[i].value);
		}
	}
    release_pattern(info);
	return result;	
}
symbol_table collect_matching ( symbol_table st , const char * pattern ) { rexp_info * info = create_pattern ( pattern ) ; symbol_table result = init_symbol_table ( ) ; symbol_table_internal * symbol_table_p = reveal ( st ) ; int num_entries = symbol_table_p -> num_entries ; int i ; for ( i = 0 ; i < num_entries ; i ++ ) { if ( execute_pattern ( info , symbol_table_p -> sym [ i ] . name ) == 0 ) { set_string_value ( result , symbol_table_p -> sym [ i ] . name , symbol_table_p -> sym [ i ] . value ) ; } } release_pattern ( info ) ; return result ; }
return a new symbol table with all the symbols with a name matching the pattern
return a new symbol table with all the symbols with a name matching the pattern
/*fprintf(stderr, "attempting to find symbols matching %s\n", pattern);*/