X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=audioc.c;h=1679335d7cf737d37413a158d347d16cb2054357;hp=0b0d2fb7006e6b9c60a9c0526c3d3d0259028463;hb=0a2aa419ef9fcdb667ebcbe1a425802578aa153d;hpb=e1dfa207b2f03e2c06ccfdc6c1c68598703ba4d1 diff --git a/audioc.c b/audioc.c index 0b0d2fb7..1679335d 100644 --- a/audioc.c +++ b/audioc.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2005-2006 Andre Noll + * Copyright (C) 2005-2007 Andre Noll * * 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 @@ -27,28 +27,10 @@ INIT_AUDIOC_ERRLISTS; -struct gengetopt_args_info conf; +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); -} - -/* audioc does not use encryption */ -void (*crypt_function_recv)(unsigned long len, const unsigned char *indata, unsigned char *outdata) = NULL; -void (*crypt_function_send)(unsigned long len, const unsigned char *indata, unsigned char *outdata) = NULL; +INIT_STDERR_LOGGING(conf.loglevel_arg); static char *concat_args(const int argc, char * const *argv) { @@ -85,11 +67,11 @@ int main(int argc, char *argv[]) *buf = NULL, *hn = para_hostname(), *args, *home = para_homedir(); - if (cmdline_parser(argc, argv, &conf)) + if (audioc_cmdline_parser(argc, argv, &conf)) goto out; cf = configfile_exists(); if (cf) { - if (cmdline_parser_configfile(cf, &conf, 0, 0, 0)) { + if (audioc_cmdline_parser_configfile(cf, &conf, 0, 0, 0)) { fprintf(stderr, "parse error in config file\n"); exit(EXIT_FAILURE); } @@ -121,7 +103,6 @@ int main(int argc, char *argv[]) ret = - E_AUDIOC_CONNECT; if (connect(fd, (struct sockaddr *)&unix_addr, UNIX_PATH_MAX) < 0) goto out; - fprintf(stderr, "loaded: %d\n", loaded); ret = send_cred_buffer(fd, args); if (ret < 0) goto out; @@ -131,8 +112,6 @@ int main(int argc, char *argv[]) fd_set rfd, wfd; FD_ZERO(&rfd); FD_ZERO(&wfd); - if (loaded && loaded > 10000) - fprintf(stderr, "loaded: %d\n", loaded); if (loaded < conf.bufsize_arg) para_fd_set(fd, &rfd, &max_fileno); if (loaded > 0) {