]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
doxify dccp
authorAndre <maan@p133.(none)>
Sun, 26 Mar 2006 02:45:11 +0000 (04:45 +0200)
committerAndre <maan@p133.(none)>
Sun, 26 Mar 2006 02:45:11 +0000 (04:45 +0200)
Add documentation for all non-static functions, and move the defines
of the magic dccp constants from dccp.h to dccp.c as they are only
used there.

dccp.c
dccp.h
dccp_recv.c
dccp_send.c

diff --git a/dccp.c b/dccp.c
index b5cf7fd9abd106a5c942c96f0cab9e53445d12de..147e46307676b60025561e4f81167a3a72b22b90 100644 (file)
--- a/dccp.c
+++ b/dccp.c
@@ -16,6 +16,8 @@
  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  */
 
+/** \file dccp.c common functions of the dccp sender/receiver */
+
 /*
  * based on common.c of dccp-cs-0.01.tar.bz2,
  * (C) 2005 Ian McDonald <imcdnzl@gmail.com>
 #include "error.h"
 #include "dccp.h"
 
+/** \cond some magic dccp constants */
+#define SOL_DCCP 269
+#define SOCK_DCCP 6
+#define IPPROTO_DCCP 33
+#define DCCP_SOCKOPT_PACKET_SIZE 1
+#define DCCP_SOCKOPT_SERVICE 2
+/** \endcond */
+
+/**
+ * obtain a dccp socket for sending/receiving
+ *
+ * \return the file descriptor of the new socket or \p -E_DCCP_SOCKET
+ * on errors.
+ */
 int dccp_get_socket(void)
 {
        int s = socket(AF_INET, SOCK_DCCP, IPPROTO_DCCP);
@@ -34,6 +50,13 @@ int dccp_get_socket(void)
        return s;
 }
 
+/**
+ * prepare a dccp socket
+ *
+ * \param fd the file descriptor of the socket
+ *
+ * \returns positive on success, negative on errors.
+ */
 int dccp_set_socket(int fd)
 {
        int pkt_size = 256, ret;
diff --git a/dccp.h b/dccp.h
index 2443db8419e86e7c60917dbf026c2d3a3291d01b..438c77c75a93e428e5671febb6612e05e16a13b9 100644 (file)
--- a/dccp.h
+++ b/dccp.h
  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  */
 
+/** \file dccp.h functions exported by dccp.c */
+
 /*
  * based on common.h of dccp-cs-0.01.tar.bz2,
  * (C) 2005 Ian McDonald <imcdnzl@gmail.com>
  */
 
-#define SOL_DCCP 269
-#define SOCK_DCCP 6
-#define IPPROTO_DCCP 33
-#define DCCP_SOCKOPT_PACKET_SIZE 1
-#define DCCP_SOCKOPT_SERVICE 2
-
 int dccp_get_socket(void);
 int dccp_set_socket(int fd);
index 5cd523ae8cf2a1ace953bb0e85fb717620419efc..1ef1a31d8b865efbaf1c73f5ed042a59730026d0 100644 (file)
@@ -16,6 +16,8 @@
  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  */
 
+/** \file dccp_recv.c paraslash's dccp receiver */
+
 /*
  * based on client.c of dccp-cs-0.01.tar.bz2,
  * (C) 2005 Ian McDonald <imcdnzl@gmail.com>
@@ -35,7 +37,7 @@
 #include <sys/socket.h>
 #include <netdb.h>
 
-
+/** the size of the output buffer */
 #define DCCP_BUFSIZE 40960
 
 /**
index d56286a6874cb5d56dcb4c427fa4dc05bc001d52..74976cf202a27c430be96448011a966865fbf249 100644 (file)
@@ -16,6 +16,8 @@
  *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  */
 
+/** \file dccp_send.c paraslash's dccp sender */
+
 /*
  * based on server.c of dccp-cs-0.01.tar.bz2,
  * (C) 2005 Ian McDonald <imcdnzl@gmail.com>
@@ -44,7 +46,8 @@ struct dccp_client {
        struct sockaddr_in addr;
        /** the position of this client in the client list */
        struct list_head node;
-       int header_sent; /* non-zero if audio file header has been sent */
+       /** non-zero if audio file header has been sent */
+       int header_sent;
 };
 
 static void dccp_pre_select(__unused struct audio_format *af, int *max_fileno, fd_set *rfds,
@@ -204,6 +207,14 @@ static char *dccp_help(void)
        return make_message("no help available\n");
 }
 
+/**
+ * the init function of the dccp sender
+ *
+ * \param s pointer to the dccp sender struct
+ *
+ * It initializes all function pointers of \a s and starts
+ * listening on the given port.
+ */
 void dccp_send_init(struct sender *s)
 {
        int ret;