aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cmdline.c6
-rw-r--r--src/decoder_list.c31
-rw-r--r--src/decoder_list.h2
3 files changed, 11 insertions, 28 deletions
diff --git a/src/cmdline.c b/src/cmdline.c
index d4d96cf52..3941a143b 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -47,13 +47,9 @@ static void version(void)
"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"
"\n"
- "Supported formats:\n");
+ "Supported decoders:\n");
decoder_plugin_init_all();
- decoder_plugin_print_all_suffixes(stdout);
-
- puts("\n"
- "Supported decoders:\n");
decoder_plugin_print_all_decoders(stdout);
puts("\n"
diff --git a/src/decoder_list.c b/src/decoder_list.c
index 9ed5fc560..4cf373a03 100644
--- a/src/decoder_list.c
+++ b/src/decoder_list.c
@@ -154,36 +154,25 @@ decoder_plugin_from_name(const char *name)
return NULL;
}
-void decoder_plugin_print_all_suffixes(FILE * fp)
+void decoder_plugin_print_all_decoders(FILE * fp)
{
- const char *const*suffixes;
-
for (unsigned i = 0; i < num_decoder_plugins; ++i) {
const struct decoder_plugin *plugin = decoder_plugins[i];
+ const char *const*suffixes;
+
if (!decoder_plugins_enabled[i])
continue;
- suffixes = plugin->suffixes;
- while (suffixes && *suffixes) {
- fprintf(fp, "%s ", *suffixes);
- suffixes++;
- }
- }
- fprintf(fp, "\n");
- fflush(fp);
-}
+ fprintf(fp, "[%s]", plugin->name);
-void decoder_plugin_print_all_decoders(FILE * fp)
-{
- for (unsigned i = 0; i < num_decoder_plugins; ++i) {
- const struct decoder_plugin *plugin = decoder_plugins[i];
- if (!decoder_plugins_enabled[i])
- continue;
+ for (suffixes = plugin->suffixes;
+ suffixes != NULL && *suffixes != NULL;
+ ++suffixes) {
+ fprintf(fp, " %s", *suffixes);
+ }
- fprintf(fp, "%s ", plugin->name);
+ fprintf(fp, "\n");
}
- fprintf(fp, "\n");
- fflush(fp);
}
/**
diff --git a/src/decoder_list.h b/src/decoder_list.h
index bde6b3806..ed032a1ca 100644
--- a/src/decoder_list.h
+++ b/src/decoder_list.h
@@ -34,8 +34,6 @@ decoder_plugin_from_mime_type(const char *mimeType, unsigned int next);
const struct decoder_plugin *
decoder_plugin_from_name(const char *name);
-void decoder_plugin_print_all_suffixes(FILE * fp);
-
void decoder_plugin_print_all_decoders(FILE * fp);
/* this is where we "load" all the "plugins" ;-) */