switch to the new struct writer/writer_node abstraction
[paraslash.git] / error.h
diff --git a/error.h b/error.h
index a3755cef5824011de968ec5ce30af6e8045c7773..583d2ce510bc3b3a7f617e35daf2e44a5c972de1 100644 (file)
--- a/error.h
+++ b/error.h
 /** \file error.h list of error messages for all subsystems */
 
 /** \cond list of all subsystems that support the shiny new error facility */
-enum para_subsystem {SS_RECV,
-       SS_NET, SS_ORTP_RECV, SS_AUDIOD, SS_EXEC, SS_CLOSE_ON_FORK, SS_SIGNAL,
-       SS_STRING, SS_DAEMON, SS_STAT, SS_TIME, SS_GRAB_CLIENT, SS_HTTP_RECV,
-       SS_RECV_COMMON, SS_FILTER_CHAIN, SS_WAV, SS_COMPRESS, SS_OGGDEC, SS_FILTER,
-       SS_COMMAND, SS_RANDOM_DBTOOL, SS_PLM_DBTOOL, SS_CRYPT, SS_HTTP_SEND, SS_ORTP_SEND, SS_DB, SS_OGG,
-       SS_MP3, SS_MP3DEC, SS_SERVER, SS_AFS, SS_MYSQL, SS_RINGBUFFER};
+enum para_subsystem {
+       SS_RECV,
+       SS_NET,
+       SS_ORTP_RECV,
+       SS_AUDIOD,
+       SS_EXEC,
+       SS_CLOSE_ON_FORK,
+       SS_SIGNAL,
+       SS_STRING,
+       SS_DAEMON,
+       SS_STAT,
+       SS_TIME,
+       SS_GRAB_CLIENT,
+       SS_HTTP_RECV,
+       SS_RECV_COMMON,
+       SS_FILTER_CHAIN,
+       SS_WAV,
+       SS_COMPRESS,
+       SS_OGGDEC,
+       SS_FILTER,
+       SS_COMMAND,
+       SS_RANDOM_SELECTOR,
+       SS_PLAYLIST_SELECTOR,
+       SS_CRYPT,
+       SS_HTTP_SEND,
+       SS_ORTP_SEND,
+       SS_DB,
+       SS_OGG,
+       SS_MP3,
+       SS_MP3DEC,
+       SS_SERVER,
+       SS_AFS,
+       SS_MYSQL_SELECTOR,
+       SS_IPC,
+       SS_DCCP,
+       SS_DCCP_RECV,
+       SS_DCCP_SEND,
+       SS_FD,
+       SS_GUI,
+       SS_PLAY,
+       SS_ALSA,
+       SS_RINGBUFFER};
+
 #define NUM_SS (SS_RINGBUFFER + 1)
 extern const char **para_errlist[];
 /** \endcond */
@@ -102,11 +139,11 @@ extern const char **para_errlist[];
 #define GRAB_CLIENT_ERRORS \
        PARA_ERROR(PEDANTIC_GRAB, "fd not ready and pedantic grab requested"), \
        PARA_ERROR(GC_WRITE, "grab client write error"), \
-       PARA_ERROR(INVALID_GRAB_MODE, "invalid grab client mode"), \
        PARA_ERROR(BAD_GC_SLOT, "invalid slot requested by grab client"), \
        PARA_ERROR(BAD_GC_FILTER_NUM, "invalid filter number given"), \
        PARA_ERROR(GC_SYNTAX, "grab client syntax error"), \
        PARA_ERROR(GC_HELP_GIVEN, ""), /* not really an error */ \
+       PARA_ERROR(GC_VERSION_GIVEN, ""), /* not really an error */ \
 
 
 #define MP3DEC_ERRORS \
@@ -123,6 +160,7 @@ extern const char **para_errlist[];
        PARA_ERROR(SIGNAL_SIG_ERR, "signal() retured SIG_ERR"), \
        PARA_ERROR(SIGNAL_READ, "read error from signal pipe"), \
        PARA_ERROR(WAITPID, "waitpid error"), \
