From decce92949d7a35f1e27804df45fa61568e69548 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 1 Jun 2004 04:29:34 +0000 Subject: nice output of all suffix types supported in version git-svn-id: https://svn.musicpd.org/mpd/trunk@1276 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputPlugin.c | 18 ++++++++++++++++++ src/inputPlugin.h | 2 ++ src/main.c | 32 +++++++++----------------------- 3 files changed, 29 insertions(+), 23 deletions(-) (limited to 'src') diff --git a/src/inputPlugin.c b/src/inputPlugin.c index 2ee0d9a8d..20b6eb14c 100644 --- a/src/inputPlugin.c +++ b/src/inputPlugin.c @@ -1,6 +1,7 @@ #include "inputPlugin.h" #include "list.h" +#include "myfprintf.h" #include #include @@ -72,6 +73,23 @@ InputPlugin * getInputPluginFromName(char * name) { return (InputPlugin *)plugin; } +void printAllInputPluginSuffixes(FILE * fp) { + ListNode * node = inputPlugin_list->firstNode; + InputPlugin * plugin; + char ** suffixes; + + while(node) { + plugin = (InputPlugin *)node->data; + suffixes = plugin->suffixes; + while(suffixes && *suffixes) { + myfprintf(fp, "%s ", *suffixes); + suffixes++; + } + node = node->nextNode; + } + myfprintf(fp, "\n"); +} + extern InputPlugin mp3Plugin; extern InputPlugin oggPlugin; extern InputPlugin flacPlugin; diff --git a/src/inputPlugin.h b/src/inputPlugin.h index 0968bae8b..143d4cc4c 100644 --- a/src/inputPlugin.h +++ b/src/inputPlugin.h @@ -47,6 +47,8 @@ InputPlugin * getInputPluginFromMimeType(char * mimeType); InputPlugin * getInputPluginFromName(char * name); +void printAllInputPluginSuffixes(FILE * fp); + /* this is where we "load" all the "plugins" ;-) */ void initInputPlugins(); diff --git a/src/main.c b/src/main.c index 8073425fe..91258712a 100644 --- a/src/main.c +++ b/src/main.c @@ -85,30 +85,16 @@ void usage(char * argv[]) { } void version() { - ERROR("mpd (MPD: Music Player Daemon) %s\n",VERSION); - ERROR("\n"); - ERROR("Copyright (C) 2003 Warren Dukes \n"); - ERROR("This is free software; see the source for copying conditions. There is NO\n"); - ERROR("warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); - ERROR("\n"); - ERROR("Supported formats:\n"); + LOG("mpd (MPD: Music Player Daemon) %s\n",VERSION); + LOG("\n"); + LOG("Copyright (C) 2003 Warren Dukes \n"); + LOG("This is free software; see the source for copying conditions. There is NO\n"); + LOG("warranty; not even MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); + LOG("\n"); + LOG("Supported formats:\n"); -#ifdef HAVE_AUDIOFILE - ERROR(" wav"); -#endif -#ifdef HAVE_MAD - ERROR(" mp3"); -#endif -#ifdef HAVE_FAAD - ERROR(" mp4 aac"); -#endif -#ifdef HAVE_FLAC - ERROR(" flac"); -#endif -#ifdef HAVE_OGG - ERROR(" ogg"); -#endif - ERROR("\n"); + initInputPlugins(); + printAllInputPluginSuffixes(stdout); } void parseOptions(int argc, char ** argv, Options * options) { -- cgit v1.2.3