Exemplo n.º 1
0
void
plugin_remove (	KTPluginInfoEntry	*plugin,
		KTPluginInfoList	*plugin_list  )
/*
Input:
	plugin		- The plugin to remove the entry of from plugin_list
Output:
	plugin		- The memory pointed to by this pointer will be freed
	plugin_list	- The list where the plugin's entry was removed from
Returns:
	-
Description:
	This function removes 'plugin' in from 'plugin_list'. If the plugin pointed
	to by 'plugin' does not appear in 'plugin_list' then the nothing will be
	done by this function.
*/
{
	KTPluginInfoEntry *entry, *tmp_entry;
	
	if (plugin_list->head == NULL)
	{
		return;
	}
	if (plugin_list->head == plugin)
	{
		entry = plugin_list->head;
		plugin_list->head = entry->next;
		if (plugin_list->head == NULL)
		{
			plugin_list->tail = NULL;
		}
	}
	else
	{
		/* Find the entry before the entry that contains the plugin */
		for (entry = plugin_list->head;
		     entry->next != NULL && entry->next != plugin;
		     entry = entry->next)
			; /* NULL Statement */
		
		if (entry->next == NULL)
		{
			return;
		}
		/* If the entry is the last one in the list */
		if (entry->next->next == NULL)
		{
			plugin_list->tail = entry;
			entry = entry->next;
			plugin_list->tail->next = NULL;
		}
		else
		{
			tmp_entry = entry;
			entry = entry->next;
			tmp_entry->next = entry->next;
		}
	}
	free_plugin (entry);
}
Exemplo n.º 2
0
static	void	free_plugins()
{
	int i;
	for( i = 0; i < index_ ; i ++ )
		free_plugin( index_map_[i]);

	vpf( illegal_plugins_ );
	freeframe_destroy();
	frei0r_destroy();

	free( index_map_ );
	index_ = 0;
	index_map_ = NULL;
}
Exemplo n.º 3
0
void
clear_plugin_list (KTPluginInfoList *plugin_list)
/*
Input:
	-
Output:
	plugin_list	- Initialized empty plugin list.
Returns:
	-
Description:
	This function initializes plugin_list to be empty.
*/
{
	KTPluginInfoEntry *plugin;
	
	for (plugin = plugin_list->head; plugin; plugin = plugin->next)
	{
		free_plugin (plugin);
	}
	plugin_list->head = plugin_list->tail = NULL;
}