Committer  : entrope
CVSROOT    : /cvsroot/undernet-ircu
Module     : ircu2.10
Commit time: 2004-10-03 17:02:34 UTC

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

Log message:

Doxyfy querycmds.h and querycmds.c.

---------------------- diff included ----------------------
Index: ircu2.10/include/querycmds.h
diff -u ircu2.10/include/querycmds.h:1.6 ircu2.10/include/querycmds.h:1.7
--- ircu2.10/include/querycmds.h:1.6    Fri Jun 29 08:51:00 2001
+++ ircu2.10/include/querycmds.h        Sun Oct  3 10:02:23 2004
@@ -1,7 +1,6 @@
-/*
- * querycmds.h
- *
- * $Id: querycmds.h,v 1.6 2001/06/29 15:51:00 kev Exp $
+/** @file
+ * @brief Interface and declarations for client counting functions.
+ * @version $Id: querycmds.h,v 1.7 2004/10/03 17:02:23 entrope Exp $
  */
 #ifndef INCLUDED_querycmds_h
 #define INCLUDED_querycmds_h
@@ -16,22 +15,23 @@
  * Structs
  */
 
+/** Counts types of clients, servers, etc.\ on the network. */
 struct UserStatistics {
   /* Local connections: */
-  unsigned int unknowns;  /* IsUnknown() || IsConnecting() || IsHandshake() */
-  unsigned int local_servers;   /* IsServer() && MyConnect() */
-  unsigned int local_clients;   /* IsUser() && MyConnect() */
+  unsigned int unknowns;  /**< Clients of types: unknown, connecting, handshake */
+  unsigned int local_servers;   /**< Directly connected servers. */
+  unsigned int local_clients;   /**< Directly connected clients. */
 
   /* Global counts: */
-  unsigned int servers;         /* IsServer() || IsMe() */
-  unsigned int clients;         /* IsUser() */
+  unsigned int servers;         /**< Known servers, including #me. */
+  unsigned int clients;         /**< Registered users. */
 
   /* Global user mode changes: */
-  unsigned int inv_clients;     /* IsUser() && IsInvisible() */
-  unsigned int opers;           /* IsUser() && IsOper() */
+  unsigned int inv_clients;     /**< Registered invisible users. */
+  unsigned int opers;           /**< Registered IRC operators. */
 
   /* Misc: */
-  unsigned int channels;
+  unsigned int channels;        /**< Existing channels. */
 };
 
 extern struct UserStatistics UserStats;
@@ -41,9 +41,12 @@
  */
 
 /* Macros for remote connections: */
+/** Count \a cptr as a new remote client. */
 #define Count_newremoteclient(UserStats, cptr)  (++UserStats.clients, 
++(cli_serv(cptr)->clients))
+/** Count a new remote server. */
 #define Count_newremoteserver(UserStats)  (++UserStats.servers)
 
+/** Count a remote user quit. */
 #define Count_remoteclientquits(UserStats,cptr)                \
   do { \
     --UserStats.clients; \
@@ -51,10 +54,13 @@
       --(cli_serv(cli_user(cptr)->server)->clients); \
   } while (0)
 
+/** Count a remote server quit. */
 #define Count_remoteserverquits(UserStats)      (--UserStats.servers)
 
 /* Macros for local connections: */
+/** Count a new local unknown connection. */
 #define Count_newunknown(UserStats)                     (++UserStats.unknowns)
+/** Update counters when \a cptr goes from unknown to registered. */
 #define Count_unknownbecomesclient(cptr, UserStats) \
   do { \
     --UserStats.unknowns; ++UserStats.local_clients; ++UserStats.clients; \
@@ -70,7 +76,9 @@
             max_connection_count, max_client_count); \
     } \
   } while(0)
+/** Update counters when \a cptr goes from unknown to server. */
 #define Count_unknownbecomesserver(UserStats)   do { --UserStats.unknowns; 
++UserStats.local_servers; ++UserStats.servers; } while(0)
+/** Update counters when \a cptr (a local user) disconnects. */
 #define Count_clientdisconnects(cptr, UserStats) \
   do \
   { \
@@ -78,7 +86,9 @@
     if (match(feature_str(FEAT_DOMAINNAME), cli_sockhost(cptr)) == 0) \
       --current_load.local_count; \
   } while(0)
+/** Update counters when a local server disconnects. */
 #define Count_serverdisconnects(UserStats)              do { 
--UserStats.local_servers; --UserStats.servers; } while(0)
+/** Update counters when an unknown client disconnects. */
 #define Count_unknowndisconnects(UserStats)             (--UserStats.unknowns)
 
 /*
Index: ircu2.10/ircd/querycmds.c
diff -u ircu2.10/ircd/querycmds.c:1.3 ircu2.10/ircd/querycmds.c:1.4
--- ircu2.10/ircd/querycmds.c:1.3       Sat Apr 21 14:49:13 2001
+++ ircu2.10/ircd/querycmds.c   Sun Oct  3 10:02:23 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: querycmds.c,v 1.3 2001/04/21 21:49:13 kev Exp $
+ */
+/** @file
+ * @brief Implementation of client counting functions.
+ * @version $Id: querycmds.c,v 1.4 2004/10/03 17:02:23 entrope Exp $
  */
 #include "config.h"
 
@@ -28,9 +30,10 @@
 
 #include <string.h>
 
-/* Counters of client/servers etc. */
+/** Counters of clients, servers etc. */
 struct UserStatistics UserStats;
 
+/** Initialize global #UserStats variable. */
 void init_counters(void)
 {
   memset(&UserStats, 0, sizeof(UserStats));
----------------------- End of diff -----------------------

Reply via email to