From: Andre Noll Date: Tue, 26 Jun 2012 22:39:37 +0000 (+0200) Subject: Add execute mechanism to receiver nodes. X-Git-Tag: v0.4.12~7^2~16 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=4fa8cb43454bc7e6d958433b1524fdc2f455f2ad Add execute mechanism to receiver nodes. Currently, receiver nodes have not much information to offer which could be interesting for their child buffer tree nodes. This is about to change with the introduction of the afh receiver and the para_play executable. For example, para_play needs to query the number of chunks of the current audio file from the afh receiver in order to display playback progress. This patch adds only the new function pointer to struct receiver. The afh receiver will be the first user of this. --- diff --git a/audiod.c b/audiod.c index 03705089..791432ce 100644 --- a/audiod.c +++ b/audiod.c @@ -16,8 +16,8 @@ #include "list.h" #include "sched.h" #include "ggo.h" -#include "recv.h" #include "buffer_tree.h" +#include "recv.h" #include "filter.h" #include "grab_client.h" #include "client.cmdline.h" diff --git a/dccp_recv.c b/dccp_recv.c index ff9b347b..69bc1861 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -19,11 +19,11 @@ #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "recv.h" #include "string.h" #include "net.h" #include "fd.h" -#include "buffer_tree.h" #include "dccp_recv.cmdline.h" diff --git a/http_recv.c b/http_recv.c index c19facf7..48673afb 100644 --- a/http_recv.c +++ b/http_recv.c @@ -15,12 +15,12 @@ #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "recv.h" #include "http_recv.cmdline.h" #include "net.h" #include "string.h" #include "fd.h" -#include "buffer_tree.h" /** * the possible states of a http receiver node diff --git a/recv.c b/recv.c index c021b17b..3d5049ba 100644 --- a/recv.c +++ b/recv.c @@ -13,13 +13,13 @@ #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "recv.h" #include "recv.cmdline.h" #include "fd.h" #include "string.h" #include "error.h" #include "stdout.h" -#include "buffer_tree.h" #include "version.h" /** The gengetopt args info struct. */ diff --git a/recv.h b/recv.h index c69520e4..322ac572 100644 --- a/recv.h +++ b/recv.h @@ -119,6 +119,13 @@ struct receiver { /** The two help texts of this receiver. */ struct ggo_help help; + /** + * Answer a buffer tree query. + * + * This optional function pointer is used for inter node communications + * of the buffer tree nodes. See \ref btr_command_handler for details. + */ + btr_command_handler execute; }; /** Define an array of all available receivers. */ diff --git a/recv_common.c b/recv_common.c index 7d7d2b05..f0321df2 100644 --- a/recv_common.c +++ b/recv_common.c @@ -12,9 +12,9 @@ #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "recv.h" #include "string.h" -#include "buffer_tree.h" DEFINE_RECEIVER_ARRAY; diff --git a/udp_recv.c b/udp_recv.c index f4912e1e..ec188b5e 100644 --- a/udp_recv.c +++ b/udp_recv.c @@ -15,12 +15,12 @@ #include "list.h" #include "sched.h" #include "ggo.h" +#include "buffer_tree.h" #include "recv.h" #include "udp_recv.cmdline.h" #include "string.h" #include "net.h" #include "fd.h" -#include "buffer_tree.h" static void udp_recv_pre_select(struct sched *s, struct task *t) {