/*
- * Copyright (C) 2005-2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2007 Andre Noll <maan@systemlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
struct audioc_args_info conf;
char *tmpfifo;
-
-/*
- * client log function
- */
-void para_log(int ll, const char* fmt,...)
-{
- va_list argp;
-
- /* ignore log message if loglevel is not high enough */
- if (ll < conf.loglevel_arg)
- return;
- va_start(argp, fmt);
- vfprintf(stderr, fmt, argp);
- va_end(argp);
-}
+INIT_STDERR_LOGGING(conf.loglevel_arg);
static char *concat_args(const int argc, char * const *argv)
{
/*
- * Copyright (C) 1997-2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2007 Andre Noll <maan@systemlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
static struct stdin_task sit;
static struct stdout_task sot;
-/*
- * client log function
- */
-void para_log(int ll, const char* fmt,...)
-{
- va_list argp;
- /* ignore log message if loglevel is not high enough */
- if (pcd && ll < pcd->conf.loglevel_arg)
- return;
- va_start(argp, fmt);
- vfprintf(stderr, fmt, argp);
- va_end(argp);
-}
+INIT_STDERR_LOGGING(pcd->conf.loglevel_arg);
static void client_event_handler(struct task *t)
{
/** gengetopt struct that holds the command line args */
static struct filter_args_info conf;
-
-/**
- * standard log function that always writes to stderr
- *
- * \param ll loglevel. If the loglevel of the current message
- * is less than \a ll, the message is going to be ignored.
- *
- * \param fmt the format string describing the log message.
- *
- */
-__printf_2_3 void para_log(int ll, const char* fmt,...)
-{
- va_list argp;
-
- /* ignore log message if loglevel is not high enough */
- if (ll < conf.loglevel_arg)
- return;
- va_start(argp, fmt);
- vfprintf(stderr, fmt, argp);
- va_end(argp);
-}
+INIT_STDERR_LOGGING(conf.loglevel_arg);
static void filter_event_handler(struct task *t)
{
/*
- * Copyright (C) 1997-2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 1997-2007 Andre Noll <maan@systemlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#define PARA_EMERG_LOG(...)
#endif
+/**
+ * define a standard log function that always writes to stderr
+ *
+ * \param loglevel_barier If the loglevel of the current message
+ * is less than that, the message is going to be ignored.
+ *
+ */
+#define INIT_STDERR_LOGGING(loglevel_barrier) \
+ __printf_2_3 void para_log(int ll, const char* fmt,...) \
+ { \
+ va_list argp; \
+ if (ll < loglevel_barrier) \
+ return; \
+ va_start(argp, fmt); \
+ vfprintf(stderr, fmt, argp); \
+ va_end(argp); \
+ }
+
+
#define COPYRIGHT "Copyright (c) 1997-2006 by Andre Noll"
#define LICENSE "This is free software with ABSOLUTELY NO WARRANTY. " \
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*/
+
+/** \file recv.c the stand-alone receiver */
+
#include "para.h"
#include "list.h"
INIT_RECV_ERRLISTS;
-__printf_2_3 void para_log(int ll, const char* fmt,...)
-{
- va_list argp;
-
- /* ignore log message if loglevel is not high enough */
- if (ll < conf.loglevel_arg)
- return;
- va_start(argp, fmt);
- vfprintf(stderr, fmt, argp);
- va_end(argp);
-}
+INIT_STDERR_LOGGING(conf.loglevel_arg);
static void *parse_config(int argc, char *argv[], int *receiver_num)
{
int i;
/*
- * Copyright (C) 2005-2006 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2005-2007 Andre Noll <maan@systemlinux.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
s->timeout = diff;
}
-/**
- * all log messages are written to stderr
- *
- * \param ll: loglevel
- * \param fmt: format string
- */
-void para_log(int ll, const char* fmt,...)
-{
- va_list argp;
-
- if (ll < conf.loglevel_arg)
- return;
- va_start(argp, fmt);
- vfprintf(stderr, fmt, argp);
- va_end(argp);
-}
+INIT_STDERR_LOGGING(conf.loglevel_arg)
static struct writer_node_group *check_args(void)
{