+       PARA_ERROR(SIGNAL_PIPE, "failed to setup signal pipe"), \
 
 
 #define STRING_ERRORS \
@@ -185,12 +223,12 @@ extern const char **para_errlist[];
        PARA_ERROR(WRITE_OK, "can not check whether fd is writable"), \
 
 
-#define RANDOM_DBTOOL_ERRORS \
+#define RANDOM_SELECTOR_ERRORS \
        PARA_ERROR(FILE_COUNT, "audio file count exceeded"), \
        PARA_ERROR(NOTHING_FOUND, "no audio files found"), \
 
 
-#define MYSQL_ERRORS \
+#define MYSQL_SELECTOR_ERRORS \
        PARA_ERROR(MYSQL_SYNTAX, "mysql syntax error"), \
        PARA_ERROR(NOTCONN, "not connected to mysql server"), \
        PARA_ERROR(TOOBIG, "mysql: file too large"), \
@@ -204,6 +242,7 @@ extern const char **para_errlist[];
        PARA_ERROR(GET_AUDIO_FILE, "can not get current audio file"), \
        PARA_ERROR(GET_STREAM, "can not get current stream"), \
        PARA_ERROR(NO_STREAM, "no such stream"), \
+       PARA_ERROR(AUDIO_FILE, "no such audio file"), \
        PARA_ERROR(GET_QUERY, "can not get query for specified stream"), \
        PARA_ERROR(TMPFILE, "error while writing temporary file"), \
        PARA_ERROR(META, "can not get meta data"), \
@@ -215,7 +254,7 @@ extern const char **para_errlist[];
 #define COMMAND_ERRORS \
        PARA_ERROR(COMMAND_SYNTAX, "syntax error in command"), \
        PARA_ERROR(AUTH, "did not receive auth request"), \
-       PARA_ERROR(BAD_DBTOOL, "no such database tool"), \
+       PARA_ERROR(BAD_SELECTOR, "no such audio file selector"), \
        PARA_ERROR(NO_AUDIO_FILE, "no audio file"), \
        PARA_ERROR(BAD_CMD, "invalid command"), \
        PARA_ERROR(PERM, "permission denied"), \
@@ -224,10 +263,67 @@ extern const char **para_errlist[];
        PARA_ERROR(LOCK, "lock error"), \
        PARA_ERROR(SENDER_CMD, "command not supported by this sender"), \
 
-#define PLM_DBTOOL_ERRORS \
+#define PLAYLIST_SELECTOR_ERRORS \
        PARA_ERROR(LOAD_PLAYLIST, "failed to load playlist"), \
 
