Doxyfy whocmds.h and whocmds.c.
authorMichael Poole <mdpoole@troilus.org>
Mon, 27 Sep 2004 21:48:07 +0000 (21:48 +0000)
committerMichael Poole <mdpoole@troilus.org>
Mon, 27 Sep 2004 21:48:07 +0000 (21:48 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1181 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

include/whocmds.h
ircd/whocmds.c

index c91d40251cc8d5ca460a6602328878a203018f78..02296006d341c24b68ced05ff6606a13143fa9b3 100644 (file)
@@ -22,39 +22,64 @@ struct Channel;
 
 /* 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 bbfa7ad380872c90b9e6155ace0880bacd5d6d17..3c7581f30450cd83d78c899867a47aa12349fca6 100644 (file)
  * 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$
+ */
+/* @file
+ * @brief Support functions for /WHO-like commands.
+ * @version $Id$
  */
 #include "config.h"
 
 #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 @@ void do_who(struct Client* sptr, struct Client* acptr, struct Channel* repchan,
   send_reply(sptr, fields ? RPL_WHOSPCRPL : RPL_WHOREPLY, ++p1);
 }
 
+/** Count number of users who match \a mask.
+ * @param[in] mask user\@host or user\@ip mask to check.
+ * @return Count of matching users.
+ */
 int
 count_users(char *mask)
 {