decoder_list: print decoder list with suffixes
Print the list of suffixes supported by each decoder, instead of prining a list of all suffixes of all decoders with duplicates.
This commit is contained in:
parent
1bb0124b77
commit
5ea8a0df3f
@ -47,13 +47,9 @@ static void version(void)
|
|||||||
"This is free software; see the source for copying conditions. There is NO\n"
|
"This is free software; see the source for copying conditions. There is NO\n"
|
||||||
"warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
|
"warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Supported formats:\n");
|
"Supported decoders:\n");
|
||||||
|
|
||||||
decoder_plugin_init_all();
|
decoder_plugin_init_all();
|
||||||
decoder_plugin_print_all_suffixes(stdout);
|
|
||||||
|
|
||||||
puts("\n"
|
|
||||||
"Supported decoders:\n");
|
|
||||||
decoder_plugin_print_all_decoders(stdout);
|
decoder_plugin_print_all_decoders(stdout);
|
||||||
|
|
||||||
puts("\n"
|
puts("\n"
|
||||||
|
@ -154,36 +154,25 @@ decoder_plugin_from_name(const char *name)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void decoder_plugin_print_all_suffixes(FILE * fp)
|
|
||||||
{
|
|
||||||
const char *const*suffixes;
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < num_decoder_plugins; ++i) {
|
|
||||||
const struct decoder_plugin *plugin = decoder_plugins[i];
|
|
||||||
if (!decoder_plugins_enabled[i])
|
|
||||||
continue;
|
|
||||||
|
|
||||||
suffixes = plugin->suffixes;
|
|
||||||
while (suffixes && *suffixes) {
|
|
||||||
fprintf(fp, "%s ", *suffixes);
|
|
||||||
suffixes++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
fprintf(fp, "\n");
|
|
||||||
fflush(fp);
|
|
||||||
}
|
|
||||||
|
|
||||||
void decoder_plugin_print_all_decoders(FILE * fp)
|
void decoder_plugin_print_all_decoders(FILE * fp)
|
||||||
{
|
{
|
||||||
for (unsigned i = 0; i < num_decoder_plugins; ++i) {
|
for (unsigned i = 0; i < num_decoder_plugins; ++i) {
|
||||||
const struct decoder_plugin *plugin = decoder_plugins[i];
|
const struct decoder_plugin *plugin = decoder_plugins[i];
|
||||||
|
const char *const*suffixes;
|
||||||
|
|
||||||
if (!decoder_plugins_enabled[i])
|
if (!decoder_plugins_enabled[i])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
fprintf(fp, "%s ", plugin->name);
|
fprintf(fp, "[%s]", plugin->name);
|
||||||
|
|
||||||
|
for (suffixes = plugin->suffixes;
|
||||||
|
suffixes != NULL && *suffixes != NULL;
|
||||||
|
++suffixes) {
|
||||||
|
fprintf(fp, " %s", *suffixes);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(fp, "\n");
|
fprintf(fp, "\n");
|
||||||
fflush(fp);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,8 +34,6 @@ decoder_plugin_from_mime_type(const char *mimeType, unsigned int next);
|
|||||||
const struct decoder_plugin *
|
const struct decoder_plugin *
|
||||||
decoder_plugin_from_name(const char *name);
|
decoder_plugin_from_name(const char *name);
|
||||||
|
|
||||||
void decoder_plugin_print_all_suffixes(FILE * fp);
|
|
||||||
|
|
||||||
void decoder_plugin_print_all_decoders(FILE * fp);
|
void decoder_plugin_print_all_decoders(FILE * fp);
|
||||||
|
|
||||||
/* this is where we "load" all the "plugins" ;-) */
|
/* this is where we "load" all the "plugins" ;-) */
|
||||||
|
Loading…
Reference in New Issue
Block a user