Beispiel #1
0
InputPlugin * getInputPluginFromMimeType(char * mimeType) {
	ListNode * node = inputPlugin_list->firstNode;
	InputPlugin * plugin = NULL;

	if(mimeType == NULL) return NULL;

	while(node != NULL) {
		plugin = node->data;
		if(stringFoundInStringArray(plugin->mimeTypes, mimeType)) {
			return plugin;
		}
		node = node->nextNode;
	}

	return NULL;
}
Beispiel #2
0
InputPlugin * getInputPluginFromSuffix(char * suffix) {
	ListNode * node = inputPlugin_list->firstNode;
	InputPlugin * plugin = NULL;

	if(suffix == NULL) return NULL;

	while(node != NULL) {
		plugin = node->data;
		if(stringFoundInStringArray(plugin->suffixes, suffix)) {
			return plugin;
		}
		node = node->nextNode;
	}

	return NULL;
}
Beispiel #3
0
const struct decoder_plugin *
decoder_plugin_from_mime_type(const char *mimeType, unsigned int next)
{
	static unsigned i = num_decoder_plugins;

	if (mimeType == NULL)
		return NULL;

	if (!next)
		i = 0;
	for (; i < num_decoder_plugins; ++i) {
		const struct decoder_plugin *plugin = decoder_plugins[i];
		if (decoder_plugins_enabled[i] &&
		    stringFoundInStringArray(plugin->mime_types, mimeType)) {
			++i;
			return plugin;
		}
	}

	return NULL;
}
Beispiel #4
0
const struct decoder_plugin *
decoder_plugin_from_suffix(const char *suffix, unsigned int next)
{
	static unsigned i = num_decoder_plugins;

	if (suffix == NULL)
		return NULL;

	if (!next)
		i = 0;
	for (; i < num_decoder_plugins; ++i) {
		const struct decoder_plugin *plugin = decoder_plugins[i];
		if (decoder_plugins_enabled[i] &&
		    stringFoundInStringArray(plugin->suffixes, suffix)) {
			++i;
			return plugin;
		}
	}

	return NULL;
}