X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=filter_common.c;h=285efe68d56cefac4ea05dc3f6102db4cda89fa4;hp=29d6c957498216a9cec77b6ccd4a7f03b65385aa;hb=56955f95584f51709320262f7d2e0ea79301d346;hpb=d9e608504d9d0e71380907559546e211c4f0ce55 diff --git a/filter_common.c b/filter_common.c index 29d6c957..285efe68 100644 --- a/filter_common.c +++ b/filter_common.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2008 Andre Noll + * Copyright (C) 2005-2009 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -13,6 +13,7 @@ #include "list.h" #include "sched.h" #include "fd.h" +#include "ggo.h" #include "filter.h" #include "error.h" #include "string.h" @@ -27,12 +28,12 @@ struct filter filters[NUM_SUPPORTED_FILTERS] = {FILTER_ARRAY}; * * \sa filter::init */ -void filter_init(struct filter *all_filters) +void filter_init(void) { int i; FOR_EACH_SUPPORTED_FILTER(i) - all_filters[i].init(all_filters + i); + filters[i].init(filters + i); } /** @@ -154,7 +155,7 @@ again: // fc->eof, *fc->out_loaded, conv, conv_total); if (conv) goto again; - if (!*fc->input_error) + if (*fc->input_error >= 0) return; if (*fc->out_loaded) return; @@ -262,3 +263,22 @@ int check_filter_arg(char *fa, void **conf) return -E_UNSUPPORTED_FILTER; } +void print_filter_helps(int detailed) +{ + int i; + + printf_or_die("\nAvailable filters: \n\t"); + FOR_EACH_SUPPORTED_FILTER(i) + printf_or_die("%s%s", i? " " : "", filters[i].name); + printf_or_die("\n\n"); + + FOR_EACH_SUPPORTED_FILTER(i) { + struct filter *f = filters + i; + + if (!f->help.short_help) + continue; + printf_or_die("Options for %s:\n", f->name); + ggo_print_help(&f->help, detailed); + } + +}