audiod: Add missing documentation
[paraslash.git] / audiod.c
index ec9f34d5ad52e0fdc32bca3e1059553272a7de6d..9d0d0741cb86dd2e94c78eff1ed3503df5edbdd6 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -66,12 +66,28 @@ struct audio_format_info {
        struct timeval restart_barrier;
 };
 
        struct timeval restart_barrier;
 };
 
+/**
+ * para_audiod uses \p MAX_STREAM_SLOTS different slots, each of which may
+ * be associated with a receiver/filter/writer triple. This array holds all
+ * information on the status of these slots.
+ *
+ * \sa struct slot_info
+ * */
 struct slot_info slot[MAX_STREAM_SLOTS];
 
 
 struct slot_info slot[MAX_STREAM_SLOTS];
 
 
+/**
+ * the current mode of operation of which can be changed by the on/off/cycle
+ * commands. It is either, AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY.
+ */
 int audiod_status = AUDIOD_ON;
 
 int audiod_status = AUDIOD_ON;
 
+/**
+ * the gengetopt args_info struct that holds information on all command line
+ * arguments
+ */
 struct audiod_args_info conf;
 struct audiod_args_info conf;
+
 static char *socket_name;
 static FILE *logfile;
 static struct audio_format_info afi[NUM_AUDIO_FORMATS];
 static char *socket_name;
 static FILE *logfile;
 static struct audio_format_info afi[NUM_AUDIO_FORMATS];
@@ -79,6 +95,12 @@ static struct audio_format_info afi[NUM_AUDIO_FORMATS];
 static struct signal_task signal_task_struct, *sig_task = &signal_task_struct;
 
 static struct status_task status_task_struct;
 static struct signal_task signal_task_struct, *sig_task = &signal_task_struct;
 
 static struct status_task status_task_struct;
+
+/**
+ * the task that calls the status command of para_server
+ *
+ * \sa struct status_task
+ */
 struct status_task *stat_task = &status_task_struct;
 static struct timeval initial_delay_barrier;
 
 struct status_task *stat_task = &status_task_struct;
 static struct timeval initial_delay_barrier;
 
@@ -125,8 +147,11 @@ int get_audio_format_num(char *name)
        return -E_UNSUPPORTED_AUDIO_FORMAT;
 }
 
        return -E_UNSUPPORTED_AUDIO_FORMAT;
 }
 
-/*
- * log function. first argument is loglevel.
+/**
+ * the log function of para_audiod
+ *
+ * \param ll loglevel
+ * \param fmt the format string
  */
 void para_log(int ll, const char* fmt,...)
 {
  */
 void para_log(int ll, const char* fmt,...)
 {
@@ -960,6 +985,18 @@ static void close_stat_pipe(void)
        }
 }
 
        }
 }
 
+/**
+ * close the connection to para_server and exit
+ *
+ * \param status the exit status which is passed to exit(3)
+ * \param msg the log message
+ *
+ * Log \a msg with loglevel \p EMERG, close the connection to para_server if
+ * open, and call \p exit(status). \a status should be either EXIT_SUCCESS or
+ * EXIT_FAILURE.
+ *
+ * \sa exit(3)
+ */
 void __noreturn clean_exit(int status, const char *msg)
 {
        PARA_EMERG_LOG("%s\n", msg);
 void __noreturn clean_exit(int status, const char *msg)
 {
        PARA_EMERG_LOG("%s\n", msg);
@@ -1073,6 +1110,16 @@ static void set_initial_status(void)
                PARA_WARNING_LOG("%s", "invalid mode\n");
 }
 
                PARA_WARNING_LOG("%s", "invalid mode\n");
 }
 
+/**
+ * the main function of para_audiod
+ *
+ * \param argc usual argument count
+ * \param argv usual argument vector
+ *
+ * \return EXIT_SUCCESS or EXIT_FAILURE
+ *
+ * \sa para_audiod(1)
+ * */
 int main(int argc, char *argv[])
 {
        char *cf;
 int main(int argc, char *argv[])
 {
        char *cf;