예제 #1
0
int
show_fileviewers_menu(FileView *view, const char fname[])
{
	static menu_info m;

	assoc_records_t file_viewers;

	init_menu_info(&m, format_str("Viewers that match %s", fname),
			format_str("No viewers match %s", fname));

	file_viewers = ft_get_all_viewers(fname);
	fill_menu_from_records(&m, &file_viewers);
	ft_assoc_records_free(&file_viewers);

	return display_menu(&m, view);
}
예제 #2
0
int
show_fileprograms_menu(FileView *view, const char fname[])
{
	static menu_info m;

	assoc_records_t file_programs;

	init_menu_info(&m, FILEPROGRAMS_MENU,
			format_str("No programs match %s", fname));

	m.title = format_str(" Programs that match %s ", fname);

	file_programs = ft_get_all_programs(fname);
	fill_menu_from_records(&m, &file_programs);
	ft_assoc_records_free(&file_programs);

	return display_menu(&m, view);
}