aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-06-12 22:29:04 +0200
committerMax Kellermann <max@duempel.org>2012-06-12 22:29:04 +0200
commitae70875f45c6d7f1bb0f703179035709d909978a (patch)
tree98319b849a72c32b4cdddcee42e070ed6a085c54
parenteda7410f4c87e29e0c77950963a7b9ccf7069097 (diff)
downloadmpd-ae70875f45c6d7f1bb0f703179035709d909978a.tar.gz
mpd-ae70875f45c6d7f1bb0f703179035709d909978a.tar.xz
mpd-ae70875f45c6d7f1bb0f703179035709d909978a.zip
cmdline: consistent plugin listings
-rw-r--r--NEWS1
-rw-r--r--src/archive_list.c13
-rw-r--r--src/archive_list.h4
-rw-r--r--src/cmdline.c62
-rw-r--r--src/encoder_list.c10
-rw-r--r--src/encoder_list.h5
-rw-r--r--src/ls.c4
-rw-r--r--src/output_list.c9
-rw-r--r--src/output_list.h4
9 files changed, 37 insertions, 75 deletions
diff --git a/NEWS b/NEWS
index 091548700..60ea902ef 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,7 @@
ver 0.16.9 (2012/??/??)
* decoder:
- ffmpeg: support WebM
+* improve --version output
* WIN32: fix renaming of stored playlists with non-ASCII names
diff --git a/src/archive_list.c b/src/archive_list.c
index 39eaf4d69..6c1079c1a 100644
--- a/src/archive_list.c
+++ b/src/archive_list.c
@@ -72,19 +72,6 @@ archive_plugin_from_name(const char *name)
return NULL;
}
-void archive_plugin_print_all_suffixes(FILE * fp)
-{
- archive_plugins_for_each(plugin) {
- const char *const*suffixes = plugin->suffixes;
- while (suffixes && *suffixes) {
- fprintf(fp, "%s ", *suffixes);
- suffixes++;
- }
- }
- fprintf(fp, "\n");
- fflush(fp);
-}
-
void archive_plugin_init_all(void)
{
for (unsigned i = 0; archive_plugins[i] != NULL; ++i) {
diff --git a/src/archive_list.h b/src/archive_list.h
index ec2ccc1e1..2c03b0680 100644
--- a/src/archive_list.h
+++ b/src/archive_list.h
@@ -20,8 +20,6 @@
#ifndef MPD_ARCHIVE_LIST_H
#define MPD_ARCHIVE_LIST_H
-#include <stdio.h>
-
struct archive_plugin;
extern const struct archive_plugin *const archive_plugins[];
@@ -40,8 +38,6 @@ archive_plugin_from_suffix(const char *suffix);
const struct archive_plugin *
archive_plugin_from_name(const char *name);
-void archive_plugin_print_all_suffixes(FILE * fp);
-
/* this is where we "load" all the "plugins" ;-) */
void archive_plugin_init_all(void);
diff --git a/src/cmdline.c b/src/cmdline.c
index c93a34cc6..907b64c10 100644
--- a/src/cmdline.c
+++ b/src/cmdline.c
@@ -25,6 +25,7 @@
#include "decoder_list.h"
#include "decoder_plugin.h"
#include "output_list.h"
+#include "output_plugin.h"
#include "input_registry.h"
#include "input_plugin.h"
#include "playlist_list.h"
@@ -35,10 +36,12 @@
#ifdef ENABLE_ENCODER
#include "encoder_list.h"
+#include "encoder_plugin.h"
#endif
#ifdef ENABLE_ARCHIVE
#include "archive_list.h"
+#include "archive_plugin.h"
#endif
#include <glib.h>
@@ -59,24 +62,6 @@ cmdline_quark(void)
return g_quark_from_static_string("cmdline");
}
-static void
-print_all_decoders(FILE *fp)
-{
- decoder_plugins_for_each(plugin) {
- const char *const*suffixes;
-
- fprintf(fp, "[%s]", plugin->name);
-
- for (suffixes = plugin->suffixes;
- suffixes != NULL && *suffixes != NULL;
- ++suffixes) {
- fprintf(fp, " %s", *suffixes);
- }
-
- fprintf(fp, "\n");
- }
-}
-
G_GNUC_NORETURN
static void version(void)
{
@@ -87,25 +72,46 @@ 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"
- "* Decoders plugins:\n");
+ "Decoders plugins:");
- print_all_decoders(stdout);
+ decoder_plugins_for_each(plugin) {
+ printf(" [%s]", plugin->name);
+
+ const char *const*suffixes = plugin->suffixes;
+ if (suffixes != NULL)
+ for (; *suffixes != NULL; ++suffixes)
+ printf(" %s", *suffixes);
+
+ puts("");
+ }
puts("\n"
- "Output plugins:\n");
- audio_output_plugin_print_all_types(stdout);
+ "Output plugins:");
+ audio_output_plugins_for_each(plugin)
+ printf(" %s", plugin->name);
+ puts("");
#ifdef ENABLE_ENCODER
puts("\n"
- "Encoder plugins:\n");
- encoder_plugin_print_all_types(stdout);
+ "Encoder plugins:");
+ encoder_plugins_for_each(plugin)
+ printf(" %s", plugin->name);
+ puts("");
#endif
-
#ifdef ENABLE_ARCHIVE
puts("\n"
- "Archive plugins:\n");
- archive_plugin_print_all_suffixes(stdout);
+ "Archive plugins:");
+ archive_plugins_for_each(plugin) {
+ printf(" [%s]", plugin->name);
+
+ const char *const*suffixes = plugin->suffixes;
+ if (suffixes != NULL)
+ for (; *suffixes != NULL; ++suffixes)
+ printf(" %s", *suffixes);
+
+ puts("");
+ }
#endif
puts("\n"
@@ -119,7 +125,7 @@ static void version(void)
printf(" %s", plugin->name);
puts("\n\n"
- "Protocols:\n");
+ "Protocols:");
print_supported_uri_schemes_to_fp(stdout);
exit(EXIT_SUCCESS);
diff --git a/src/encoder_list.c b/src/encoder_list.c
index da1bec5ef..d7190f6dc 100644
--- a/src/encoder_list.c
+++ b/src/encoder_list.c
@@ -59,13 +59,3 @@ encoder_plugin_get(const char *name)
return NULL;
}
-
-void
-encoder_plugin_print_all_types(FILE * fp)
-{
- encoder_plugins_for_each(plugin)
- fprintf(fp, "%s ", plugin->name);
-
- fprintf(fp, "\n");
- fflush(fp);
-}
diff --git a/src/encoder_list.h b/src/encoder_list.h
index 4fe87e16c..4f77ce2c9 100644
--- a/src/encoder_list.h
+++ b/src/encoder_list.h
@@ -20,8 +20,6 @@
#ifndef MPD_ENCODER_LIST_H
#define MPD_ENCODER_LIST_H
-#include <stdio.h>
-
struct encoder_plugin;
extern const struct encoder_plugin *const encoder_plugins[];
@@ -42,7 +40,4 @@ extern const struct encoder_plugin *const encoder_plugins[];
const struct encoder_plugin *
encoder_plugin_get(const char *name);
-void
-encoder_plugin_print_all_types(FILE * fp);
-
#endif
diff --git a/src/ls.c b/src/ls.c
index c30765c62..0346dabfb 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -57,10 +57,10 @@ void print_supported_uri_schemes_to_fp(FILE *fp)
const char **prefixes = remoteUrlPrefixes;
#ifdef HAVE_UN
- fprintf(fp, "file:// ");
+ fprintf(fp, " file://");
#endif
while (*prefixes) {
- fprintf(fp, "%s ", *prefixes);
+ fprintf(fp, " %s", *prefixes);
prefixes++;
}
fprintf(fp,"\n");
diff --git a/src/output_list.c b/src/output_list.c
index bc7a6abd8..aac05c212 100644
--- a/src/output_list.c
+++ b/src/output_list.c
@@ -101,12 +101,3 @@ audio_output_plugin_get(const char *name)
return NULL;
}
-
-void audio_output_plugin_print_all_types(FILE * fp)
-{
- audio_output_plugins_for_each(plugin)
- fprintf(fp, "%s ", plugin->name);
-
- fprintf(fp, "\n");
- fflush(fp);
-}
diff --git a/src/output_list.h b/src/output_list.h
index 85497a6c6..855b90edf 100644
--- a/src/output_list.h
+++ b/src/output_list.h
@@ -20,15 +20,11 @@
#ifndef MPD_OUTPUT_LIST_H
#define MPD_OUTPUT_LIST_H
-#include <stdio.h>
-
extern const struct audio_output_plugin *const audio_output_plugins[];
const struct audio_output_plugin *
audio_output_plugin_get(const char *name);
-void audio_output_plugin_print_all_types(FILE * fp);
-
#define audio_output_plugins_for_each(plugin) \
for (const struct audio_output_plugin *plugin, \
*const*output_plugin_iterator = &audio_output_plugins[0]; \