]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
send.h
authorAndre Noll <maan@tuebingen.mpg.de>
Mon, 9 Jun 2025 21:38:50 +0000 (23:38 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 10 Jun 2025 14:04:43 +0000 (16:04 +0200)
send.h
send_common.c
web/DoxygenLayout.xml
web/documentation.in.html
web/para.css

diff --git a/send.h b/send.h
index a915135848978e20bb188c8a05c7c73ac213e763..775e1975942d8c36c2f6403aae7367ca98d0c785 100644 (file)
--- a/send.h
+++ b/send.h
@@ -2,23 +2,34 @@
 
 /** \file send.h Sender-related defines and structures.
  *
- * The file contains a little preprocessor fu to create the sender_subcommand
- * enumeration and the list of sender name strings without duplicating
- * the commands.
+ * All senders are always compiled in and are linked into para_server(1).
+ * The core structure of the sender API is struct \ref sender.
+ *
+ * The dccp and udp senders employ the FEC (forward error correction) API
+ * defined in \ref fec.c to register FEC clients to the virtual streaming
+ * system, which maintains the FEC client list. Clients are removed from
+ * the list if a fatal error occurs, or if the sender requests deletion of a
+ * client by calling \ref vss_del_fec_client(). To register a FEC client,
+ * the senders allocate a \ref fec_client_parms structure and pass it to
+ * \ref vss_add_fec_client().
+ *
+ * The file also contains a little preprocessor fu to create the
+ * sender_subcommand enumeration and the list of sender name strings without
+ * duplicating the commands.
  */
 
 /**
- * The list of sender subcommands. This is only defined once and expands
- * to a bunch of \ref SENDER_SUBCOMMAND (without the plural s) calls. We
- * shall define and then redefine \ref SENDER_SUBCOMMAND, expanding the \ref
- * SENDER_SUBCOMMANDS macro after each definition. The output is suitable
- * to either declare an enumeration or to define a string array.
+ * The list of sender subcommands. This is only defined once. We shall define
+ * and then redefine \ref SENDER_SUBCOMMAND (without the plural s), expanding
+ * \ref SENDER_SUBCOMMANDS after each definition. The two defintions result
+ * in output that is suitable to be part of an enumeration or a string array.
  *
  * The add and delete subcommands are only implemented by the udp sender
  * to add/delete one or more targets. The allow and deny subcommands
  * allow/deny connections from given IP address(es) and the on/off subcommands
  * activate/deactivate a sender.
- */
+ *
+ * \showinitializer */
 #define SENDER_SUBCOMMANDS \
        SENDER_SUBCOMMAND(add) \
        SENDER_SUBCOMMAND(delete) \
@@ -56,8 +67,8 @@ enum sender_subcommand {
 /**
  * Describes one sender of para_server(1).
  *
- * Each sender implements a bunch of methods. A method may be called by either
- * a command handler
+ * Each sender implements a bunch of methods which are called in server or
+ * in command handler context, or both.
  *
  * \sa \ref http_send.c \ref udp_send.c, \ref dccp_send.c.
  */
@@ -71,33 +82,32 @@ struct sender {
         */
        void (*init)(void);
        /**
-        * Return the help text of this sender.
+        * Return the dynamically allocated help text.
         *
-        * The result must be dynamically allocated and is freed by the caller.
+        * It will be freed by the caller.
         */
-       char* (*help)(void);
+       char * (*help)(void);
        /**
-        * Return current status info about this sender.
+        * Return current status information.
         *
-        * The result must be dynamically allocated and is freed by the caller.
+        * Like the help command, the result must be dynamically allocated
+        * and is freed by the caller.
         */
-       char* (*status)(void);
+       char * (*status)(void);
        /**
         * The send-hook.
         *
-        * It gets called whenever para_server is playing and the current
-        * audio format handler indicates that another chunk of data should
-        * be sent now. The two parameters \a current_chunk and \a chunks_sent
-        * only differ if the stream was repositioned by the \a ff or \a jmp
-        * command. Of course, \a buf is a pointer to the chunk of data which
-        * should be sent, and \a len is the length of this buffer.
+        * It gets called whenever para_server(1) is playing and the virtual
+        * streaming system detects that it is time to send another chunk
+        * of data. The two chunk values only differ if the stream was
+        * repositioned by the ff or jmp server subcommand.
         */
        void (*send)(long unsigned current_chunk, long unsigned chunks_sent,
                const char *buf, size_t len, const char *header_buf,
                size_t header_len);
        /** Ask the scheduler to monitor file descriptors. */
        void (*pre_monitor)(struct sched *s);
-       /** Perform I/O on the file descriptors which are ready. */
+       /** Send data to clients whose file descriptor is ready for I/O. */
        void (*post_monitor)(struct sched *s);
        /**
         * Terminate all connected clients.
@@ -112,7 +122,7 @@ struct sender {
         * Array of function pointers for the sender subcommands.
         *
         * Each sender may implement any subset of the sender commands by
-        * filling in the appropriate function pointer in the array. A \p NULL
+        * filling in the appropriate function pointer in the array. A NULL
         * pointer means this command is not implemented by this sender.
         */
        int (*client_cmds[NUM_SENDER_CMDS])(struct sender_command_data*);
@@ -129,10 +139,11 @@ struct sender {
 
 /** NULL-terminated list, defined in \ref vss.c. */
 extern const struct sender * const senders[];
+
 /** Iterate over all senders. */
 #define FOR_EACH_SENDER(_i) for ((_i) = 0; senders[(_i)]; (_i)++)
 
-/** Describes one client, connected to a paraslash sender. */
+/** Describes one connected client. */
 struct sender_client {
        /** The file descriptor of the client. */
        int fd;
@@ -148,17 +159,6 @@ struct sender_client {
        void *private_data;
 };
 
-/**
- * Each paraslash sender may register arbitrary many clients to the virtual
- * streaming system, possibly with varying fec parameters. In order to do so,
- * it must allocate a \a fec_client_parms structure and pass it to \ref
- * vss_add_fec_client.
- *
- * Clients are automatically removed from that list by the vss if an error
- * occurs, or if the sender requests deletion of a client by calling \ref
- * vss_del_fec_client().
- */
-
 /** FEC parameters requested by FEC clients. */
 struct fec_client_parms {
        /** Number of data slices plus redundant slices. */
index 324e40019ff31691ea267520c8ecea8f0d465c7d..1e524de5bf67d228670598de0a5d2da25ae5b681 100644 (file)
@@ -178,7 +178,7 @@ void free_sender_status(const struct sender_status *ss)
  * \param ss The sender.
  * \param name Used for printing the header line.
  *
- * \return The string printed in the "si" command.
+ * \return The string printed by the "sender status" subcommand.
  */
 __malloc char *generic_sender_status(struct sender_status *ss, const char *name)
 {
index 2479015495adcdebd509dfa691e7c1f76112d139..37b491339742f01eb7163e6f288f784cb90acb5f 100644 (file)
     <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
     <sourcelink visible="yes"/>
     <memberdecl>
-      <interfaces visible="yes" title=""/>
+      <functions title=""/>
       <classes visible="yes" title=""/>
       <structs visible="yes" title=""/>
-      <exceptions visible="yes" title=""/>
       <namespaces visible="yes" title=""/>
       <constantgroups visible="yes" title=""/>
       <defines title=""/>
       <typedefs title=""/>
       <sequences title=""/>
-      <dictionaries title=""/>
       <enums title=""/>
-      <functions title=""/>
       <variables title=""/>
-      <membergroups visible="yes"/>
     </memberdecl>
     <memberdef>
       <inlineclasses title=""/>
index 61239b8f50a1a3fc91eeec6db579a8baccec1ad3..95fcbb855ec77ab2f7fe2ec628c72a9cc5dc80f5 100644 (file)
@@ -45,6 +45,7 @@ subsystem. This selection is not exhaustive, though. </p>
        [<a href="doxygen/html/buffer__tree_8h.html">Buffer Trees</a>]
        [<a href="doxygen/html/afh_8h.html">Audio Format Handlers</a>]
        [<a href="doxygen/html/vss_8h.html">Virtual Streaming System</a>]
+       [<a href="doxygen/html/fec_8h.html">Forward Error Correction</a>]
        [<a href="doxygen/html/afs_8h.html">Audio File Selector</a>]
        [<a href="doxygen/html/send_8h.html">Senders</a>]
        [<a href="doxygen/html/recv_8h.html">Receivers</a>]
index 893aabfb40dc9c8b6a4b137c0bedb50bb9872459..3e12d5cc7399eefa3ecd6efd829344a22166ea54 100644 (file)
@@ -12,6 +12,10 @@ td {
        vertical-align: top;
 }
 
+h2.groupheader {
+       color: #ffffff;
+}
+
 span.slogan {
        font-size: 200%;
        font-weight: bold;