]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Merge branch 't/remove_no_default_filters'
authorAndre Noll <maan@systemlinux.org>
Sat, 5 May 2012 10:50:37 +0000 (12:50 +0200)
committerAndre Noll <maan@systemlinux.org>
Sat, 5 May 2012 10:54:07 +0000 (12:54 +0200)
We have printed a warning for several month if this option was
still used. This should be enough.

18 files changed:
NEWS
afh.c
afh.h
afh_common.c
aft.c
audiod.c
bitstream.c
buffer_tree.c
client.c
command.c
daemon.c
ggo.h
http_recv.c
interactive.c
para.h
recv.h
sched.c
server.c

diff --git a/NEWS b/NEWS
index 4863abe4ddf4db3403067c0c8bd1d329020950e6..0ac2240effe91e4294c8ec901fe18f9c143e42d3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,7 +1,11 @@
 -------------------------------------------
-0.4.11 (to be announced "mutual diversity")
+0.4.11 (to be announced) "mutual diversity"
 -------------------------------------------
 
+       - The --no_default_filters option of para_filter has been
+         removed.
+       - Documentation improvements.
+
 ------------------------------------------
 0.4.10 (2012-03-30) "heterogeneous vacuum"
 ------------------------------------------
@@ -13,7 +17,7 @@ improvements and the usual mix of cleanups and fixes.
          deprecated. It still works but has no effect and will be
          removed in the next version.
        - para_gui now prints also the stderr output of the executing
-          command in the bottom window.
+         command in the bottom window.
        - Cleanup and consolidation of the various wrappers for
          write(), writev(), send() and friends.
        - The obscure error messages on mmap() failures have been
diff --git a/afh.c b/afh.c
index bffe63216e71627dde4b4b49b53c436388500444..5b1cfe9bd1bd367939b9df2ddce2e4069c6df70d 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -18,9 +18,6 @@
 #include "version.h"
 
 static struct afh_args_info conf;
-/** The list of all status items */
-const char *status_item_list[] = {STATUS_ITEM_ARRAY};
-
 INIT_AFH_ERRLISTS;
 
 static int loglevel;
@@ -207,13 +204,7 @@ int main(int argc, char **argv)
                                print_chunk_table(&afhi);
                        printf("\n");
                }
-               free(afhi.techinfo);
-               free(afhi.tags.artist);
-               free(afhi.tags.title);
-               free(afhi.tags.year);
-               free(afhi.tags.album);
-               free(afhi.tags.comment);
-               free(afhi.chunk_table);
+               clear_afhi(&afhi);
                ret2 = para_munmap(audio_file_data, audio_file_size);
                if (ret2 < 0 && ret >= 0)
                        ret = ret2;
diff --git a/afh.h b/afh.h
index a574edf5899f9f43c4abd0f2e6fc39085bb49854..7952809436752f19a795362469291a4996f0d468 100644 (file)
--- a/afh.h
+++ b/afh.h
@@ -104,3 +104,4 @@ void afh_get_chunk(long unsigned chunk_num, struct afh_info *afhi,
 void afh_get_header(struct afh_info *afhi, uint8_t audio_format_id,
                void *map, size_t mapsize, char **buf, size_t *len);
 void afh_free_header(char *header_buf, uint8_t audio_format_id);
+void clear_afhi(struct afh_info *afhi);
index 0d54eea132d8b91973e01971ab945411865ca2bc..5b6301b5f3d06405930df8fbcc64c7095f7ece06 100644 (file)
@@ -33,6 +33,10 @@ void mp3_init(struct audio_format_handler *);
 #endif
 
 void wma_afh_init(struct audio_format_handler *);
+
+/** The list of all status items */
+const char *status_item_list[] = {STATUS_ITEM_ARRAY};
+
 /**
  * The list of supported audio formats.
  *
@@ -217,6 +221,26 @@ success:
        return ret;
 }
 
+/**
+ * Deallocate contents of a filled-in ahi structure
+ *
+ * \param afhi The structure to clear.
+ *
+ * The given pointer is kept, everything else is freed.
+ */
+void clear_afhi(struct afh_info *afhi)
+{
+       if (!afhi)
+               return;
+       free(afhi->chunk_table);
+       free(afhi->techinfo);
+       free(afhi->tags.artist);
+       free(afhi->tags.title);
+       free(afhi->tags.year);
+       free(afhi->tags.album);
+       free(afhi->tags.comment);
+}
+
 /**
  * Get the name of the given audio format.
  *
diff --git a/aft.c b/aft.c
index f89235a484287ce2b5f5aa9081c38fd7a7a5d712..7516e328e9bd63037476b99f37f4bbab5ffd0b37 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1914,15 +1914,7 @@ out_free:
                send_ret = sc_send_va_buffer(&pad->cc->scc,
                        "failed to add %s (%s)\n", path, para_strerror(-ret));
        free(obj.data);
-       if (afhi_ptr) {
-               free(afhi_ptr->chunk_table);
-               free(afhi_ptr->techinfo);
-               free(afhi_ptr->tags.artist);
-               free(afhi_ptr->tags.title);
-               free(afhi_ptr->tags.year);
-               free(afhi_ptr->tags.album);
-               free(afhi_ptr->tags.comment);
-       }
+       clear_afhi(afhi_ptr);
        /* Stop adding files only on send errors. */
        return send_ret;
 }
