/*
- * Copyright (C) 2005-2008 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2009 Andre Noll <maan@systemlinux.org>
*
* Licensed under the GPL v2. For licencing details see COPYING.
*/
/** \file write.c Paraslash's standalone wav/raw player. */
+#include <regex.h>
#include <sys/types.h>
#include <dirent.h>
s->timeout.tv_usec = 1;
}
-INIT_STDERR_LOGGING(conf.loglevel_arg)
+static int loglevel;
+INIT_STDERR_LOGGING(loglevel)
static struct writer_node_group *check_args(void)
{
struct writer_node_group *g = NULL;
struct initial_delay_task *idt = &the_initial_delay_task;
+ loglevel = get_loglevel_by_name(conf.loglevel_arg);
if (conf.start_time_given) {
long unsigned sec, usec;
if (sscanf(conf.start_time_arg, "%lu:%lu",
conf.writer_arg[i], &writer_num);
if (!g->writer_nodes[i].conf)
goto out;
- g->writer_nodes[i].writer = &writers[writer_num];
+ g->writer_nodes[i].writer_num = writer_num;
}
ret = 1;
out:
__noreturn static void print_help_and_die(void)
{
- int i, d = conf.detailed_help_given;
+ int d = conf.detailed_help_given;
const char **p = d? write_args_info_detailed_help
: write_args_info_help;
printf_or_die("%s\n\n", write_args_info_usage);
for (; *p; p++)
printf_or_die("%s\n", *p);
-
- printf_or_die("\nAvailable writers: \n\t");
- FOR_EACH_WRITER(i)
- printf_or_die("%s%s", i? " " : "", writer_names[i]);
- printf_or_die("\n\n");
- FOR_EACH_WRITER(i) {
- struct writer *w = writers + i;
-
- if (!w->help.short_help)
- continue;
- printf_or_die("Options for %s:\n", writer_names[i]);
- ggo_print_help(&w->help, d);
- }
+ print_writer_helps(d);
exit(0);
}
struct check_wav_task *cwt = &the_check_wav_task;
struct initial_delay_task *idt = &the_initial_delay_task;
- init_supported_writers();
+ writer_init();
write_cmdline_parser(argc, argv, &conf);
HANDLE_VERSION_FLAG("write", conf);
if (conf.help_given || conf.detailed_help_given)
sit.bufsize = conf.bufsize_arg * 1024;
sit.buf = para_malloc(sit.bufsize);
- wng->buf = sit.buf;
+ wng->bufp = &sit.buf;
wng->loaded = &sit.loaded;
wng->input_error = &sit.task.error;