]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 'refs/heads/t/simple_error_codes'
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 31 Dec 2016 15:50:02 +0000 (16:50 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 31 Dec 2016 16:30:46 +0000 (17:30 +0100)
Two patches which get rid of the concept of per-subsystem error
codes. The host-compiled error2.c program can be removed, configure.ac
and error.h simplified.

The merge conflicted because both sides modified error.h, but this
was easy to resolve.

* refs/heads/t/simple_error_codes:
  Sort errors alphabetically.
  Simplify the error subsystem, get rid of error2.[ch].

1  2 
Doxyfile
Makefile.real
NEWS.md
audiod.c
client.c
configure.ac
error.h
fade.c
gui.c
play.c
server.c

diff --combined Doxyfile
index df6c87fd3a21f3ca3d754636539903010c74a537,f6476603a0ba3b2d52a9873e1e8912816da5f5b8..c607b8eab59985d84cc8ac382536c4d45e76890d
+++ b/Doxyfile
@@@ -779,7 -779,7 +779,7 @@@ RECURSIVE              = N
  # Note that relative paths are relative to the directory from which doxygen is
  # run.
  
- EXCLUDE                = error2.h
+ EXCLUDE                =
  
  # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
  # directories that are symbolic links (a Unix file system feature) are excluded
@@@ -797,6 -797,7 +797,6 @@@ EXCLUDE_SYMLINKS       = N
  
  EXCLUDE_PATTERNS       = *.cmdline.* \
                           gcc-compat.h \
 -                         fade.c \
                           *.command_list.h \
                           *.completion.h
  
diff --combined Makefile.real
index 464cd68ee2a1af044d0b09e36f4681db2a836aae,980192ecf5543bcde432575128ad0723e5ab82f8..9d10e184d74876cc76b655ac2a9a58bcb080a9ad
@@@ -10,7 -10,6 +10,6 @@@ endi
  vardir := /var/paraslash
  mandir := $(datarootdir)/man/man1
  STRIP := $(CROSS_COMPILE)strip
- HOSTCC ?= cc
  MKDIR_P := mkdir -p
  prefixed_executables := $(addprefix para_, $(executables))
  
@@@ -34,7 -33,6 +33,6 @@@ cmdline_dir := $(build_dir)/cmdlin
  cmdlist_dir := $(build_dir)/cmdlist
  m4depdir := $(build_dir)/m4deps
  help2man_dir := $(build_dir)/help2man
- hostbin_dir := $(build_dir)/host/bin
  m4_ggo_dir := m4/gengetopt
  test_dir := t
  
@@@ -78,7 -76,7 +76,7 @@@ ifeq ($(findstring clean, $(MAKECMDGOAL
  endif
  
  $(object_dir) $(man_dir) $(ggo_dir) $(cmdline_dir) $(dep_dir) $(m4depdir) \
-               $(help2man_dir) $(hostbin_dir) $(cmdlist_dir):
+               $(help2man_dir) $(cmdlist_dir):
        $(Q) $(MKDIR_P) $@
  
  # When in doubt, use brute force (Ken Thompson)
@@@ -95,7 -93,6 +93,6 @@@ CPPFLAGS += -DCOPYRIGHT_YEAR='"$(COPYRI
  CPPFLAGS += -DBUILD_DATE='"$(build_date)"'
  CPPFLAGS += -DUNAME_RS='"$(uname_rs)"'
  CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
- CPPFLAGS += -DMAIN_INPUT_FILE_IS_$(*F)
  CPPFLAGS += -I/usr/local/include
  CPPFLAGS += -I$(cmdline_dir)
  CPPFLAGS += -I$(cmdlist_dir)
@@@ -128,13 -125,6 +125,13 @@@ ifeq ($(uname_s),Linux
        LDFLAGS += -Wl,--gc-sections
  endif
  
 +cc-option = $(shell \
 +      $(CC) $(1) -Werror -c -x c /dev/null -o /dev/null > /dev/null 2>&1 \
 +      && echo "$(1)" \
 +)
 +
 +STRICT_CFLAGS += $(call cc-option, -Wformat-signedness)
 +
  # To put more focus on warnings, be less verbose as default
  # Use 'make V=1' to see the full commands
  ifeq ("$(origin V)", "command line")
@@@ -197,13 -187,6 +194,6 @@@ $(man_dir)/para_%.1: $(ggo_dir)/%.ggo m
                WRITERS="$(writers)" \
                ./man_util.bash $@
  
- $(hostbin_dir)/error2: error2.c | $(hostbin_dir)
-       @[ -z "$(Q)" ] || echo 'HCC $<'
-       $(Q) $(HOSTCC) -o $@ $<
- error2.h: $(hostbin_dir)/error2 config.h
-       @[ -z "$(Q)" ] || echo 'ER2 $<'
-       @echo "$(object_executable_matrix)" | $< > $@
  $(object_dir)/%.o: %.c | $(object_dir)
  
  $(object_dir)/opus%.o $(dep_dir)/opus%.d: CPPFLAGS += $(opus_cppflags)
@@@ -283,7 -266,7 +273,7 @@@ $(object_dir)/%.cmdline.o: $(cmdline_di
  # The compiler outputs dependencies either as foo.h or as some_directory/foo.h,
  # depending on whether the latter file exists. Since make needs the directory
  # part we prefix the dependency as appropriate.
- $(dep_dir)/%.d: %.c error2.h | $(dep_dir)
+ $(dep_dir)/%.d: %.c | $(dep_dir)
        @[ -z "$(Q)" ] || echo 'DEP $<'
        $(Q) $(CC) $(CPPFLAGS) -MM -MG -MP -MT $@ -MT $(object_dir)/$(*F).o $< \
                | sed -e "s@ \([a-zA-Z0-9_]\{1,\}\.cmdline.h\)@ $(cmdline_dir)/\1@g" \
@@@ -357,7 -340,7 +347,7 @@@ clean2: clea
        $(Q) rm -rf $(build_dir)
  distclean: clean2 test-clean
        @[ -z "$(Q)" ] || echo 'DISTCLEAN'
-       $(Q) rm -f Makefile autoscan.log config.status config.log error2.h
+       $(Q) rm -f Makefile autoscan.log config.status config.log
        $(Q) rm -f GPATH GRTAGS GSYMS GTAGS
  
  maintainer-clean: distclean
diff --combined NEWS.md
index d47141ce1f8112cdd73b59814b9124dad5dd5019,b0862d5f392ee33504255eab1d0d43e3ee157067..449a3a1fc38e72ab137b25dfb7e6ceaa0d50ef68
+++ b/NEWS.md
@@@ -8,15 -8,6 +8,16 @@@ NEW
  - One of the two source browsers has been removed from the web pages.
    The doxygen API reference still contains an HTML version of each
    source file.
 +- Two race conditions in para_server have been fixed.
 +- ls -p is now deprecated in favor of -F or -b. See the help text of
 +  the ls command for details.
 +- The openssl code has been adjusted to work also with openssl-1.1.
 +- The wma decoder and audio format handler now correctly decodes
 +  files with unusual block sizes.
 +- We now compile with -Wformat-signedness if possible.
 +- The touch command now refuses to set an invalid image or lyrics ID.
 +- New section on contributing for the user manual.
++- Major simplification of the error subsystem.
  
  Download: [tarball](./releases/paraslash-git.tar.bz2)
  
@@@ -44,7 -35,6 +45,7 @@@ not mentioned here have accumulated an
  - para_gui no longer reports 100% playing time at the stream start.
  - Opus cleanups.
  
 +Downloads:
  [tarball](./releases/paraslash-0.5.6.tar.bz2),
  [signature](./releases/paraslash-0.5.6.tar.bz2.asc)
  
diff --combined audiod.c
index bd97f15e22e1629e8b9b0895420438dd5fb46194,0f082e26504bcc0039be7ca7f4c36349aa7ccca2..db69cf141a3833a5227c12ccba3f81a9e357e3b3
+++ b/audiod.c
  #include "signal.h"
  #include "version.h"
  
+ /** Array of error strings. */
+ DEFINE_PARA_ERRLIST;
  __printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log;
- /** define the array of error lists needed by para_audiod */
- INIT_AUDIOD_ERRLISTS;
  /** define the array containing all supported audio formats */
  const char *audio_formats[] = {AUDIOD_AUDIO_FORMAT_ARRAY NULL};
  
@@@ -764,7 -765,7 +765,7 @@@ static void compute_time_diff(const str
        if (count > 5) {
                int s = tv_diff(&diff, &stat_task->sa_time_diff, &tmp);
                if (tv_diff(&max_deviation, &tmp, NULL) < 0)
 -                      PARA_WARNING_LOG("time diff jump: %lims\n",
 +                      PARA_WARNING_LOG("time diff jump: %lums\n",
                                s * tv2ms(&tmp));
        }
        count++;
@@@ -1378,7 -1379,7 +1379,7 @@@ static int status_post_select(struct sc
        if (st->clock_diff_count) { /* get status only one time */
                char *argv[] = {"audiod", "--", "stat", "-p", "-n=1", NULL};
                int argc = 5;
 -              PARA_INFO_LOG("clock diff count: %d\n", st->clock_diff_count);
 +              PARA_INFO_LOG("clock diff count: %u\n", st->clock_diff_count);
                st->clock_diff_count--;
                client_open(argc, argv, &st->ct, NULL, NULL, st->btrn, s);
                set_stat_task_restart_barrier(2);
diff --combined client.c
index 64b1553745a53fc7a73db8901ea33a2c661204f2,d70bdb937e58c8b568917ac37b43c3b8dd458434..f1100df49e144b873779ca84d226c1829cb1c1a3
+++ b/client.c
@@@ -22,7 -22,8 +22,8 @@@
  #include "error.h"
  #include "version.h"
  
- INIT_CLIENT_ERRLISTS;
+ /** Array of error strings. */
+ DEFINE_PARA_ERRLIST;
  
  static struct sched sched;
  static struct client_task *ct;
@@@ -278,7 -279,7 +279,7 @@@ static void ls_completer(struct i9e_com
        char *opts[] = {
                "--", "-l", "-l=s", "-l=l", "-l=v", "-l=p", "-l=m", "-l=c",
                "-p", "-a", "-r", "-d", "-s=p", "-s=l", "-s=s", "-s=n", "-s=f",
 -              "-s=c", "-s=i", "-s=y", "-s=b", "-s=d", "-s=a", NULL
 +              "-s=c", "-s=i", "-s=y", "-s=b", "-s=d", "-s=a", "-F", "-b", NULL
        };
        if (ci->word[0] == '-')
                i9e_complete_option(opts, ci, cr);
diff --combined configure.ac
index 74f3fd97f97cd1228ca76fadbda92bd77b5896bd,ffb06934439b807d7e8a49551e65c73e313d23ed..0b00cc2af9f006d492975a54210ce26f4e5aa56e
@@@ -1,6 -1,3 +1,3 @@@
- #                                               -*- Autoconf -*-
- # Process this file with autoconf to produce a configure script.
  AC_PREREQ([2.61])
  
  AC_INIT([paraslash], [m4_esyscmd_s(./GIT-VERSION-GEN)],
@@@ -10,20 -7,6 +7,6 @@@ AC_CONFIG_HEADERS([config.h]
  AC_CONFIG_FILES([Makefile])
  AC_DEFUN([add_dot_o],[$(for i in $@; do printf "$i.o "; done)])
  AC_DEFUN([add_cmdline],[$(for i in $@; do printf "${i}.cmdline "; done)])
- AC_DEFUN([make_errlist_defines], \
-       $(for i in $@; do \
-               printf "DEFINE_ERRLIST($(echo $i | tr 'a-z' 'A-Z'));"; \
-       done) \
- )
- AC_DEFUN([make_para_errlists], \
-       $(for i in $@; do \
-               printf "PARA_ERRLIST($(echo $i | tr 'a-z' 'A-Z')), "; \
-       done) \
- )
- AC_DEFUN([objlist_to_errlist],[ \
-       make_errlist_defines($@) \
-       [const char **para_errlist[[]]] = {make_para_errlists($@)} \
- ])
  AC_DEFUN([LIB_ARG_WITH], [
        AC_ARG_WITH($1-headers, [AS_HELP_STRING(--with-$1-headers=dir,
                [look for $1 headers in dir])])
@@@ -116,10 -99,6 +99,10 @@@ LIB_ARG_WITH([openssl], [-lssl -lcrypto
  AC_CHECK_HEADER(openssl/ssl.h, [], [HAVE_OPENSSL=no])
  AC_CHECK_LIB([crypto], [RAND_bytes], [], [HAVE_OPENSSL=no])
  LIB_SUBST_FLAGS(openssl)
 +if test $HAVE_OPENSSL = yes; then
 +      AC_CHECK_LIB([crypto], [RSA_set0_key],
 +              AC_DEFINE([HAVE_RSA_SET0_KEY], [1], [openssl-1.1]))
 +fi
  UNSTASH_FLAGS
  ######################################################################### gcrypt
  STASH_FLAGS
@@@ -462,8 -441,6 +445,6 @@@ if test -n "$CRYPTOLIB" && test $HAVE_O
        fi
        server_objs="add_cmdline($server_cmdline_objs) $server_errlist_objs"
        AC_SUBST(server_objs, add_dot_o($server_objs))
-       AC_DEFINE_UNQUOTED(INIT_SERVER_ERRLISTS,
-               objlist_to_errlist($server_errlist_objs), errors used by para_server)
  else
        build_server="no"
  fi
@@@ -499,8 -476,6 +480,6 @@@ if test -n "$CRYPTOLIB"; the
        fi
        client_objs="add_cmdline($client_cmdline_objs) $client_errlist_objs"
        AC_SUBST(client_objs, add_dot_o($client_objs))
-       AC_DEFINE_UNQUOTED(INIT_CLIENT_ERRLISTS,
-               objlist_to_errlist($client_errlist_objs), errors used by para_client)
  else
        build_client="no"
  fi
@@@ -612,8 -587,6 +591,6 @@@ if test -n "$CRYPTOLIB"; the
        fi
        audiod_objs="add_cmdline($audiod_cmdline_objs) $audiod_errlist_objs"
        AC_SUBST(audiod_objs, add_dot_o($audiod_objs))
-       AC_DEFINE_UNQUOTED(INIT_AUDIOD_ERRLISTS, objlist_to_errlist($audiod_errlist_objs),
-               errors used by para_audiod)
  
        enum="$(for i in $audiod_audio_formats; do printf "AUDIO_FORMAT_${i}, " | tr '[a-z]' '[A-Z]'; done)"
        AC_DEFINE_UNQUOTED(AUDIOD_AUDIO_FORMATS_ENUM, $enum NUM_AUDIO_FORMATS,
@@@ -641,9 -614,6 +618,6 @@@ if test $HAVE_OSS = yes -o $HAVE_ALSA 
        fi
        fade_objs="add_cmdline($fade_cmdline_objs) $fade_errlist_objs"
        AC_SUBST(fade_objs, add_dot_o($fade_objs))
-       AC_DEFINE_UNQUOTED(INIT_FADE_ERRLISTS,
-               objlist_to_errlist($fade_errlist_objs),
-               errors used by para_fade)
        enum="$(
                for i in $mixers; do
                        printf "${i}_MIX, " | tr '[a-z]' '[A-Z]'
@@@ -689,8 -659,6 +663,6 @@@ if test $HAVE_CURSES = yes; the
        "
        gui_objs="add_cmdline($gui_cmdline_objs) $gui_errlist_objs"
        AC_SUBST(gui_objs, add_dot_o($gui_objs))
-       AC_DEFINE_UNQUOTED(INIT_GUI_ERRLISTS,
-               objlist_to_errlist($gui_errlist_objs), errors used by para_gui)
  else
        build_gui="no"
        AC_MSG_WARN([no curses lib, cannot build para_gui])
@@@ -772,8 -740,6 +744,6 @@@ AC_SUBST(filters
  filter_objs="add_cmdline($filter_cmdline_objs) $filter_errlist_objs"
  
  AC_SUBST(filter_objs, add_dot_o($filter_objs))
- AC_DEFINE_UNQUOTED(INIT_FILTER_ERRLISTS,
-       objlist_to_errlist($filter_errlist_objs), errors used by para_filter)
  
  enum="$(for i in $filters; do printf "${i}_FILTER, " | tr '[a-z]' '[A-Z]'; done)"
  AC_DEFINE_UNQUOTED(FILTER_ENUM, $enum NUM_SUPPORTED_FILTERS,
@@@ -824,8 -790,6 +794,6 @@@ f
  recv_objs="add_cmdline($recv_cmdline_objs) $recv_errlist_objs"
  AC_SUBST(receivers, "http dccp udp afh")
  AC_SUBST(recv_objs, add_dot_o($recv_objs))
- AC_DEFINE_UNQUOTED(INIT_RECV_ERRLISTS, objlist_to_errlist($recv_errlist_objs),
-       errors used by para_recv)
  ########################################################################### afh
  audio_format_handlers="mp3 wma"
  afh_cmdline_objs="afh"
@@@ -866,8 -830,6 +834,6 @@@ f
  afh_objs="add_cmdline($afh_cmdline_objs) $afh_errlist_objs"
  
  AC_SUBST(afh_objs, add_dot_o($afh_objs))
- AC_DEFINE_UNQUOTED(INIT_AFH_ERRLISTS,
-       objlist_to_errlist($afh_errlist_objs), errors used by para_afh)
  ########################################################################## play
  play_errlist_objs="
        play
@@@ -969,8 -931,6 +935,6 @@@ f
  
  play_objs="add_cmdline($play_cmdline_objs) $play_errlist_objs"
  AC_SUBST(play_objs, add_dot_o($play_objs))
- AC_DEFINE_UNQUOTED(INIT_PLAY_ERRLISTS,
-       objlist_to_errlist($play_errlist_objs), errors used by para_play)
  ######################################################################### write
  write_cmdline_objs="
        write
@@@ -1020,8 -980,6 +984,6 @@@ f
  AC_SUBST(writers)
  write_objs="add_cmdline($write_cmdline_objs) $write_errlist_objs"
  AC_SUBST(write_objs, add_dot_o($write_objs))
- AC_DEFINE_UNQUOTED(INIT_WRITE_ERRLISTS,
-       objlist_to_errlist($write_errlist_objs), errors used by para_write)
  enum="$(for i in $writers; do printf "${i}_WRITE, " | tr '[a-z]' '[A-Z]'; done)"
  AC_DEFINE_UNQUOTED(WRITER_ENUM, $enum NUM_SUPPORTED_WRITERS,
        enum of supported writers)
@@@ -1052,52 -1010,6 +1014,6 @@@ if test $HAVE_READLINE = yes; the
  fi
  audioc_objs="add_cmdline($audioc_cmdline_objs) $audioc_errlist_objs"
  AC_SUBST(audioc_objs, add_dot_o($audioc_objs))
- AC_DEFINE_UNQUOTED(INIT_AUDIOC_ERRLISTS,
-       objlist_to_errlist($audioc_errlist_objs), errors used by para_audioc)
- ############################################################# error2.h
- # these are always built
- all_errlist_objs="
-       $recv_errlist_objs
-       $filter_errlist_objs
-       $audioc_errlist_objs
-       $write_errlist_objs
-       $afh_errlist_objs
-       $play_errlist_objs
- "
- # optional executables
- if test "$build_server" = "yes"; then
-       all_errlist_objs="$all_errlist_objs $server_errlist_objs"
- fi
- if test "$build_gui" = "yes"; then
-       all_errlist_objs="$all_errlist_objs $gui_errlist_objs"
- fi
- if test "$build_fade" = "yes"; then
-       all_errlist_objs="$all_errlist_objs $fade_errlist_objs"
- fi
- if test "$build_client" = "yes"; then
-       all_errlist_objs="$all_errlist_objs $client_errlist_objs"
- fi
- if test "$build_audiod" = "yes"; then
-       all_errlist_objs="$all_errlist_objs $audiod_errlist_objs"
- fi
- all_errlist_objs="$(echo $all_errlist_objs | tr ' ' '\n' | sort | uniq)"
- object_executable_matrix=
- for i in $executables; do
-       eval objs=\$${i}_errlist_objs
-       object_executable_matrix="$object_executable_matrix $i: $objs"
- done
- # use echo to replace newlines by space
- AC_SUBST(object_executable_matrix, $(echo $object_executable_matrix))
- SS=$(for obj in $all_errlist_objs; do
-       printf '%s' " SS_$obj,"; done | tr 'a-z' 'A-Z')
- AC_DEFINE_UNQUOTED(DEFINE_ERRLIST_OBJECT_ENUM,
-       [enum {$SS NUM_SS}],
-       [list of all objects that use the paraslash error facility]
- )
  ################################################################## status items
  
  status_items="basename status num_played mtime bitrate frequency file_size
diff --combined error.h
index a2f719f51aa92d419851040c6bdaf7b7874d996b,24a2e3d9205f511737bb35863a0695c6946d46b8..899c574b315cd9e8ee7356eb29c1828e1dd6ae04
+++ b/error.h
   * Licensed under the GPL v2. For licencing details see COPYING.
   */
  
- /** \file error.h List of error messages for all subsystems. */
+ /** \file error.h List of error codes and messages. */
  
- /** \cond errors */
- /* List of all subsystems that use paraslash's error facility. */
- DEFINE_ERRLIST_OBJECT_ENUM;
- /* these do not need error handling (yet) */
- #define SERVER_ERRORS
- #define TIME_ERRORS
- #define CLOSE_ON_FORK_ERRORS
- #define DAEMON_ERRORS
- #define GUI_THEME_ERRORS
- #define RINGBUFFER_ERRORS
- #define SCORE_ERRORS
- #define RECV_ERRORS
- #define IPC_ERRORS
- #define DCCP_SEND_ERRORS
- #define HTTP_SEND_ERRORS
- #define GGO_ERRORS
- #define COLOR_ERRORS
- #define SIGNAL_ERRORS
- #define OSS_MIX_ERRORS
- #define STDOUT_ERRORS
- #define FILE_WRITE_ERRORS
- #define STDIN_ERRORS
- #define WRITE_ERRORS
- #define CHECK_WAV_ERRORS
- #define VERSION_ERRORS
- #define SCHED_ERRORS
- extern const char **para_errlist[];
- #define SYNC_FILTER_ERRORS\
-       PARA_ERROR(SYNC_COMPLETE, "all buddies in sync"), \
-       PARA_ERROR(SYNC_LISTEN_FD, "no fd to listen on"), \
- #define ALSA_MIX_ERRORS \
-       PARA_ERROR(ALSA_MIX_OPEN, "could not open mixer"), \
+ /** Codes and messages. */
+ #define PARA_ERRORS \
+       PARA_ERROR(AAC_AFH_INIT, "failed to init aac decoder"), \
+       PARA_ERROR(AACDEC_INIT, "failed to init aac decoder"), \
+       PARA_ERROR(AAC_DECODE, "aac decode error"), \
+       PARA_ERROR(ACL_PERM, "access denied by acl"), \
+       PARA_ERROR(ADD_CALLBACK, "can not add callback"), \
+       PARA_ERROR(ADDRESS_LOOKUP, "can not resolve requested address"),\
+       PARA_ERROR(AFH_RECV_BAD_FILENAME, "no file name given"), \
 -      PARA_ERROR(AFH_SYNTAX, "afh syntax error"), \
+       PARA_ERROR(AFS_SHORT_READ, "short read from afs socket"), \
+       PARA_ERROR(AFS_SIGNAL, "afs caught deadly signal"), \
+       PARA_ERROR(AFS_SOCKET, "afs socket not writable"), \
+       PARA_ERROR(AFS_SYNTAX, "afs syntax error"), \
+       PARA_ERROR(AFT_SYNTAX, "audio file table syntax error"), \
+       PARA_ERROR(ALSA, "alsa error"), \
        PARA_ERROR(ALSA_MIX_GET_VAL, "could not read control element state"), \
-       PARA_ERROR(ALSA_MIX_SET_VAL, "could not set control element state"), \
+       PARA_ERROR(ALSA_MIX_OPEN, "could not open mixer"), \
        PARA_ERROR(ALSA_MIX_RANGE, "value control element out of range"), \
- #define RESAMPLE_FILTER_ERRORS \
-       PARA_ERROR(RESAMPLE_EOF, "resample filter: end of file"), \
-       PARA_ERROR(LIBSAMPLERATE, "secret rabbit code error"), \
- #define OPUS_COMMON_ERRORS \
-       PARA_ERROR(OPUS_HEADER, "invalid opus header"), \
- #define OPUS_AFH_ERRORS \
-       PARA_ERROR(OPUS_COMMENT, "invalid or corrupted opus comment"), \
- #define OPUSDEC_FILTER_ERRORS \
-       PARA_ERROR(CREATE_OPUS_DECODER, "could not create opus decoder"), \
-       PARA_ERROR(OPUS_SET_GAIN, "opus: could not set gain"), \
-       PARA_ERROR(OPUS_DECODE, "opus decode error"), \
- #define SIDEBAND_ERRORS \
-       PARA_ERROR(BAD_BAND, "invalid or unexpected band designator"), \
-       PARA_ERROR(SB_PACKET_SIZE, "invalid sideband packet size or protocol error"), \
- #define PLAY_ERRORS \
-       PARA_ERROR(PLAY_SYNTAX, "para_play: syntax error"), \
-       PARA_ERROR(NO_VALID_FILES, "no valid file found in playlist"), \
-       PARA_ERROR(BAD_PLAY_CMD, "invalid command"), \
- #define FADE_ERRORS \
-       PARA_ERROR(BAD_CHANNEL, "invalid channel"), \
- #define FLACDEC_FILTER_ERRORS \
-       PARA_ERROR(FLACDEC_DECODER_ALLOC, "could not allocate stream decoder"), \
-       PARA_ERROR(FLACDEC_DECODER_INIT, "could not init stream decoder"), \
-       PARA_ERROR(FLACDEC_EOF, "flacdec encountered end of file condition"), \
- #define GUI_ERRORS \
-       PARA_ERROR(GUI_SIGCHLD, "received SIGCHLD"), \
- #define FLAC_AFH_ERRORS \
-       PARA_ERROR(FLAC_CHAIN_ALLOC, "could not create metadata chain"), \
-       PARA_ERROR(FLAC_CHAIN_READ, "could not read meta chain"), \
-       PARA_ERROR(FLAC_ITER_ALLOC, "could not allocate meta iterator"), \
-       PARA_ERROR(FLAC_VARBLOCK, "variable blocksize not supported"), \
-       PARA_ERROR(FLAC_AFH_DECODER_ALLOC, "could not allocate stream decoder"), \
-       PARA_ERROR(FLAC_AFH_DECODER_INIT, "could not init stream decoder"), \
-       PARA_ERROR(FLAC_SKIP_META, "could not skip metadata"), \
-       PARA_ERROR(FLAC_DECODE_POS, "could not get decode position"), \
-       PARA_ERROR(FLAC_STREAMINFO, "could not read stream info meta block"), \
-       PARA_ERROR(FLAC_REPLACE_COMMENT, "could not replace vorbis comment"), \
-       PARA_ERROR(FLAC_WRITE_CHAIN, "failed to write metadata chain"), \
- #define AFH_RECV_ERRORS \
-       PARA_ERROR(AFH_RECV_BAD_FILENAME, "no file name given"), \
- #define OGG_AFH_COMMON_ERRORS \
-       PARA_ERROR(STREAM_PACKETOUT, "ogg stream packet-out error"), \
-       PARA_ERROR(STREAM_PACKETIN, "ogg stream packet-in error"), \
-       PARA_ERROR(SYNC_PAGEOUT, "ogg sync page-out error (no ogg file?)"), \
-       PARA_ERROR(STREAM_PAGEIN, "ogg stream page-in error"), \
-       PARA_ERROR(STREAM_PAGEOUT, "ogg stream page-out error"), \
-       PARA_ERROR(OGG_SYNC, "internal ogg storage overflow"), \
-       PARA_ERROR(OGG_EMPTY, "no ogg pages found"), \
- #define SPX_AFH_ERRORS \
-       PARA_ERROR(SPX_COMMENT, "invalid speex comment"), \
- #define SPX_COMMON_ERRORS \
-       PARA_ERROR(SPX_HEADER, "can not read speex header"), \
-       PARA_ERROR(SPX_HEADER_MODE, "invalid speex mode in header"), \
-       PARA_ERROR(SPX_VERSION, "incompatible speex bit stream version"), \
-       PARA_ERROR(SPX_DECODER_INIT, "speex decoder initialization failed"), \
-       PARA_ERROR(SPX_CTL_BAD_RQ, "speex_decoder_ctl: invalid request"), \
-       PARA_ERROR(SPX_CTL_INVAL, "speex_decoder_ctl: invalid argument"), \
- #define SPXDEC_FILTER_ERRORS \
-       PARA_ERROR(SPX_DECODE, "speex decoding error"), \
-       PARA_ERROR(SPX_DECODE_OVERFLOW, "speex decoding overflow"), \
-       PARA_ERROR(SPX_EOS, "speex: end of stream"), \
- #define BUFFER_TREE_ERRORS \
-       PARA_ERROR(BTR_EOF, "buffer tree: end of file"), \
-       PARA_ERROR(BTR_NO_CHILD, "btr node has no children"), \
-       PARA_ERROR(BTR_NAVAIL, "btr node: value currently unavailable"), \
- #define BITSTREAM_ERRORS \
-       PARA_ERROR(VLC, "invalid vlc code"), \
- #define WMA_AFH_ERRORS \
-       PARA_ERROR(NO_WMA, "asf/wma format not recognized"), \
- #define WMA_COMMON_ERRORS \
-       PARA_ERROR(BAD_ASF_FILE_PROPS, "invalid ASF file properties"), \
-       PARA_ERROR(WMA_NO_GUID, "audio stream guid not found"), \
- #define WMADEC_FILTER_ERRORS \
-       PARA_ERROR(WMA_BAD_PARAMS, "invalid WMA parameters"), \
-       PARA_ERROR(WMA_OUTPUT_SPACE, "insufficient output space"), \
-       PARA_ERROR(WMA_BAD_SUPERFRAME, "invalid superframe"), \
-       PARA_ERROR(WMA_BLOCK_SIZE, "invalid block size"), \
-       PARA_ERROR(INCOHERENT_BLOCK_LEN, "incoherent block length"), \
-       PARA_ERROR(WMADEC_EOF, "wmadec: end of file"), \
- #define IMDCT_ERRORS \
-       PARA_ERROR(FFT_BAD_PARAMS, "invalid params for fft"), \
- #define PREBUFFER_FILTER_ERRORS \
-       PARA_ERROR(PREBUFFER_SUCCESS, "prebuffering complete"), \
- #define OSS_WRITE_ERRORS \
-       PARA_ERROR(BAD_SAMPLE_FORMAT, "sample format not supported"), \
-       PARA_ERROR(BAD_CHANNEL_COUNT, "channel count not supported"), \
-       PARA_ERROR(BAD_SAMPLERATE, "sample rate not supported"), \
- #define AO_WRITE_ERRORS \
-       PARA_ERROR(AO_DEFAULT_DRIVER, "ao: no usable output device"), \
+       PARA_ERROR(ALSA_MIX_SET_VAL, "could not set control element state"), \
+       PARA_ERROR(AMP_EOF, "amp: end of file"), \
+       PARA_ERROR(AMP_ZERO_AMP, "no amplification necessary"), \
+       PARA_ERROR(AO_APPEND_OPTION, "ao append option: memory allocation failure"), \
        PARA_ERROR(AO_BAD_DRIVER, "ao: invalid driver"), \
        PARA_ERROR(AO_BAD_OPTION, "ao option is not of type key:value"), \
-       PARA_ERROR(AO_APPEND_OPTION, "ao append option: memory allocation failure"), \
-       PARA_ERROR(AO_OPEN_LIVE, "ao: could not open audio device"), \
+       PARA_ERROR(AO_BAD_SAMPLE_FORMAT, "ao: unsigned sample formats not supported"), \
+       PARA_ERROR(AO_DEFAULT_DRIVER, "ao: no usable output device"), \
+       PARA_ERROR(AO_EOF, "ao: end of file"), \
        PARA_ERROR(AO_FILE_NOT_SUPP, "ao: file io drivers not supported"), \
+       PARA_ERROR(AO_OPEN_LIVE, "ao: could not open audio device"), \
        PARA_ERROR(AO_PLAY, "ao_play() failed"), \
-       PARA_ERROR(AO_BAD_SAMPLE_FORMAT, "ao: unsigned sample formats not supported"), \
        PARA_ERROR(AO_PTHREAD, "pthread error"), \
-       PARA_ERROR(AO_EOF, "ao: end of file"), \
- #define COMPRESS_FILTER_ERRORS \
-       PARA_ERROR(COMPRESS_EOF, "compress: end of file"), \
- #define WAV_FILTER_ERRORS \
-       PARA_ERROR(WAV_BAD_FC, "invalid filter configuration"), \
-       PARA_ERROR(WAV_EOF, "wav filter: end of file"), \
-       PARA_ERROR(WAV_SUCCESS, "successfully wrote wav header"), \
- #define FEC_ERRORS \
-       PARA_ERROR(FEC_BAD_IDX, "invalid index vector"), \
-       PARA_ERROR(FEC_SINGULAR, "unexpected singular matrix"), \
-       PARA_ERROR(FEC_PIVOT, "pivot column not found"), \
-       PARA_ERROR(FEC_PARMS, "invalid fec parameters"), \
- #define FECDEC_FILTER_ERRORS \
-       PARA_ERROR(BAD_FEC_HEADER, "invalid fec header"), \
-       PARA_ERROR(BAD_SLICE_SIZE, "slice size zero or too large"), \
-       PARA_ERROR(BAD_SLICE_NUM, "invalid slice number"), \
-       PARA_ERROR(FECDEC_OVERRUN, "fecdec output buffer overrun"), \
-       PARA_ERROR(FECDEC_EOF, "received eof packet"), \
- #define AMP_FILTER_ERRORS \
-       PARA_ERROR(AMP_ZERO_AMP, "no amplification necessary"), \
-       PARA_ERROR(AMP_EOF, "amp: end of file"), \
- #define SEND_COMMON_ERRORS \
-       PARA_ERROR(MAX_CLIENTS, "maximal number of clients exceeded"), \
- #define CLIENT_ERRORS \
-       PARA_ERROR(TASK_STARTED, "task started"), \
- #define AFH_ERRORS \
-       PARA_ERROR(AFH_SYNTAX, "afh syntax error"), \
- #define AFH_COMMON_ERRORS \
-       PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \
- #define ACL_ERRORS \
-       PARA_ERROR(ACL_PERM, "access denied by acl"), \
- #define AFS_ERRORS \
-       PARA_ERROR(BAD_TABLE_NAME, "invalid table"), \
-       PARA_ERROR(AFS_SYNTAX, "afs syntax error"), \
-       PARA_ERROR(AFS_SIGNAL, "afs caught deadly signal"), \
-       PARA_ERROR(AFS_SOCKET, "afs socket not writable"), \
- #define MOOD_ERRORS \
-       PARA_ERROR(NO_MOOD, "no mood available"), \
- #define MM_ERRORS \
-       PARA_ERROR(MOOD_SYNTAX, "mood syntax error"), \
- #define ATTRIBUTE_ERRORS \
+       PARA_ERROR(ARG_NOT_FOUND, "argument not found in arg vector"), \
+       PARA_ERROR(ASN1_PARSE, "could not parse ASN.1 key"), \
+       PARA_ERROR(ATOI_JUNK_AT_END, "further characters after number"), \
+       PARA_ERROR(ATOI_NO_DIGITS, "no digits found in string"), \
+       PARA_ERROR(ATOI_OVERFLOW, "value too large"), \
        PARA_ERROR(ATTR_SYNTAX, "attribute syntax error"), \
-       PARA_ERROR(NO_ATTRIBUTES, "no attributes defined yet"), \
        PARA_ERROR(ATT_TABLE_FULL, "no more space left in attribute table"), \
- #define BLOB_ERRORS \
-       PARA_ERROR(BLOB_SYNTAX, "blob syntax error"), \
-       PARA_ERROR(DUMMY_ROW, "attempted to access blob dummy object"), \
- #define PLAYLIST_ERRORS \
-       PARA_ERROR(PLAYLIST_LOADED, ""), /* not really an error */ \
-       PARA_ERROR(PATH_FOUND, ""), /* not really an error */ \
-       PARA_ERROR(PLAYLIST_EMPTY, "attempted to load empty playlist"), \
- #define AFT_ERRORS \
-       PARA_ERROR(BAD_AFSI, "invalid afs info"), \
-       PARA_ERROR(LOCALTIME, "localtime() failed"), \
-       PARA_ERROR(STRFTIME, "strftime() failed"), \
-       PARA_ERROR(BAD_PATH, "invalid path"), \
-       PARA_ERROR(BAD_SORT, "invalid sorting method"), \
-       PARA_ERROR(FNMATCH, "fnmatch error"), \
-       PARA_ERROR(NO_AFHI, "audio format handler info required"), \
-       PARA_ERROR(AFT_SYNTAX, "audio file table syntax error"), \
-       PARA_ERROR(HASH_MISMATCH, "hash mismatch, consider re-add"), \
-       PARA_ERROR(NO_MATCH, "no matches"), \
- #define USER_LIST_ERRORS \
-       PARA_ERROR(USERLIST, "failed to open user list file"), \
- #define OSX_WRITE_ERRORS \
-       PARA_ERROR(STREAM_FORMAT, "could not set stream format"), \
-       PARA_ERROR(ADD_CALLBACK, "can not add callback"), \
-       PARA_ERROR(OPEN_COMP, "OpenAComponent() error"), \
-       PARA_ERROR(UNIT_INIT, "AudioUnitInitialize() error"), \
-       PARA_ERROR(UNIT_START, "AudioUnitStart() error"), \
-       PARA_ERROR(DEFAULT_COMP, "can not find default audio output component"), \
- #define AUDIOC_ERRORS \
        PARA_ERROR(AUDIOC_EOF, "audioc: end of file"), \
- #define CLIENT_COMMON_ERRORS \
-       PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
-       PARA_ERROR(NO_CONFIG, "config file not found"), \
-       PARA_ERROR(BAD_CONFIG, "syntax error in config file"), \
-       PARA_ERROR(SERVER_EOF, "connection closed by para_server"), \
-       PARA_ERROR(SERVER_CMD_SUCCESS, "command terminated successfully"), \
-       PARA_ERROR(SERVER_CMD_FAILURE, "command failed"), \
- #define NET_ERRORS \
-       PARA_ERROR(NAME_TOO_LONG, "name too long for struct sockaddr_un"), \
-       PARA_ERROR(ADDRESS_LOOKUP, "can not resolve requested address"),\
-       PARA_ERROR(CHMOD, "failed to set socket mode"), \
-       PARA_ERROR(SENDMSG, "sendmsg() failed"), \
-       PARA_ERROR(RECVMSG, "recvmsg() failed"), \
-       PARA_ERROR(SCM_CREDENTIALS, "did not receive SCM credentials"), \
-       PARA_ERROR(MAKESOCK, "makesock error"), \
- #define UDP_RECV_ERRORS \
-       PARA_ERROR(UDP_OVERRUN, "output buffer overrun"), \
- #define UDP_SEND_ERRORS \
-       PARA_ERROR(TARGET_EXISTS, "requested target is already present"),\
-       PARA_ERROR(TARGET_NOT_FOUND, "requested target not found")
- #define HTTP_RECV_ERRORS \
-       PARA_ERROR(HTTP_RECV_OVERRUN, "http_recv: output buffer overrun"), \
- #define RECV_COMMON_ERRORS \
-       PARA_ERROR(RECV_SYNTAX, "recv syntax error"), \
-       PARA_ERROR(RECV_EOF, "end of file"), \
- #define AUDIOD_ERRORS \
-       PARA_ERROR(NO_MORE_SLOTS, "no more empty slots"), \
-       PARA_ERROR(MISSING_COLON, "syntax error: missing colon"), \
-       PARA_ERROR(UNSUPPORTED_AUDIO_FORMAT, "given audio format not supported"), \
-       PARA_ERROR(NOT_PLAYING, "not playing"), \
        PARA_ERROR(AUDIOD_OFF, "audiod switched off"), \
-       PARA_ERROR(STATUS_TIMEOUT, "status item timeout"), \
        PARA_ERROR(AUDIOD_SIGNAL, "caught deadly signal"), \
        PARA_ERROR(AUDIOD_TERM, "terminating on user request"), \
- #define AUDIOD_COMMAND_ERRORS \
-       PARA_ERROR(CLIENT_WRITE, "client write error"), \
-       PARA_ERROR(UCRED_PERM, "permission denied"), \
-       PARA_ERROR(INVALID_AUDIOD_CMD, "invalid command"), \
-       PARA_ERROR(TOO_MANY_CLIENTS, "maximal number of stat clients exceeded"), \
-       PARA_ERROR(UNKNOWN_STAT_ITEM, "status item not recognized"), \
- #define FILTER_COMMON_ERRORS \
+       PARA_ERROR(AUDIO_FORMAT, "audio format not recognized"), \
+       PARA_ERROR(AUTH_REQUEST, "did not receive auth request"), \
+       PARA_ERROR(BAD_AFSI, "invalid afs info"), \
++      PARA_ERROR(BAD_ASF_FILE_PROPS, "invalid ASF file properties"), \
+       PARA_ERROR(BAD_AUTH, "authentication failure"), \
+       PARA_ERROR(BAD_BAND, "invalid or unexpected band designator"), \
+       PARA_ERROR(BAD_CHANNEL_COUNT, "channel count not supported"), \
+       PARA_ERROR(BAD_CHANNEL, "invalid channel"), \
+       PARA_ERROR(BAD_CMD, "invalid command"), \
+       PARA_ERROR(BAD_CONFIG, "syntax error in config file"), \
+       PARA_ERROR(BAD_CT, "invalid chunk table or bad FEC configuration"), \
+       PARA_ERROR(BAD_FEATURE, "invalid feature request"), \
+       PARA_ERROR(BAD_FEC_HEADER, "invalid fec header"), \
        PARA_ERROR(BAD_FILTER_OPTIONS, "invalid filter option given"), \
-       PARA_ERROR(UNSUPPORTED_FILTER, "given filter not supported"), \
- #define STAT_ERRORS \
-       PARA_ERROR(STAT_ITEM_PARSE, "failed to parse status item"), \
- #define OGGDEC_FILTER_ERRORS \
-       PARA_ERROR(OGGDEC_READ, "read from media returned an error"), \
-       PARA_ERROR(OGGDEC_NOTVORBIS, "bitstream is not vorbis data"), \
-       PARA_ERROR(OGGDEC_VERSION, "vorbis version mismatch"), \
-       PARA_ERROR(OGGDEC_BADHEADER, "invalid vorbis bitstream header"), \
-       PARA_ERROR(OGGDEC_FAULT, "bug or heap/stack corruption"), \
-       PARA_ERROR(OGGDEC_BADLINK, "invalid stream section or requested link corrupt"), \
- #define GRAB_CLIENT_ERRORS \
-       PARA_ERROR(GC_WRITE, "grab client write error"), \
-       PARA_ERROR(GC_SYNTAX, "grab client syntax error"), \
- #define MP3DEC_FILTER_ERRORS \
-       PARA_ERROR(MAD_FRAME_DECODE, "mad frame decode error"), \
-       PARA_ERROR(MP3DEC_EOF, "mp3dec: end of file"), \
-       PARA_ERROR(MP3DEC_CORRUPT, "too many corrupt frames"), \
- #define FILTER_ERRORS \
-       PARA_ERROR(NO_FILTERS, "at least one filter must be given"), \
- #define STRING_ERRORS \
-       PARA_ERROR(ATOI_OVERFLOW, "value too large"), \
-       PARA_ERROR(ATOI_NO_DIGITS, "no digits found in string"), \
-       PARA_ERROR(ATOI_JUNK_AT_END, "further characters after number"), \
-       PARA_ERROR(SIZE_PREFIX, "bad size prefix"), \
-       PARA_ERROR(REGEX, "regular expression error"), \
-       PARA_ERROR(ARG_NOT_FOUND, "argument not found in arg vector"), \
        PARA_ERROR(BAD_LL, "invalid loglevel"), \
- #define EXEC_ERRORS \
+       PARA_ERROR(BAD_PATH, "invalid path"), \
+       PARA_ERROR(BAD_PLAY_CMD, "invalid command"), \
+       PARA_ERROR(BAD_PRIVATE_KEY, "invalid private key"), \
+       PARA_ERROR(BAD_SAMPLE_FORMAT, "sample format not supported"), \
+       PARA_ERROR(BAD_SAMPLERATE, "sample rate not supported"), \
+       PARA_ERROR(BAD_SLICE_NUM, "invalid slice number"), \
+       PARA_ERROR(BAD_SLICE_SIZE, "slice size zero or too large"), \
+       PARA_ERROR(BAD_SORT, "invalid sorting method"), \
+       PARA_ERROR(BAD_TABLE_NAME, "invalid table"), \
+       PARA_ERROR(BAD_USER, "auth request for invalid user"), \
+       PARA_ERROR(BASE64, "failed to base64-decode ssh public key"), \
+       PARA_ERROR(BIGNUM, "bignum error"), \
+       PARA_ERROR(BLINDING, "failed to activate key blinding"), \
+       PARA_ERROR(BLOB_SYNTAX, "blob syntax error"), \
+       PARA_ERROR(BTR_EOF, "buffer tree: end of file"), \
+       PARA_ERROR(BTR_NAVAIL, "btr node: value currently unavailable"), \
+       PARA_ERROR(BTR_NO_CHILD, "btr node has no children"), \
+       PARA_ERROR(CHMOD, "failed to set socket mode"), \
+       PARA_ERROR(CLIENT_SYNTAX, "syntax error"), \
+       PARA_ERROR(CLIENT_WRITE, "client write error"), \
+       PARA_ERROR(COMMAND_SYNTAX, "syntax error in command"), \
+       PARA_ERROR(COMPRESS_EOF, "compress: end of file"), \
+       PARA_ERROR(CREATE_OPUS_DECODER, "could not create opus decoder"), \
+       PARA_ERROR(DCCP_OVERRUN, "dccp output buffer buffer overrun"), \
+       PARA_ERROR(DECRYPT, "decrypt error"), \
+       PARA_ERROR(DEFAULT_COMP, "can not find default audio output component"), \
+       PARA_ERROR(DUMMY_ROW, "attempted to access blob dummy object"), \
        PARA_ERROR(DUP_PIPE, "exec error: can not create pipe"), \
- #define MP3_AFH_ERRORS \
+       PARA_ERROR(EMPTY, "file is empty"), \
+       PARA_ERROR(ENCRYPT, "encrypt error"), \
+       PARA_ERROR(EOF, "end of file"), \
+       PARA_ERROR(ESDS, "did not find esds atom"), \
+       PARA_ERROR(FEC_BAD_IDX, "invalid index vector"), \
+       PARA_ERROR(FECDEC_EOF, "received eof packet"), \
+       PARA_ERROR(FECDEC_OVERRUN, "fecdec output buffer overrun"), \
+       PARA_ERROR(FEC_PARMS, "invalid fec parameters"), \
+       PARA_ERROR(FEC_PIVOT, "pivot column not found"), \
+       PARA_ERROR(FEC_SINGULAR, "unexpected singular matrix"), \
+       PARA_ERROR(FFT_BAD_PARAMS, "invalid params for fft"), \
+       PARA_ERROR(FGETS, "fgets error"), \
+       PARA_ERROR(FLAC_AFH_DECODER_ALLOC, "could not allocate stream decoder"), \
+       PARA_ERROR(FLAC_AFH_DECODER_INIT, "could not init stream decoder"), \
+       PARA_ERROR(FLAC_CHAIN_ALLOC, "could not create metadata chain"), \
+       PARA_ERROR(FLAC_CHAIN_READ, "could not read meta chain"), \
+       PARA_ERROR(FLACDEC_DECODER_ALLOC, "could not allocate stream decoder"), \
+       PARA_ERROR(FLACDEC_DECODER_INIT, "could not init stream decoder"), \
+       PARA_ERROR(FLACDEC_EOF, "flacdec encountered end of file condition"), \
+       PARA_ERROR(FLAC_DECODE_POS, "could not get decode position"), \
+       PARA_ERROR(FLAC_ITER_ALLOC, "could not allocate meta iterator"), \
+       PARA_ERROR(FLAC_REPLACE_COMMENT, "could not replace vorbis comment"), \
+       PARA_ERROR(FLAC_SKIP_META, "could not skip metadata"), \
+       PARA_ERROR(FLAC_STREAMINFO, "could not read stream info meta block"), \
+       PARA_ERROR(FLAC_VARBLOCK, "variable blocksize not supported"), \
+       PARA_ERROR(FLAC_WRITE_CHAIN, "failed to write metadata chain"), \
+       PARA_ERROR(FNMATCH, "fnmatch error"), \
        PARA_ERROR(FRAME, "invalid mp3 frame"), \
        PARA_ERROR(FRAME_LENGTH, "invalid frame length"), \
-       PARA_ERROR(MP3_INFO, "could not read mp3 info"), \
-       PARA_ERROR(HEADER_FREQ, "invalid header frequency"), \
+       PARA_ERROR(GC_SYNTAX, "grab client syntax error"), \
+       PARA_ERROR(GC_WRITE, "grab client write error"), \
+       PARA_ERROR(GUI_SIGCHLD, "received SIGCHLD"), \
+       PARA_ERROR(HASH_MISMATCH, "hash mismatch, consider re-add"), \
        PARA_ERROR(HEADER_BITRATE, "invalid header bitrate"), \
-       PARA_ERROR(ID3_DETACH, "could not detach id3 frame"), \
+       PARA_ERROR(HEADER_FREQ, "invalid header frequency"), \
+       PARA_ERROR(HTTP_RECV_OVERRUN, "http_recv: output buffer overrun"), \
+       PARA_ERROR(I9E_EOF, "end of input"), \
+       PARA_ERROR(I9E_SETUPTERM, "failed to set up terminal"), \
+       PARA_ERROR(I9E_TERM_RQ, "received termination request"), \
        PARA_ERROR(ID3_ATTACH, "could not attach id3 frame"), \
+       PARA_ERROR(ID3_DETACH, "could not detach id3 frame"), \
        PARA_ERROR(ID3_SETENCODING, "could not set id3 text encoding field"), \
        PARA_ERROR(ID3_SETSTRING, "could not set id3 string field"), \
- #define AAC_AFH_ERRORS \
-       PARA_ERROR(STSZ, "did not find stcz atom"), \
+       PARA_ERROR(INCOHERENT_BLOCK_LEN, "incoherent block length"), \
+       PARA_ERROR(INVALID_AUDIOD_CMD, "invalid command"), \
+       PARA_ERROR(KEY_MARKER, "invalid/missing key header or footer"), \
+       PARA_ERROR(KEY_PERM, "unprotected private key"), \
+       PARA_ERROR(LIBSAMPLERATE, "secret rabbit code error"), \
+       PARA_ERROR(LOCALTIME, "localtime() failed"), \
+       PARA_ERROR(LOCK, "lock error"), \
+       PARA_ERROR(MAD_FRAME_DECODE, "mad frame decode error"), \
+       PARA_ERROR(MAKESOCK, "makesock error"), \
+       PARA_ERROR(MAX_CLIENTS, "maximal number of clients exceeded"), \
+       PARA_ERROR(MISSING_COLON, "syntax error: missing colon"), \
+       PARA_ERROR(MOOD_SYNTAX, "mood syntax error"), \
+       PARA_ERROR(MP3DEC_CORRUPT, "too many corrupt frames"), \
+       PARA_ERROR(MP3DEC_EOF, "mp3dec: end of file"), \
+       PARA_ERROR(MP3_INFO, "could not read mp3 info"), \
        PARA_ERROR(MP4ASC, "audio spec config error"), \
-       PARA_ERROR(AAC_AFH_INIT, "failed to init aac decoder"), \
        PARA_ERROR(MP4V2, "mp4v2 library error"), \
- #define AAC_COMMON_ERRORS \
-       PARA_ERROR(ESDS, "did not find esds atom"), \
-       PARA_ERROR(STCO, "did not find stco atom"), \
- #define OGG_AFH_ERRORS \
-       PARA_ERROR(VORBIS, "vorbis synthesis header-in error (not vorbis?)"), \
-       PARA_ERROR(VORBIS_COMMENTHEADER, "could not create vorbis comment header"), \
+       PARA_ERROR(MPI_PRINT, "could not convert multi-precision integer"), \
+       PARA_ERROR(MPI_SCAN, "could not scan multi-precision integer"), \
+       PARA_ERROR(NAME_TOO_LONG, "name too long for struct sockaddr_un"), \
+       PARA_ERROR(NO_AFHI, "audio format handler info required"), \
+       PARA_ERROR(NO_ATTRIBUTES, "no attributes defined yet"), \
+       PARA_ERROR(NO_AUDIO_FILE, "no audio file"), \
+       PARA_ERROR(NO_CONFIG, "config file not found"), \
+       PARA_ERROR(NOFD, "did not receive open fd from afs"), \
+       PARA_ERROR(NO_FILTERS, "at least one filter must be given"), \
+       PARA_ERROR(NO_MATCH, "no matches"), \
+       PARA_ERROR(NO_MOOD, "no mood available"), \
+       PARA_ERROR(NO_MORE_SLOTS, "no more empty slots"), \
+       PARA_ERROR(NOT_PLAYING, "not playing"), \
+       PARA_ERROR(NO_VALID_FILES, "no valid file found in playlist"), \
+       PARA_ERROR(NO_WMA, "asf/wma format not recognized"), \
+       PARA_ERROR(OEAP, "error during oeap (un)padding"), \
+       PARA_ERROR(OGGDEC_BADHEADER, "invalid vorbis bitstream header"), \
+       PARA_ERROR(OGGDEC_BADLINK, "invalid stream section or requested link corrupt"), \
+       PARA_ERROR(OGGDEC_FAULT, "bug or heap/stack corruption"), \
+       PARA_ERROR(OGGDEC_NOTVORBIS, "bitstream is not vorbis data"), \
+       PARA_ERROR(OGGDEC_READ, "read from media returned an error"), \
+       PARA_ERROR(OGGDEC_VERSION, "vorbis version mismatch"), \
+       PARA_ERROR(OGG_EMPTY, "no ogg pages found"), \
        PARA_ERROR(OGG_PACKET_IN, "ogg_stream_packetin() failed"), \
        PARA_ERROR(OGG_STREAM_FLUSH, "ogg_stream_flush() failed"), \
- #define VSS_ERRORS \
-       PARA_ERROR(NOFD, "did not receive open fd from afs"), \
-       PARA_ERROR(BAD_CT, "invalid chunk table or bad FEC configuration"), \
-       PARA_ERROR(AFS_SHORT_READ, "short read from afs socket"), \
- #define CRYPT_COMMON_ERRORS \
-       PARA_ERROR(SSH_KEY_HEADER, "ssh key header not found"), \
-       PARA_ERROR(KEY_PERM, "unprotected private key"), \
- #define BASE64_ERRORS \
-       PARA_ERROR(BASE64, "base64 decode error"), \
- #define CRYPT_ERRORS \
+       PARA_ERROR(OGG_SYNC, "internal ogg storage overflow"), \
+       PARA_ERROR(OPEN_COMP, "OpenAComponent() error"), \
+       PARA_ERROR(OPUS_COMMENT, "invalid or corrupted opus comment"), \
+       PARA_ERROR(OPUS_DECODE, "opus decode error"), \
+       PARA_ERROR(OPUS_HEADER, "invalid opus header"), \
+       PARA_ERROR(OPUS_SET_GAIN, "opus: could not set gain"), \
+       PARA_ERROR(PATH_FOUND, ""), /* not really an error */ \
+       PARA_ERROR(PERM, "permission denied"), \
+       PARA_ERROR(PLAYLIST_EMPTY, "attempted to load empty playlist"), \
+       PARA_ERROR(PLAYLIST_LOADED, ""), /* not really an error */ \
+       PARA_ERROR(PLAY_SYNTAX, "para_play: syntax error"), \
+       PARA_ERROR(PREBUFFER_SUCCESS, "prebuffering complete"), \
        PARA_ERROR(PRIVATE_KEY, "can not read private key"), \
        PARA_ERROR(PUBLIC_KEY, "can not read public key"), \
+       PARA_ERROR(QUEUE, "packet queue overrun"), \
+       PARA_ERROR(READ_PATTERN, "did not read expected pattern"), \
+       PARA_ERROR(RECV_EOF, "end of file"), \
+       PARA_ERROR(RECVMSG, "recvmsg() failed"), \
+       PARA_ERROR(RECV_SYNTAX, "recv syntax error"), \
+       PARA_ERROR(REGEX, "regular expression error"), \
+       PARA_ERROR(RESAMPLE_EOF, "resample filter: end of file"), \
        PARA_ERROR(RSA, "RSA error"), \
-       PARA_ERROR(ENCRYPT, "encrypt error"), \
-       PARA_ERROR(DECRYPT, "decrypt error"), \
-       PARA_ERROR(BLINDING, "failed to activate key blinding"), \
-       PARA_ERROR(BIGNUM, "bignum error"), \
- #define GCRYPT_ERRORS \
-       PARA_ERROR(MPI_SCAN, "could not scan multi-precision integer"), \
-       PARA_ERROR(MPI_PRINT, "could not convert multi-precision integer"), \
-       PARA_ERROR(SEXP_FIND, "could not find sublist in S-expression"), \
-       PARA_ERROR(SEXP_BUILD, "could not build S-expression"), \
-       PARA_ERROR(SEXP_ENCRYPT, "could not encrypt S-expression"), \
-       PARA_ERROR(SEXP_DECRYPT, "could not decrypt S-expression"), \
-       PARA_ERROR(BAD_PRIVATE_KEY, "invalid private key"), \
-       PARA_ERROR(KEY_MARKER, "invalid/missing key header or footer"), \
-       PARA_ERROR(ASN1_PARSE, "could not parse ASN.1 key"), \
-       PARA_ERROR(SSH_PARSE, "could not parse ssh public key"), \
-       PARA_ERROR(OEAP, "error during oeap (un)padding"), \
- #define COMMAND_ERRORS \
-       PARA_ERROR(COMMAND_SYNTAX, "syntax error in command"), \
-       PARA_ERROR(AUTH_REQUEST, "did not receive auth request"), \
-       PARA_ERROR(NO_AUDIO_FILE, "no audio file"), \
-       PARA_ERROR(BAD_CMD, "invalid command"), \
-       PARA_ERROR(PERM, "permission denied"), \
-       PARA_ERROR(LOCK, "lock error"), \
+       PARA_ERROR(SB_PACKET_SIZE, "invalid sideband packet size or protocol error"), \
+       PARA_ERROR(SCM_CREDENTIALS, "did not receive SCM credentials"), \
        PARA_ERROR(SENDER_CMD, "command not supported by this sender"), \
+       PARA_ERROR(SENDMSG, "sendmsg() failed"), \
+       PARA_ERROR(SERVER_CMD_FAILURE, "command failed"), \
+       PARA_ERROR(SERVER_CMD_SUCCESS, "command terminated successfully"), \
        PARA_ERROR(SERVER_CRASH, "para_server crashed -- can not live without it"), \
-       PARA_ERROR(BAD_USER, "auth request for invalid user"), \
-       PARA_ERROR(BAD_FEATURE, "invalid feature request"), \
-       PARA_ERROR(BAD_AUTH, "authentication failure"), \
- #define DCCP_RECV_ERRORS \
-       PARA_ERROR(DCCP_OVERRUN, "dccp output buffer buffer overrun"), \
- #define FD_ERRORS \
-       PARA_ERROR(FGETS, "fgets error"), \
-       PARA_ERROR(EOF, "end of file"), \
-       PARA_ERROR(READ_PATTERN, "did not read expected pattern"), \
+       PARA_ERROR(SERVER_EOF, "connection closed by para_server"), \
+       PARA_ERROR(SEXP_BUILD, "could not build S-expression"), \
+       PARA_ERROR(SEXP_DECRYPT, "could not decrypt S-expression"), \
+       PARA_ERROR(SEXP_ENCRYPT, "could not encrypt S-expression"), \
+       PARA_ERROR(SEXP_FIND, "could not find sublist in S-expression"), \
        PARA_ERROR(SHORT_WRITE, "unexpected short write"), \
-       PARA_ERROR(EMPTY, "file is empty"), \
- #define ALSA_WRITE_ERRORS \
-       PARA_ERROR(ALSA, "alsa error"), \
- #define WRITE_COMMON_ERRORS \
+       PARA_ERROR(SIZE_PREFIX, "bad size prefix"), \
+       PARA_ERROR(SPX_COMMENT, "invalid speex comment"), \
+       PARA_ERROR(SPX_CTL_BAD_RQ, "speex_decoder_ctl: invalid request"), \
+       PARA_ERROR(SPX_CTL_INVAL, "speex_decoder_ctl: invalid argument"), \
+       PARA_ERROR(SPX_DECODE_OVERFLOW, "speex decoding overflow"), \
+       PARA_ERROR(SPX_DECODER_INIT, "speex decoder initialization failed"), \
+       PARA_ERROR(SPX_DECODE, "speex decoding error"), \
+       PARA_ERROR(SPX_EOS, "speex: end of stream"), \
+       PARA_ERROR(SPX_HEADER, "can not read speex header"), \
+       PARA_ERROR(SPX_HEADER_MODE, "invalid speex mode in header"), \
+       PARA_ERROR(SPX_VERSION, "incompatible speex bit stream version"), \
+       PARA_ERROR(SSH_KEY_HEADER, "ssh key header not found"), \
+       PARA_ERROR(SSH_PARSE, "could not parse ssh public key"), \
+       PARA_ERROR(STAT_ITEM_PARSE, "failed to parse status item"), \
+       PARA_ERROR(STATUS_TIMEOUT, "status item timeout"), \
+       PARA_ERROR(STCO, "did not find stco atom"), \
+       PARA_ERROR(STREAM_FORMAT, "could not set stream format"), \
+       PARA_ERROR(STREAM_PACKETIN, "ogg stream packet-in error"), \
+       PARA_ERROR(STREAM_PACKETOUT, "ogg stream packet-out error"), \
+       PARA_ERROR(STREAM_PAGEIN, "ogg stream page-in error"), \
+       PARA_ERROR(STREAM_PAGEOUT, "ogg stream page-out error"), \
+       PARA_ERROR(STRFTIME, "strftime() failed"), \
+       PARA_ERROR(STSZ, "did not find stcz atom"), \
+       PARA_ERROR(SYNC_COMPLETE, "all buddies in sync"), \
+       PARA_ERROR(SYNC_LISTEN_FD, "no fd to listen on"), \
+       PARA_ERROR(SYNC_PAGEOUT, "ogg sync page-out error (no ogg file?)"), \
+       PARA_ERROR(TARGET_EXISTS, "requested target is already present"),\
+       PARA_ERROR(TARGET_NOT_FOUND, "requested target not found"), \
+       PARA_ERROR(TASK_STARTED, "task started"), \
+       PARA_ERROR(TOO_MANY_CLIENTS, "maximal number of stat clients exceeded"), \
+       PARA_ERROR(UCRED_PERM, "permission denied"), \
+       PARA_ERROR(UDP_OVERRUN, "output buffer overrun"), \
+       PARA_ERROR(UNIT_INIT, "AudioUnitInitialize() error"), \
+       PARA_ERROR(UNIT_START, "AudioUnitStart() error"), \
+       PARA_ERROR(UNKNOWN_STAT_ITEM, "status item not recognized"), \
+       PARA_ERROR(UNSUPPORTED_AUDIO_FORMAT, "given audio format not supported"), \
+       PARA_ERROR(UNSUPPORTED_FILTER, "given filter not supported"), \
+       PARA_ERROR(USERLIST, "failed to open user list file"), \
+       PARA_ERROR(VLC, "invalid vlc code"), \
+       PARA_ERROR(VORBIS_COMMENTHEADER, "could not create vorbis comment header"), \
+       PARA_ERROR(VORBIS, "vorbis synthesis header-in error (not vorbis?)"), \
+       PARA_ERROR(WAV_BAD_FC, "invalid filter configuration"), \
+       PARA_ERROR(WAV_EOF, "wav filter: end of file"), \
+       PARA_ERROR(WAV_SUCCESS, "successfully wrote wav header"), \
+       PARA_ERROR(WMA_BAD_PARAMS, "invalid WMA parameters"), \
+       PARA_ERROR(WMA_BAD_SUPERFRAME, "invalid superframe"), \
+       PARA_ERROR(WMA_BLOCK_SIZE, "invalid block size"), \
+       PARA_ERROR(WMADEC_EOF, "wmadec: end of file"), \
+       PARA_ERROR(WMA_NO_GUID, "audio stream guid not found"), \
+       PARA_ERROR(WMA_OUTPUT_SPACE, "insufficient output space"), \
        PARA_ERROR(WRITE_COMMON_EOF, "end of file"), \
  
- #define AACDEC_FILTER_ERRORS \
-       PARA_ERROR(AACDEC_INIT, "failed to init aac decoder"), \
-       PARA_ERROR(AAC_DECODE, "aac decode error"), \
- #define CHUNK_QUEUE_ERRORS \
-       PARA_ERROR(QUEUE, "packet queue overrun"), \
- #define INTERACTIVE_ERRORS \
-       PARA_ERROR(I9E_EOF, "end of input"), \
-       PARA_ERROR(I9E_SETUPTERM, "failed to set up terminal"), \
-       PARA_ERROR(I9E_TERM_RQ, "received termination request"), \
- /** \endcond errors */
- /**
-  * The subsystem shift.
-  *
-  * 255 error codes ought to be enough for every subsystem. Use the higher bits
-  * of the return value to encode the subsystem number.
-  */
- #define SS_SHIFT 8
- /**
-  * Compute the subsystem offset.
-  *
-  * It is given by x * 2**8 where \a x is the subsystem number.
-  */
- #define SS_OFFSET(ss) (SS_ ## ss << SS_SHIFT)
- /**
-  * Make the enum of all errors of one subsystem.
-  *
-  * As zero should not be an error, we define a dummy enum entry with value
-  * 2**ss. That lets the real errors start at 2**ss + 1.
-  */
- #define SS_ENUM(ss) enum {\
-       E_ ## ss ## _DUMMY = SS_OFFSET(ss), \
-       ss ## _ERRORS}
- /**
-  * Determine the subsystem number from the error number.
-  *
-  * Easy, it's just \a num / 2**8.
-  */
- #define ERRNUM_TO_SS(num) ((num) >> SS_SHIFT)
  /**
-  * Determine the index of an error number.
-  *
-  * Also easy: It's the lower 8 bits of num.
+  * This is temporarily defined to expand to its first argument (prefixed by
+  * 'E_') and gets later redefined to expand to the error text only
   */
- #define ERRNUM_TO_INDEX(num) (((1 << SS_SHIFT) - 1) & (num))
+ #define PARA_ERROR(err, msg) E_ ## err
+ enum para_error_codes {PARA_ERRORS};
+ #undef PARA_ERROR
+ #define PARA_ERROR(err, msg) msg
+ /** Array of error strings. */
+ extern const char * const para_errlist[];
+ #define DEFINE_PARA_ERRLIST const char * const para_errlist[] = {PARA_ERRORS}
  
  /**
   * This bit indicates whether a number is considered a system error number
  /** Set the osl error bit for the given number. */
  #define OSL_ERRNO_TO_PARA_ERROR(num) ((num) | (1 << OSL_ERROR_BIT))
  
  static const char *weak_osl_strerror(int) __attribute__ ((weakref("osl_strerror")));
  /**
   * Paraslash's version of strerror(3).
@@@ -598,7 -316,7 +316,7 @@@ _static_inline_ const char *para_strerr
        }
        if (IS_SYSTEM_ERROR(num))
                return strerror(num & ~(1U << SYSTEM_ERROR_BIT));
-       return para_errlist[ERRNUM_TO_SS(num)][ERRNUM_TO_INDEX(num)];
+       return para_errlist[num];
  }
  
  /**
@@@ -618,31 -336,3 +336,3 @@@ _static_inline_ int osl(int ret
                return ret;
        return -OSL_ERRNO_TO_PARA_ERROR(-ret);
  }
- /**
-  * Define the error list for one subsystem.
-  *
-  * The first entry (index 0) is always the name of the subsystem. Used by
-  * macros in config.h (generated by configure).
-  */
- #define DEFINE_ERRLIST(ss) const char * ss ## _ERRLIST[] = {#ss, ss ## _ERRORS}
- /**
-  * Activate errors for one subsystem.
-  *
-  * Each executable needs only the error lists of those subsystems it is
-  * actually linked with. We always reserve space for NUM_SS char pointers,
-  * but only init those of the needed subsystems. This macro is used by macros
-  * in config.h (generated by configure).
-  */
- #define PARA_ERRLIST(ss) [SS_ ## ss] = ss ## _ERRLIST
- /**
-  * This is temporarily defined to expand to its first argument (prefixed by
-  * 'E_') and gets later redefined to expand to the error text only
-  */
- #define PARA_ERROR(err, msg) E_ ## err
- #include "error2.h"
- #undef PARA_ERROR
- /* Rest of the world only sees the error text. */
- #define PARA_ERROR(err, msg) msg
diff --combined fade.c
index 2a001ebacde964eb1f710413540cc23f2bc85699,2ade4710b11c2e56972cb9c86c8cfd9a95a9f64e..67dc4d5494c13ea8d6d167d56502b5818146bcff
--- 1/fade.c
--- 2/fade.c
+++ b/fade.c
@@@ -17,7 -17,9 +17,9 @@@
  #include "ggo.h"
  #include "version.h"
  
- INIT_FADE_ERRLISTS;
+ /** Array of error strings. */
+ DEFINE_PARA_ERRLIST;
  static struct fade_args_info conf;
  
  enum mixer_id {MIXER_ENUM};
@@@ -67,7 -69,7 +69,7 @@@ static int fade(struct mixer *m, struc
        if (ret < 0)
                goto out;
        vol = ret;
 -      PARA_NOTICE_LOG("fading %s from %d to %d in %d seconds\n",
 +      PARA_NOTICE_LOG("fading %s from %d to %d in %u seconds\n",
                conf.mixer_channel_arg, vol, new_vol, secs);
        diff = new_vol - vol;
        if (!diff) {
@@@ -203,7 -205,7 +205,7 @@@ static int sweet_dreams(struct mixer *m
                tm = localtime(&t1);
        }
        wake_time_epoch = mktime(tm);
 -      PARA_INFO_LOG("waketime: %u:%02u\n", tm->tm_hour, tm->tm_min);
 +      PARA_INFO_LOG("waketime: %d:%02d\n", tm->tm_hour, tm->tm_min);
        client_cmd("stop");
        sleep(1);
        if (fot) {
@@@ -333,17 -335,6 +335,17 @@@ __noreturn static void print_help_and_d
        exit(0);
  }
  
 +/**
 + * The main function of para_fade.
 + *
 + * The executable is linked with the alsa or the oss mixer API, or both. It has
 + * a custom log function which prefixes log messages with the current date.
 + *
 + * \param argc Argument counter.
 + * \param argv Argument vector.
 + *
 + * \return EXIT_SUCCESS or EXIT_FAILURE.
 + */
  int main(int argc, char *argv[])
  {
        int ret;
diff --combined gui.c
index 3e01340a4b1b910245f22be77e75945ae25bc1ca,63afca07fd1839fa5626d3139edd4c7450e38647..8e83cc53c6d55f53ccdb0a9dfbb4c89f0bb7525a
--- 1/gui.c
--- 2/gui.c
+++ b/gui.c
@@@ -26,8 -26,9 +26,9 @@@
  #include "ggo.h"
  #include "version.h"
  
- /** define the array of error lists needed by para_gui */
- INIT_GUI_ERRLISTS;
+ /** Array of error strings. */
+ DEFINE_PARA_ERRLIST;
  static char *stat_content[NUM_STAT_ITEMS];
  
  static struct gui_window {
@@@ -1160,7 -1161,7 +1161,7 @@@ static void print_scroll_msg(void
        unsigned lines_total, filled = ringbuffer_filled(bot_win_rb);
        int first_rbe = first_visible_rbe(&lines_total);
  
 -      print_in_bar(COLOR_MSG, "scrolled view: %d-%d/%d\n", filled - first_rbe,
 +      print_in_bar(COLOR_MSG, "scrolled view: %u-%u/%u\n", filled - first_rbe,
                filled - scroll_position, ringbuffer_filled(bot_win_rb));
  }
  
diff --combined play.c
index 46e8ff7d6f099e016cca6338dc399e210b9e5c97,034e0f6f189a54cb9e7d4cb365dec0c4dbcc66c0..fac551aa161d14f258e1495a4530462ca1146357
--- 1/play.c
--- 2/play.c
+++ b/play.c
@@@ -36,6 -36,9 +36,9 @@@
   * Playlist handling is done exclusively in play context.
   */
  
+ /** Array of error strings. */
+ DEFINE_PARA_ERRLIST;
  /**
   * Describes a request to change the state of para_play.
   *
@@@ -95,9 -98,6 +98,6 @@@ struct play_task 
        char *afhi_txt;
  };
  
- /** Initialize the array of errors for para_play. */
- INIT_PLAY_ERRLISTS;
  /* Activate the afh receiver. */
  extern void afh_recv_init(struct receiver *r);
  #undef AFH_RECEIVER
@@@ -328,7 -328,8 +328,7 @@@ static int open_new_file(struct play_ta
        pt->rn.receiver = afh_recv;
        ret = afh_recv->open(&pt->rn);
        if (ret < 0) {
 -              PARA_ERROR_LOG("could not open %s: %s\n", path,
 -                      para_strerror(-ret));
 +              PARA_ERROR_LOG("could not open %s\n", path);
                goto fail;
        }
        pt->audio_format_num = ret;
@@@ -387,7 -388,6 +387,7 @@@ static int load_file(struct play_task *
        /* set up decoding filter */
        af = audio_format_name(pt->audio_format_num);
        tmp = make_message("%sdec", af);
 +      PARA_INFO_LOG("decoder: %s\n", tmp);
        ret = check_filter_arg(tmp, &pt->fn.conf);
        freep(&tmp);
        if (ret < 0)
                        .handler = decoder->execute, .context = &pt->fn));
        if (decoder->open)
                decoder->open(&pt->fn);
 +      PARA_INFO_LOG("buffer tree:\n");
 +      btr_log_tree(pt->rn.btrn, LL_INFO);
  
        /* setup default writer */
        pt->wn.conf = check_writer_arg_or_die(NULL, &pt->wn.writer_num);
@@@ -455,8 -453,6 +455,8 @@@ again
                pt->next_file = pt->current_file;
        ret = load_file(pt);
        if (ret < 0) {
 +              PARA_ERROR_LOG("%s: marking file as invalid\n",
 +                      para_strerror(-ret));
                pt->invalid[pt->next_file] = true;
                pt->rq = CRT_NONE;
                goto again;
@@@ -788,7 -784,7 +788,7 @@@ static void list_file(struct play_task 
        char *buf;
        size_t sz;
  
 -      sz = xasprintf(&buf, "%s %4u %s\n", num == pt->current_file?
 +      sz = xasprintf(&buf, "%s %4d %s\n", num == pt->current_file?
                "*" : " ", num, conf.inputs[num]);
        btr_add_output(buf, sz, pt->btrn);
  }
diff --combined server.c
index 1f93194474374e7450fec6a4895309c4529c5226,59a620477d092579a3e6d692e1b405dae7927a6b..a023b1526931c1eeeb3fcec7be3a6b6c72662c69
+++ b/server.c
@@@ -18,7 -18,7 +18,7 @@@
   *    - Buffer trees: \ref buffer_tree.h,
   *    - Sideband API: \ref sideband.h,
   *    - Crypto: \ref crypt.h, \ref crypt_backend.h,
-  *    - Error subsystem: \ref error.h, \ref error2.c,
+  *    - Error subsystem: \ref error.h,
   *    - Inter process communication: \ref ipc.h,
   *    - Forward error correction: \ref fec.h,
   *    - Daemons: \ref daemon.h,
  #include "ggo.h"
  #include "version.h"
  
- __printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log;
+ /** Array of error strings. */
+ DEFINE_PARA_ERRLIST;
  
- /** Define the array of error lists needed by para_server. */
- INIT_SERVER_ERRLISTS;
+ __printf_2_3 void (*para_log)(int, const char*, ...) = daemon_log;
  
  /** Shut down non-authorized connections after that many seconds. */
  #define ALARM_TIMEOUT 10
@@@ -411,9 -411,8 +411,9 @@@ static int init_afs(int argc, char **ar
  {
        int ret, afs_server_socket[2];
        pid_t afs_pid;
 +      char c;
  
 -      ret = socketpair(PF_UNIX, SOCK_DGRAM, 0, afs_server_socket);
 +      ret = socketpair(PF_UNIX, SOCK_STREAM, 0, afs_server_socket);
        if (ret < 0)
                exit(EXIT_FAILURE);
        get_random_bytes_or_die((unsigned char *)&afs_socket_cookie,
                exit(EXIT_FAILURE);
        if (afs_pid == 0) { /* child (afs) */
                int i;
 +
                for (i = argc - 1; i >= 0; i--)
                        memset(argv[i], 0, strlen(argv[i]));
                sprintf(argv[0], "para_server (afs)");
        }
        mmd->afs_pid = afs_pid;
        close(afs_server_socket[1]);
 +      if (read(afs_server_socket[0], &c, 1) <= 0) {
 +              PARA_EMERG_LOG("early afs exit\n");
 +              exit(EXIT_FAILURE);
 +      }
        ret = mark_fd_nonblocking(afs_server_socket[0]);
        if (ret < 0)
                exit(EXIT_FAILURE);
@@@ -463,7 -457,7 +463,7 @@@ static void server_init(int argc, char 
                .check_ambiguity = 0,
                .print_errors = 1
        };
 -      int afs_socket;
 +      int afs_socket, daemon_pipe = -1;
  
        valid_fd_012();
        init_random_seed_or_die();
        init_user_list(user_list_file);
        /* become daemon */
        if (conf.daemon_given)
 -              daemonize(true /* parent waits for SIGTERM */);
 +              daemon_pipe = daemonize(true /* parent waits for us */);
        PARA_NOTICE_LOG("initializing audio format handlers\n");
        afh_init();
  
        PARA_NOTICE_LOG("initializing virtual streaming system\n");
        init_vss_task(afs_socket, &sched);
        init_server_command_task(argc, argv);
 -      if (conf.daemon_given)
 -              kill(getppid(), SIGTERM);
 +      if (daemon_pipe >= 0) {
 +              if (write(daemon_pipe, "\0", 1) < 0) {
 +                      PARA_EMERG_LOG("daemon_pipe: %s", strerror(errno));
 +                      exit(EXIT_FAILURE);
 +              }
 +              close(daemon_pipe);
 +      }
        PARA_NOTICE_LOG("server init complete\n");
  }
  
@@@ -537,7 -526,7 +537,7 @@@ out
        prev_uptime = uptime;
        prev_events = mmd->events;
        mmd->vss_status_flags = mmd->new_vss_status_flags;
 -      PARA_DEBUG_LOG("%d events, forcing status update\n", mmd->events);
 +      PARA_DEBUG_LOG("%u events, forcing status update\n", mmd->events);
        killpg(0, SIGUSR1);
  }