+
+#define IPC_ERRORS \
+       PARA_ERROR(SEM_GET, "failed to create semaphore"), \
+       PARA_ERROR(SEM_REMOVE, "can not remove semaphore"), \
+       PARA_ERROR(SHM_GET, "failed to allocate shared memory area"), \
+       PARA_ERROR(SHM_DESTROY, "failed to destroy shared memory area"), \
+       PARA_ERROR(SHM_ATTACH, "can not attach shared memory area"), \
+       PARA_ERROR(SHM_DETACH, "can not detach shared memory area"), \
+
+
+#define DCCP_ERRORS \
+       PARA_ERROR(DCCP_SOCKET, "can not create dccp socket"), \
+       PARA_ERROR(DCCP_PACKET_SIZE, "failed to set dccp packet size"), \
+       PARA_ERROR(DCCP_SERVICE, "could not get service code"), \
+
+
+#define DCCP_RECV_ERRORS \
+       PARA_ERROR(ADDR_INFO, "getaddrinfo error"), \
+       PARA_ERROR(DCCP_OVERRUN, "dccp output buffer buffer overrun"), \
+       PARA_ERROR(DCCP_CONNECT, "dccp connect error"), \
+
+#define DCCP_SEND_ERRORS \
+       PARA_ERROR(DCCP_BIND, "dccp bind error"), \
+       PARA_ERROR(DCCP_LISTEN, "dccp listen error"), \
+       PARA_ERROR(DCCP_WRITE, "dccp write error"), \
+
+#define FD_ERRORS \
+       PARA_ERROR(F_GETFL, "failed to get fd flags"), \
+       PARA_ERROR(F_SETFL, "failed to set fd flags"), \
+
+
+#define PLAY_ERRORS \
+       PARA_ERROR(READ_HDR, "failed to read audio file header"), \
+       PARA_ERROR(READ_STDIN, "failed to read from stdin"), \
+       PARA_ERROR(PLAY_SYNTAX, "syntax error"), \
+       PARA_ERROR(BROKEN_CONF, "Broken alsa configuration"), \
+       PARA_ERROR(ACCESS_TYPE, "alsa access type not available"), \
+       PARA_ERROR(SAMPLE_FORMAT, "sample format not available"), \
+       PARA_ERROR(CHANNEL_COUNT, "channels count not available"), \
+       PARA_ERROR(HW_PARAMS, "unable to install hw params"), \
+       PARA_ERROR(SW_PARAMS, "unable to install sw params"), \
+       PARA_ERROR(BAD_PERIOD, "can not use period equal to buffer size"), \
+       PARA_ERROR(GET_XFER, "unable to obtain xfer align"), \
+       PARA_ERROR(SET_XFER, "snd_pcm_sw_params_set_xfer_align() failed"), \
+       PARA_ERROR(ALSA_WRITE, "alsa write error"), \
+       PARA_ERROR(PCM_OPEN, "unable to open pcm"), \
+       PARA_ERROR(SND_PCM_INFO, "pcm info error"), \
+       PARA_ERROR(GET_BUFFER_TIME, "snd_pcm_hw_params_get_buffer_time_max() failed"), \
+       PARA_ERROR(SET_BUFFER_TIME, "snd_pcm_hw_params_set_buffer_time_near() failed"), \
+       PARA_ERROR(SET_RATE, "snd_pcm_hw_params_set_rate_near failed"), \
+       PARA_ERROR(START_THRESHOLD, "snd_pcm_sw_params_set_start_threshold() failed"), \
+       PARA_ERROR(STOP_THRESHOLD, "snd_pcm_sw_params_set_stop_threshold() failed"), \
+       PARA_ERROR(ALSA_LOG, "snd_output_stdio_attach() failed"), \
+
+
+
 /* these do not need error handling (yet) */
+#define ALSA_ERRORS
 #define SERVER_ERRORS
 #define WAV_ERRORS
 #define COMPRESS_ERRORS
@@ -235,6 +331,7 @@ extern const char **para_errlist[];
 #define CLOSE_ON_FORK_ERRORS
 #define DAEMON_ERRORS
 #define ORTP_SEND_ERRORS
+#define GUI_ERRORS
 #define RINGBUFFER_ERRORS
 
 
@@ -333,13 +430,21 @@ SS_ENUM(OGG);
 SS_ENUM(SERVER);
 SS_ENUM(AFS);
 SS_ENUM(COMMAND);
-SS_ENUM(RANDOM_DBTOOL);
-SS_ENUM(PLM_DBTOOL);
+SS_ENUM(RANDOM_SELECTOR);
+SS_ENUM(PLAYLIST_SELECTOR);
 SS_ENUM(CRYPT);
 SS_ENUM(HTTP_SEND);
 SS_ENUM(ORTP_SEND);
 SS_ENUM(DB);
-SS_ENUM(MYSQL);
+SS_ENUM(MYSQL_SELECTOR);
+SS_ENUM(IPC);
+SS_ENUM(DCCP);
+SS_ENUM(DCCP_RECV);
+SS_ENUM(DCCP_SEND);
+SS_ENUM(FD);
+SS_ENUM(GUI);
+SS_ENUM(PLAY);
+SS_ENUM(ALSA);
 SS_ENUM(RINGBUFFER);
 /** \endcond */
 #undef PARA_ERROR