Rename struct audio_format_info to afh_info.
[paraslash.git] / server.c
index c3244132ccb1323eb448fa1a20a619332b71ef0d..f86fb8b26b6111d2acacaeccceb108424441f616 100644 (file)
--- a/server.c
+++ b/server.c
@@ -7,57 +7,58 @@
 /** \file server.c Paraslash's main server. */
 
 
-/** \mainpage Paraslash API Reference
+/**
+ * \mainpage Paraslash API Reference
  *
  * Starting points for getting an overview are
  *
  * probably:
  *
  *     - The main programs: \ref server.c, \ref audiod.c, \ref client.c,
- *       \ref audioc.c, \ref fsck.c
+ *       \ref audioc.c, \ref fsck.c,
  *     - Server: \ref server_command, \ref sender,
  *     - Audio file selector: \ref audio_format_handler, \ref mood, \ref afs_table,
- *     - Client: \ref receiver, \ref receiver_node, \ref filter, \ref filter_node
+ *     - Client: \ref receiver, \ref receiver_node, \ref filter, \ref filter_node.
  *
  *
  * The gory details, listed by topic:
  *
- *     - Audio format handlers: \ref mp3_afh.c, \ref ogg_afh.c \ref aac_afh.c
- *     - Decoders: \ref mp3dec.c, \ref \ref oggdec.c, \ref aacdec.c
- *     - Volume normalizer: \ref compress.c
- *     - Output: \ref alsa_write.c, \ref osx_write.c
- *     - http: \ref http_recv.c, \ref http_send.c
- *     - ortp: \ref ortp_recv.c, \ref ortp_send.c
- *     - dccp: \ref dccp_recv.c, \ref dccp_send.c
- *     - Audio file selector: \ref afs.c, \ref aft.c, \ref mood.c
+ *     - Audio format handlers: \ref mp3_afh.c, \ref ogg_afh.c \ref aac_afh.c,
+ *     - Decoders: \ref mp3dec.c, \ref \ref oggdec.c, \ref aacdec.c,
+ *     - Volume normalizer: \ref compress.c,
+ *     - Output: \ref alsa_write.c, \ref osx_write.c,
+ *     - http: \ref http_recv.c, \ref http_send.c,
+ *     - ortp: \ref ortp_recv.c, \ref ortp_send.c,
+ *     - dccp: \ref dccp_recv.c, \ref dccp_send.c,
+ *     - Audio file selector: \ref afs.c, \ref aft.c, \ref mood.c,
  *     - Afs structures: \ref afs_table, \ref audio_file_data,
- *       \ref afs_info \ref audio_format_info,
+ *       \ref afs_info \ref afh_info,
  *     - Afs tables: \ref aft.c, \ref mood.c, \ref playlist.c,
- *       \ref attribute.c, \ref score.c.
+ *       \ref attribute.c, \ref score.c,
+ *     - The virtual streaming system: \ref vss.c, \ref chunk_queue.c.
  *
  * Lower levels:
  *
- *     - Scheduling: \ref sched.c, \ref sched.h
+ *     - Scheduling: \ref sched.c, \ref sched.h,
  *     - Networking: \ref net.c,
  *     - File descriptors: \ref fd.c,
  *     - Signals: \ref signal.c,
  *     - Daemons: \ref daemon.c,
- *     - Strings: \ref string.c, string.h
- *     - Time: \ref time.c, time.h
- *     - Spawning processes: \ref exec.c
- *     - Inter process communication: ipc.c,
+ *     - Strings: \ref string.c, \ref string.h,
+ *     - Time: \ref time.c,
+ *     - Spawning processes: \ref exec.c,
+ *     - Inter process communication: \ref ipc.c,
  *     - The object storage layer: \ref osl.c,
- *     - Blob tables: blob.c,
- *     - Queueing chunks of audio data: \ref chunk_queue.c
- *     - The error subssystem: \ref error.h
+ *     - Blob tables: \ref blob.c,
+ *     - The error subssystem: \ref error.h.
  *
- * Lov-level data structures:
+ * Low-level data structures:
  *
  *     - Doubly linked lists: \ref list.h,
- *     - Red-black trees: \ref rbtree.h, \ref rbtree.c
- *     - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h
- *     - Hashing: \ref hash.h, \ref sha1.h, \ref sha1.c
- *     - Crypto: \ref crypt.c
+ *     - Red-black trees: \ref rbtree.h, \ref rbtree.c,
+ *     - Ring buffer: \ref ringbuffer.c, \ref ringbuffer.h,
+ *     - Hashing: \ref hash.h, \ref sha1.h, \ref sha1.c,
+ *     - Crypto: \ref crypt.c.
  *
  */
 
@@ -369,7 +370,7 @@ static void init_afs(void)
 }
 
 
-static unsigned do_inits(int argc, char **argv)
+static unsigned server_init(int argc, char **argv)
 {
        /* connector's address information */
        int sockfd;
@@ -388,17 +389,19 @@ static unsigned do_inits(int argc, char **argv)
        /* become daemon */
        if (conf.daemon_given)
                daemon_init();
-       PARA_NOTICE_LOG("%s", "initializing virtual streaming system\n");
+       PARA_NOTICE_LOG("initializing audio format handlers\n");
        afh_init();
+       PARA_NOTICE_LOG("initializing virtual streaming system\n");
        vss_init();
        mmd->server_pid = getpid();
        setup_signal_handling();
+       PARA_NOTICE_LOG("initializing the audio file selector\n");
        init_afs();
        mmd_lock();
        /* init network socket */
-       PARA_NOTICE_LOG("%s", "initializing tcp command socket\n");
+       PARA_NOTICE_LOG("initializing tcp command socket\n");
        sockfd = init_network();
-       PARA_NOTICE_LOG("%s", "init complete\n");
+       PARA_NOTICE_LOG("server init complete\n");
        return sockfd;
 }
 
@@ -459,7 +462,7 @@ int main(int argc, char *argv[])
        struct timeval *timeout;
 
        valid_fd_012();
-       sockfd = do_inits(argc, argv);
+       sockfd = server_init(argc, argv);
 repeat:
        FD_ZERO(&rfds);
        FD_ZERO(&wfds);