From: Andre Date: Sun, 26 Mar 2006 02:45:11 +0000 (+0200) Subject: doxify dccp X-Git-Tag: v0.2.12~131 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=a651debd8179d2a43d711b6f7f429a28bd2893c1;p=paraslash.git doxify dccp 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. --- diff --git a/dccp.c b/dccp.c index b5cf7fd9..147e4630 100644 --- 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 @@ -25,6 +27,20 @@ #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 2443db84..438c77c7 100644 --- a/dccp.h +++ b/dccp.h @@ -16,16 +16,12 @@ * 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 */ -#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); diff --git a/dccp_recv.c b/dccp_recv.c index 5cd523ae..1ef1a31d 100644 --- a/dccp_recv.c +++ b/dccp_recv.c @@ -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 @@ -35,7 +37,7 @@ #include #include - +/** the size of the output buffer */ #define DCCP_BUFSIZE 40960 /** diff --git a/dccp_send.c b/dccp_send.c index d56286a6..74976cf2 100644 --- a/dccp_send.c +++ b/dccp_send.c @@ -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 @@ -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;