index 112f632de8c1f23cfdd893ae03fdb5c9e6a89d00..aefac612b480af2d6f1c857b5225f3d042b68ff4 100644 (file)
--- a/audiod.c
+++ b/audiod.c
@@ -77,6 +77,12 @@ enum vss_status_flags {
        VSS_STATUS_FLAG_PLAYING = 2,
 };
 
+/**
+ * The scheduler instance of para_audiod.
+ *
+ * This is needed also in audiod_command.c (for the tasks command), so it can
+ * not be made static.
+ */
 struct sched sched = {.max_fileno = 0};
 
 /**
index 1139edc0d01dfe3668906f747809e0bfb055c18e..ddad67bb177211b3909f88d3be9dcb3d5c381238 100644 (file)
@@ -27,6 +27,7 @@
 #include "wma.h"
 #include "bitstream.h"
 
+/** Read an 8, 16, or 32 bit entity from a VLC table. */
 #define GET_DATA(v, table, i, size) \
 {\
        const uint8_t *ptr = (const uint8_t *)table + i * size; \
@@ -160,6 +161,14 @@ void init_vlc(struct vlc *vlc, int nb_bits, int nb_codes, const void *bits,
        build_table(vlc, nb_bits, nb_codes, bits, codes, codes_size, 0, 0);
 }
 
+/**
+ * Deallocate all resources of a VLC table.
+ *
+ * \param vlc Pointer to an initialized vlc structure.
+ *
+ * The table given by \a vlc must have been initialized earlier via \ref
+ * init_vlc().
+ */
 void free_vlc(struct vlc *vlc)
 {
        freep(&vlc->table);
index 5b4ce19e5f774fd8aaf67fdc42592339f1fb81ac..7d79636fac717f4e4cb8559dec698f8204eed34c 100644 (file)
@@ -761,7 +761,7 @@ void btr_remove_node(struct btr_node *btrn)
 
        if (!btrn)
                return;
-       PARA_NOTICE_LOG("removing btr node %s from buffer tree\n", btrn->name);
+       PARA_INFO_LOG("removing btr node %s from buffer tree\n", btrn->name);
        FOR_EACH_CHILD(ch, btrn)
                ch->parent = NULL;
        btr_drain(btrn);
@@ -825,6 +825,7 @@ void btr_splice_out_node(struct btr_node *btrn)
                        list_move(&ch->node, &btrn->parent->children);
        }
        assert(list_empty(&btrn->children));
+       btrn->parent = NULL;
 }
 
 /**
@@ -878,7 +879,7 @@ int btr_exec_up(struct btr_node *btrn, const char *command, char **value_result)
                if (ret < 0)
                        return ret;
                if (value_result && *value_result)
-                       PARA_NOTICE_LOG("%s(%s): %s\n", command, parent->name,
+                       PARA_INFO_LOG("%s(%s): %s\n", command, parent->name,
                                *value_result);
                return 1;
        }
index 0ae015139fc915d5446cbb58b6eacf78d2d9eb2a..5f511708506a464e1a0e06f679eaa856ac015164 100644 (file)
--- a/client.c
+++ b/client.c
@@ -459,11 +459,6 @@ static int client_i9e_line_handler(char *line)
        return 1;
 }
 
-static void client_sighandler(int s)
-{
-       i9e_signal_dispatch(s);
-}
-
 static struct i9e_completer completers[] = {
        SERVER_COMPLETERS
        AFS_COMPLETERS
@@ -494,7 +489,7 @@ __noreturn static void interactive_session(void)
        }
        ici.history_file = history_file;
 
-       act.sa_handler = client_sighandler;
+       act.sa_handler = i9e_signal_dispatch;
        sigemptyset(&act.sa_mask);
        act.sa_flags = 0;
        sigaction(SIGINT, &act, NULL);
index 4a464ebf88c56ab4ed0257e39ae5767709819811..f520e3ea0ac7ff3d210d0d9c30b0a510302dba46 100644 (file)
--- a/command.c
+++ b/command.c
@@ -43,8 +43,6 @@ extern struct misc_meta_data *mmd;
 extern struct sender senders[];
 int send_afs_status(struct command_context *cc, int parser_friendly);
 
-const char *status_item_list[] = {STATUS_ITEM_ARRAY};
-
 static void dummy(__a_unused int s)
 {
 }
index c47aa954fd8a1bfc94cd3a3c379500ddc8a22a93..7f71017540455d716574ce831cf6b02773b5e71a 100644 (file)
--- a/daemon.c
+++ b/daemon.c
@@ -65,8 +65,6 @@ void daemon_set_default_log_colors(void)
  * \param arg The loglevel/color specifier.
  *
  * \a arg must be of the form "ll:[fg [bg]] [attr]".
- *
- * \return 1 On success, -1 on errors.
  */
 void daemon_set_log_color_or_die(char const *arg)
 {
diff --git a/ggo.h b/ggo.h
index d1105ef893716ccddfcf7e5e821d343061fb0d58..936fb1079ba07e5bd9cb36ff38b6c6afe242be53 100644 (file)
--- a/ggo.h
+++ b/ggo.h
@@ -7,7 +7,7 @@
 /** \file ggo.h Functions and structures for help text handling. */
 
 /**
- * Used by exexutables that can not use gengetopt's generated help function.
+ * Used by executables that can not use gengetopt's generated help function.
  */
 struct ggo_help {
        /** The lines of the short help text. */
index c3d918c51ab37069c05f879a2492b38d1ce6fd4d..b4bf1530d811fefb04c4f5b107e752e45d8e9048 100644 (file)
@@ -141,7 +141,7 @@ static void http_recv_close(struct receiver_node *rn)
 
 static void *http_recv_parse_config(int argc, char **argv)
 {
-       struct http_recv_args_info *tmp = para_calloc(sizeof(struct http_recv_args_info));
+       struct http_recv_args_info *tmp = para_calloc(sizeof(*tmp));
 
        if (!http_recv_cmdline_parser(argc, argv, tmp))
                return tmp;
index 6a29bffae5a68e783d4a4d788239b24455c4cb1e..f9ea3612ee8a1b0e80bef508051ed737b9a0ba05 100644 (file)
@@ -334,7 +334,6 @@ static void i9e_pre_select(struct sched *s, __a_unused struct task *t)
                PARA_WARNING_LOG("set to nonblock failed: (fd0 %d, %s)\n",
                        i9ep->ici->fds[0], para_strerror(-ret));
        para_fd_set(i9ep->ici->fds[0], &s->rfds, &s->max_fileno);
-       return;
 }
 
 static void update_winsize(void)
@@ -376,12 +375,14 @@ int i9e_open(struct i9e_client_info *ici, struct sched *s)
                return ret;
        i9ep->task.pre_select = i9e_pre_select;
        i9ep->task.post_select = i9e_post_select;
+       sprintf(i9ep->task.status, "i9e");
        register_task(s, &i9ep->task);
        rl_readline_name = "para_i9e";
        rl_basic_word_break_characters = " ";
        rl_attempted_completion_function = i9e_completer;
        i9ep->ici = ici;
        i9ep->stderr_stream = fdopen(ici->fds[2], "w");
+       setvbuf(i9ep->stderr_stream, NULL, _IONBF, 0);
 
        if (ici->history_file)
                read_history(ici->history_file);
diff --git a/para.h b/para.h
index 3b9559e1beb93062c7cd7cb1cd0daace402b85ae..0a14b99a51f0096e979983c9954f9617ea669097 100644 (file)
--- a/para.h
+++ b/para.h
@@ -71,6 +71,11 @@ extern __printf_2_3 void (*para_log)(int, const char*, ...);
                vfprintf(stderr, fmt, argp); \
                va_end(argp); \
        }
+/**
+ * Define the standard log function and activate it.
+ *
+ * \param loglevel_barrier See \ref DEFINE_STDERR_LOGGER.
+ */
 #define INIT_STDERR_LOGGING(loglevel_barrier) \
        DEFINE_STDERR_LOGGER(stderr_log, loglevel_barrier); \
        __printf_2_3 void (*para_log)(int, const char*, ...) = stderr_log;
diff --git a/recv.h b/recv.h
index ef2a596bacf9c1d59d8d616577c8f7cf5e83f614..c69520e402905524ebcb120bc44221f371d29371 100644 (file)
--- a/recv.h
+++ b/recv.h
@@ -108,9 +108,9 @@ struct receiver {
         * Evaluate the result from select().
         *
         * This hook gets called after the call to select(). It should check
-        * all file descriptors which were added to any of the the fd sets
-        * during the previous call to pre_select. According to the result, it
-        * may then use any non-blocking I/O to establish a connection or to
+        * all file descriptors which were added to any of the fd sets during
+        * the previous call to pre_select. According to the result, it may
+        * then use any non-blocking I/O to establish a connection or to
         * receive the audio data.
         *
         * \sa select(2), struct receiver.
diff --git a/sched.c b/sched.c
index 74f6a1b8a5effa6e13996771f4492fdee47d4bc0..2b54ce194fae897842ac94b39ff597828c8de8c4 100644 (file)
--- a/sched.c
+++ b/sched.c
@@ -192,6 +192,8 @@ void register_task(struct sched *s, struct task *t)
 /**
  * Unregister all tasks.
  *
+ * \param s The scheduler instance to shut down.
+ *
  * This will cause \a schedule() to return immediately because both the
  * \a pre_select_list and the \a post_select_list are empty. This function
  * must be called from the post_select (rather than the pre_select) method.
@@ -213,6 +215,8 @@ void sched_shutdown(struct sched *s)
 /**
  * Get the list of all registered tasks.
  *
+ * \param s The scheduler instance to get the task list from.
+ *
  * \return The task list.
  *
  * Each entry of the list contains an identifier which is simply a hex number.
index d3a9a5ae63eecdc202a9261568b6ccc21785377e..8e8cb5fdcdd31e012137a83a4661e2728ac345e4 100644 (file)
--- a/server.c
+++ b/server.c
@@ -17,7 +17,8 @@
  *       \ref audioc.c, \ref afh.c
  *     - Server: \ref server_command, \ref sender,
  *     - Audio file selector: \ref audio_format_handler, \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, \ref writer_node.
  *
  *
  * The gory details, listed by topic:
@@ -26,6 +27,7 @@
  *       \ref ogg_afh.c, \ref aac_afh.c, \ref wma_afh.c, \ref spx_afh.c
  *     - Decoders: \ref mp3dec_filter.c, \ref oggdec_filter.c,
  *       \ref aacdec_filter.c, \ref wmadec_filter.c, spxdec_filter.c,
+ *       \ref flacdec_filter.c,
  *     - Volume normalizer: \ref compress_filter.c,
  *     - Output: \ref alsa_write.c, \ref osx_write.c, \ref oss_write.c,
  *     - http: \ref http_recv.c, \ref http_send.c,
  *     - Spawning processes: \ref exec.c,
  *     - Inter process communication: \ref ipc.c,
  *     - Blob tables: \ref blob.c,
- *     - The error subssystem: \ref error.h.
+ *     - The error subsystem: \ref error.h.
  *     - Access control for paraslash senders: \ref acl.c, \ref acl.h.
  *     - Internal crypto API: \ref crypt.h.
+ *     - interactive sessions (libreadline): \ref interactive.c.
  *
  * Low-level data structures:
  *