Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2006-06-29 01:43:53 UTC
Modified files:
ChangeLog ircd/m_account.c ircd/m_admin.c ircd/m_asll.c
ircd/m_away.c
Log message:
Doxygenate m_a*.c
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.784 ircu2.10/ChangeLog:1.785
--- ircu2.10/ChangeLog:1.784 Wed Jun 28 17:52:40 2006
+++ ircu2.10/ChangeLog Wed Jun 28 18:43:43 2006
@@ -1,5 +1,27 @@
2006-06-28 Michael Poole <[EMAIL PROTECTED]>
+ * ircd/m_account.c (m_functions): Remove large cut-and-paste
+ comment.
+ (ms_account): Write full doxygen comment.
+
+ * ircd/m_admin.c (m_functions): Cut out the cut-and-paste.
+ (send_admin_info): Add doxygen comment.
+ (m_admin): Write full doxygen comment.
+ (mo_admin): Likewise.
+ (ms_admin): Likewise.
+
+ * ircd/m_asll.c (m_functions): Kill the yank-and-killed block.
+ (send_asll_reply): Add doxygen comment.
+ (ms_asll): Write full doxygen comment.
+ (mo_asll): Likewise.
+
+ * ircd/m_away.c (m_functions): Trim back excess growth.
+ (user_set_away): Write full doxygen comment.
+ (m_away): Likewise.
+ (ms_away): Likewise.
+
+2006-06-28 Michael Poole <[EMAIL PROTECTED]>
+
* doc/example.conf (Include): Update documentation to reflect
these changes.
Index: ircu2.10/ircd/m_account.c
diff -u ircu2.10/ircd/m_account.c:1.6 ircu2.10/ircd/m_account.c:1.7
--- ircu2.10/ircd/m_account.c:1.6 Fri Dec 10 21:13:46 2004
+++ ircu2.10/ircd/m_account.c Wed Jun 28 18:43:43 2006
@@ -19,65 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_account.c,v 1.6 2004/12/11 05:13:46 klmitch Exp $
+ * $Id: m_account.c,v 1.7 2006/06/29 01:43:43 entrope Exp $
*/
-/*
- * m_functions execute protocol messages on this server:
- *
- * cptr is always NON-NULL, pointing to a *LOCAL* client
- * structure (with an open socket connected!). This
- * identifies the physical socket where the message
- * originated (or which caused the m_function to be
- * executed--some m_functions may call others...).
- *
- * sptr is the source of the message, defined by the
- * prefix part of the message if present. If not
- * or prefix not found, then sptr==cptr.
- *
- * (!IsServer(cptr)) => (cptr == sptr), because
- * prefixes are taken *only* from servers...
- *
- * (IsServer(cptr))
- * (sptr == cptr) => the message didn't
- * have the prefix.
- *
- * (sptr != cptr && IsServer(sptr) means
- * the prefix specified servername. (?)
- *
- * (sptr != cptr && !IsServer(sptr) means
- * that message originated from a remote
- * user (not local).
- *
- * combining
- *
- * (!IsServer(sptr)) means that, sptr can safely
- * taken as defining the target structure of the
- * message in this server.
- *
- * *Always* true (if 'parse' and others are working correct):
- *
- * 1) sptr->from == cptr (note: cptr->from == cptr)
- *
- * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr
- * *cannot* be a local connection, unless it's
- * actually cptr!). [MyConnect(x) should probably
- * be defined as (x == x->from) --msa ]
- *
- * parc number of variable parameter strings (if zero,
- * parv is allowed to be NULL)
- *
- * parv a NULL terminated list of parameter pointers,
- *
- * parv[0], sender (prefix string), if not present
- * this points to an empty string.
- * parv[1]...parv[parc-1]
- * pointers to additional parameters
- * parv[parc] == NULL, *always*
- *
- * note: it is guaranteed that parv[0]..parv[parc-1] are all
- * non-NULL pointers.
- */
#include "config.h"
#include "client.h"
@@ -95,12 +39,18 @@
#include <stdlib.h>
#include <string.h>
-/*
- * ms_account - server message handler
+/** Handle an ACCOUNT message from a server connection.
*
- * parv[0] = sender prefix
- * parv[1] = numeric of client to act on
- * parv[2] = account name (12 characters or less)
+ * \a parv has the following elements:
+ * \li \a parv[1] is the numnick of the client to act on
+ * \li \a parv[2] is the account name
+ * \li \a parv[3] (optional) is the account timestamp
+ *
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int ms_account(struct Client* cptr, struct Client* sptr, int parc,
char* parv[])
Index: ircu2.10/ircd/m_admin.c
diff -u ircu2.10/ircd/m_admin.c:1.13 ircu2.10/ircd/m_admin.c:1.14
--- ircu2.10/ircd/m_admin.c:1.13 Fri Dec 10 21:13:46 2004
+++ ircu2.10/ircd/m_admin.c Wed Jun 28 18:43:43 2006
@@ -20,65 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_admin.c,v 1.13 2004/12/11 05:13:46 klmitch Exp $
+ * $Id: m_admin.c,v 1.14 2006/06/29 01:43:43 entrope Exp $
*/
-/*
- * m_functions execute protocol messages on this server:
- *
- * cptr is always NON-NULL, pointing to a *LOCAL* client
- * structure (with an open socket connected!). This
- * identifies the physical socket where the message
- * originated (or which caused the m_function to be
- * executed--some m_functions may call others...).
- *
- * sptr is the source of the message, defined by the
- * prefix part of the message if present. If not
- * or prefix not found, then sptr==cptr.
- *
- * (!IsServer(cptr)) => (cptr == sptr), because
- * prefixes are taken *only* from servers...
- *
- * (IsServer(cptr))
- * (sptr == cptr) => the message didn't
- * have the prefix.
- *
- * (sptr != cptr && IsServer(sptr) means
- * the prefix specified servername. (?)
- *
- * (sptr != cptr && !IsServer(sptr) means
- * that message originated from a remote
- * user (not local).
- *
- * combining
- *
- * (!IsServer(sptr)) means that, sptr can safely
- * taken as defining the target structure of the
- * message in this server.
- *
- * *Always* true (if 'parse' and others are working correct):
- *
- * 1) sptr->from == cptr (note: cptr->from == cptr)
- *
- * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr
- * *cannot* be a local connection, unless it's
- * actually cptr!). [MyConnect(x) should probably
- * be defined as (x == x->from) --msa ]
- *
- * parc number of variable parameter strings (if zero,
- * parv is allowed to be NULL)
- *
- * parv a NULL terminated list of parameter pointers,
- *
- * parv[0], sender (prefix string), if not present
- * this points to an empty string.
- * parv[1]...parv[parc-1]
- * pointers to additional parameters
- * parv[parc] == NULL, *always*
- *
- * note: it is guaranteed that parv[0]..parv[parc-1] are all
- * non-NULL pointers.
- */
#include "config.h"
#include "client.h"
@@ -95,6 +39,10 @@
/* #include <assert.h> -- Now using assert in ircd_log.h */
+/** Send local administrative information to \a sptr.
+ * @param[in] sptr Client who wants admin information.
+ * @return Zero.
+ */
static int send_admin_info(struct Client* sptr)
{
const struct LocalConf* admin = conf_get_local();
@@ -108,11 +56,17 @@
}
-/*
- * m_admin - generic message handler
+/** Handle an ADMIN message from a local client connection.
+ * This version will only work on the local server.
+ *
+ * \a parv has the following elements:
+ * \li \a parv[1] (optional) is the server name being interrogated.
*
- * parv[0] = sender prefix
- * parv[1] = servername
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int m_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
@@ -127,11 +81,16 @@
return send_admin_info(sptr);
}
-/*
- * mo_admin - oper message handler
+/** Handle an ADMIN message from an oper's connection.
*
- * parv[0] = sender prefix
- * parv[1] = servername
+ * \a parv has the following elements:
+ * \li \a parv[1] (optional) is the server name being interrogated.
+ *
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int mo_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
@@ -144,11 +103,16 @@
return send_admin_info(sptr);
}
-/*
- * ms_admin - server message handler
+/** Handle an ADMIN message from a server connection.
+ *
+ * \a parv has the following elements:
+ * \li \a parv[1] is the server name being interrogated.
*
- * parv[0] = sender prefix
- * parv[1] = servername
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int ms_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
Index: ircu2.10/ircd/m_asll.c
diff -u ircu2.10/ircd/m_asll.c:1.3 ircu2.10/ircd/m_asll.c:1.4
--- ircu2.10/ircd/m_asll.c:1.3 Fri Dec 10 21:13:46 2004
+++ ircu2.10/ircd/m_asll.c Wed Jun 28 18:43:43 2006
@@ -19,65 +19,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_asll.c,v 1.3 2004/12/11 05:13:46 klmitch Exp $
+ * $Id: m_asll.c,v 1.4 2006/06/29 01:43:43 entrope Exp $
*/
-/*
- * m_functions execute protocol messages on this server:
- *
- * cptr is always NON-NULL, pointing to a *LOCAL* client
- * structure (with an open socket connected!). This
- * identifies the physical socket where the message
- * originated (or which caused the m_function to be
- * executed--some m_functions may call others...).
- *
- * sptr is the source of the message, defined by the
- * prefix part of the message if present. If not
- * or prefix not found, then sptr==cptr.
- *
- * (!IsServer(cptr)) => (cptr == sptr), because
- * prefixes are taken *only* from servers...
- *
- * (IsServer(cptr))
- * (sptr == cptr) => the message didn't
- * have the prefix.
- *
- * (sptr != cptr && IsServer(sptr) means
- * the prefix specified servername. (?)
- *
- * (sptr != cptr && !IsServer(sptr) means
- * that message originated from a remote
- * user (not local).
- *
- * combining
- *
- * (!IsServer(sptr)) means that, sptr can safely
- * taken as defining the target structure of the
- * message in this server.
- *
- * *Always* true (if 'parse' and others are working correct):
- *
- * 1) sptr->from == cptr (note: cptr->from == cptr)
- *
- * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr
- * *cannot* be a local connection, unless it's
- * actually cptr!). [MyConnect(x) should probably
- * be defined as (x == x->from) --msa ]
- *
- * parc number of variable parameter strings (if zero,
- * parv is allowed to be NULL)
- *
- * parv a NULL terminated list of parameter pointers,
- *
- * parv[0], sender (prefix string), if not present
- * this points to an empty string.
- * parv[1]...parv[parc-1]
- * pointers to additional parameters
- * parv[parc] == NULL, *always*
- *
- * note: it is guaranteed that parv[0]..parv[parc-1] are all
- * non-NULL pointers.
- */
#include "config.h"
#include "client.h"
@@ -97,6 +41,15 @@
/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <stdlib.h>
+/** Send an AsLL report to \a to.
+ * @param[in] from Client that originated the report.
+ * @param[in] to Client receiving the report.
+ * @param[in] server Server on other end of link being reported.
+ * @param[in] rtt Round-trip time from \a from to \a server in milliseconds.
+ * @param[in] up Estimated latency from \a from to \a server in milliseconds.
+ * @param[in] down Estimated latency from \a server to \a from in milliseconds.
+ * @return Zero.
+ */
static int send_asll_reply(struct Client *from, struct Client *to, char
*server,
int rtt, int up, int down)
{
@@ -108,8 +61,24 @@
return 0;
}
-/*
- * ms_asll - server message handler
+/** Handle an ASLL message from a server.
+ *
+ * In the "outbound" direction, \a parv has the following elements:
+ * \li \a parv[1] is the mask of server(s) to report on.
+ * \li \a parv[2] (optional) is the server to interrogate.
+ *
+ * In the "return" direction, \a parv has the following elements:
+ * \li \a parv[1] is the user requesting the report.
+ * \li \a parv[2] is the name of the server on the other end of the link.
+ * \li \a parv[3] is round trip time.
+ * \li \a parv[4] is estimated latency from \a cptr to \a parv[2].
+ * \li \a parv[5] is estimated latency from \a parv[2] to \a cptr.
+ *
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int ms_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
@@ -146,8 +115,17 @@
return 0;
}
-/*
- * mo_asll - oper message handler
+/** Handle an ASLL message from an oper.
+ *
+ * \a parv has the following elements:
+ * \li \a parv[1] is the mask of server(s) to report on.
+ * \li \a parv[2] (optional) is the server to interrogate.
+ *
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int mo_asll(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
Index: ircu2.10/ircd/m_away.c
diff -u ircu2.10/ircd/m_away.c:1.13 ircu2.10/ircd/m_away.c:1.14
--- ircu2.10/ircd/m_away.c:1.13 Fri Dec 10 21:13:46 2004
+++ ircu2.10/ircd/m_away.c Wed Jun 28 18:43:43 2006
@@ -20,65 +20,9 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_away.c,v 1.13 2004/12/11 05:13:46 klmitch Exp $
+ * $Id: m_away.c,v 1.14 2006/06/29 01:43:43 entrope Exp $
*/
-/*
- * m_functions execute protocol messages on this server:
- *
- * cptr is always NON-NULL, pointing to a *LOCAL* client
- * structure (with an open socket connected!). This
- * identifies the physical socket where the message
- * originated (or which caused the m_function to be
- * executed--some m_functions may call others...).
- *
- * sptr is the source of the message, defined by the
- * prefix part of the message if present. If not
- * or prefix not found, then sptr==cptr.
- *
- * (!IsServer(cptr)) => (cptr == sptr), because
- * prefixes are taken *only* from servers...
- *
- * (IsServer(cptr))
- * (sptr == cptr) => the message didn't
- * have the prefix.
- *
- * (sptr != cptr && IsServer(sptr) means
- * the prefix specified servername. (?)
- *
- * (sptr != cptr && !IsServer(sptr) means
- * that message originated from a remote
- * user (not local).
- *
- * combining
- *
- * (!IsServer(sptr)) means that, sptr can safely
- * taken as defining the target structure of the
- * message in this server.
- *
- * *Always* true (if 'parse' and others are working correct):
- *
- * 1) sptr->from == cptr (note: cptr->from == cptr)
- *
- * 2) MyConnect(sptr) <=> sptr == cptr (e.g. sptr
- * *cannot* be a local connection, unless it's
- * actually cptr!). [MyConnect(x) should probably
- * be defined as (x == x->from) --msa ]
- *
- * parc number of variable parameter strings (if zero,
- * parv is allowed to be NULL)
- *
- * parv a NULL terminated list of parameter pointers,
- *
- * parv[0], sender (prefix string), if not present
- * this points to an empty string.
- * parv[1]...parv[parc-1]
- * pointers to additional parameters
- * parv[parc] == NULL, *always*
- *
- * note: it is guaranteed that parv[0]..parv[parc-1] are all
- * non-NULL pointers.
- */
#include "config.h"
#include "client.h"
@@ -96,12 +40,10 @@
/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <string.h>
-/*
- * user_set_away - set user away state
- * returns 1 if client is away or changed away message, 0 if
- * client is removing away status.
- * NOTE: this function may modify user and message, so they
- * must be mutable.
+/** Set a user's away state.
+ * @param[in] user User whose away message may be changed.
+ * @param[in] message New away message for \a user (or empty/null).
+ * @return Non-zero if user is away, zero if user is "here".
*/
static int user_set_away(struct User* user, char* message)
{
@@ -141,15 +83,16 @@
}
-/*
- * m_away - generic message handler
- * - Added 14 Dec 1988 by jto.
+/** Handle an AWAY message from a local user.
*
- * parv[0] = sender prefix
- * parv[1] = away message
+ * \a parv has the following elements:
+ * \li \a parv[1] (optional) is the new away message.
*
- * TODO: Throttle aways - many people have a script which resets the away
- * message every 10 seconds which really chews the bandwidth.
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int m_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
@@ -172,12 +115,16 @@
return 0;
}
-/*
- * ms_away - server message handler
- * - Added 14 Dec 1988 by jto.
+/** Handle an AWAY message from a server.
+ *
+ * \a parv has the following elements:
+ * \li \a parv[1] (optional) is the new away message.
*
- * parv[0] = sender prefix
- * parv[1] = away message
+ * See @ref m_functions for discussion of the arguments.
+ * @param[in] cptr Client that sent us the message.
+ * @param[in] sptr Original source of message.
+ * @param[in] parc Number of arguments.
+ * @param[in] parv Argument vector.
*/
int ms_away(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
{
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches