Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2004-09-27 21:48:17 UTC

Modified files:
     include/whocmds.h ircd/whocmds.c

Log message:

Doxyfy whocmds.h and whocmds.c.

---------------------- diff included ----------------------
Index: ircu2.10/include/whocmds.h
diff -u ircu2.10/include/whocmds.h:1.7 ircu2.10/include/whocmds.h:1.8
--- ircu2.10/include/whocmds.h:1.7      Tue Jan  7 02:06:43 2003
+++ ircu2.10/include/whocmds.h  Mon Sep 27 14:48:07 2004
@@ -1,7 +1,7 @@
 /*
  * whocmds.h
  *
- * $Id: whocmds.h,v 1.7 2003/01/07 10:06:43 a1kmm Exp $
+ * $Id: whocmds.h,v 1.8 2004/09/27 21:48:07 entrope Exp $
  */
 #ifndef INCLUDED_whocmds_h
 #define INCLUDED_whocmds_h
@@ -22,39 +22,64 @@
 
 /* Macros used only in here by m_who and its support functions */
 
-#define WHOSELECT_OPER 1
-#define WHOSELECT_EXTRA 2
+#define WHOSELECT_OPER 1   /**< Flag for /WHO: Show IRC operators. */
+#define WHOSELECT_EXTRA 2  /**< Flag for /WHO: Pull rank to see users. */
 
-#define WHO_FIELD_QTY 1
-#define WHO_FIELD_CHA 2
-#define WHO_FIELD_UID 4
-#define WHO_FIELD_NIP 8
-#define WHO_FIELD_HOS 16
-#define WHO_FIELD_SER 32
-#define WHO_FIELD_NIC 64
-#define WHO_FIELD_FLA 128
-#define WHO_FIELD_DIS 256
-#define WHO_FIELD_REN 512
-#define WHO_FIELD_IDL 1024
-#define WHO_FIELD_ACC 2048
+#define WHO_FIELD_QTY 1    /**< Display query type. */
+#define WHO_FIELD_CHA 2    /**< Show common channel name. */
+#define WHO_FIELD_UID 4    /**< Show username. */
+#define WHO_FIELD_NIP 8    /**< Show IP address. */
+#define WHO_FIELD_HOS 16   /**< Show hostname. */
+#define WHO_FIELD_SER 32   /**< Show server. */
+#define WHO_FIELD_NIC 64   /**< Show nickname. */
+#define WHO_FIELD_FLA 128  /**< Show flags (away, oper, chanop, etc). */
+#define WHO_FIELD_DIS 256  /**< Show hop count (distance). */
+#define WHO_FIELD_REN 512  /**< Show realname (info). */
+#define WHO_FIELD_IDL 1024 /**< Show idle time. */
+#define WHO_FIELD_ACC 2048 /**< Show account name. */
 
+/** Default fields for /WHO */
 #define WHO_FIELD_DEF ( WHO_FIELD_NIC | WHO_FIELD_UID | WHO_FIELD_HOS | WHO_FIELD_SER 
)
 
+/** Is \a ac plainly visible to \a s?
+ * @param[in] s Client trying to see \a ac.
+ * @param[in] ac Client being looked at.
+ */
 #define IS_VISIBLE_USER(s,ac) ((s==ac) || (!IsInvisible(ac)))
 
+/** Can \a s see \a ac by using the flags in \a b?
+ * @param[in] s Client trying to see \a ac.
+ * @param[in] ac Client being looked at.
+ * @param[in] b Bitset of extra flags (options: WHOSELECT_EXTRA).
+ */
 #define SEE_LUSER(s, ac, b) (IS_VISIBLE_USER(s, ac) || \
                              ((b & WHOSELECT_EXTRA) && MyConnect(ac) && \
                              (HasPriv((s), PRIV_SHOW_INVIS) || \
                               HasPriv((s), PRIV_SHOW_ALL_INVIS))))
 
+/** Can \a s see \a ac by using the flags in \a b?
+ * @param[in] s Client trying to see \a ac.
+ * @param[in] ac Client being looked at.
+ * @param[in] b Bitset of extra flags (options: WHOSELECT_EXTRA).
+ */
 #define SEE_USER(s, ac, b) (SEE_LUSER(s, ac, b) || \
                             ((b & WHOSELECT_EXTRA) && \
                               HasPriv((s), PRIV_SHOW_ALL_INVIS)))
 
+/** Should we show more clients to \a sptr?
+ * @param[in] sptr Client listing other users.
+ * @param[in,out] counter Default count for clients.
+ */
 #define SHOW_MORE(sptr, counter) (HasPriv(sptr, PRIV_UNLIMIT_QUERY) || (!(counter-- < 
0)) )
 
+/** Can \a s see \a chptr?
+ * @param[in] s Client trying to see \a chptr.
+ * @param[in] chptr Channel being looked at.
+ * @param[in] b Bitset of extra flags (options: WHOSELECT_EXTRA).
+ */
 #define SEE_CHANNEL(s, chptr, b) (!SecretChannel(chptr) || ((b & WHOSELECT_EXTRA) && 
HasPriv((s), PRIV_SEE_CHAN)))
 
+/** Maximum number of lines to send in response to a /WHOIS. */
 #define MAX_WHOIS_LINES 50
 
 /*
Index: ircu2.10/ircd/whocmds.c
diff -u ircu2.10/ircd/whocmds.c:1.20 ircu2.10/ircd/whocmds.c:1.21
--- ircu2.10/ircd/whocmds.c:1.20        Mon Sep 27 06:20:24 2004
+++ ircu2.10/ircd/whocmds.c     Mon Sep 27 14:48:07 2004
@@ -19,8 +19,10 @@
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * $Id: whocmds.c,v 1.20 2004/09/27 13:20:24 entrope Exp $
+ */
+/* @file
+ * @brief Support functions for /WHO-like commands.
+ * @version $Id: whocmds.c,v 1.21 2004/09/27 21:48:07 entrope Exp $
  */
 #include "config.h"
 
@@ -60,8 +62,12 @@
 #include <sys/stat.h>
 #include <unistd.h>
 
-/*
- * The function that actually prints out the WHO reply for a client found
+/** Send a WHO reply to a client who asked.
+ * @param[in] sptr Client who is searching for other users.
+ * @param[in] acptr Client who may be shown to \a sptr.
+ * @param[in] repchan Shared channel that provides visibility.
+ * @param[in] fields Bitmask of WHO_FIELD_* values, indicating what to show.
+ * @param[in] qrt Query type string (ignored unless \a fields & WHO_FIELD_QTY).
  */
 void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
             int fields, char* qrt)
@@ -245,6 +251,10 @@
   send_reply(sptr, fields ? RPL_WHOSPCRPL : RPL_WHOREPLY, ++p1);
 }
 
+/** Count number of users who match \a mask.
+ * @param[in] mask [EMAIL PROTECTED] or [EMAIL PROTECTED] mask to check.
+ * @return Count of matching users.
+ */
 int
 count_users(char *mask)
 {
----------------------- End of diff -----------------------

Reply via email to