Author: Kev <klmitch@mit.edu>
[ircu2.10.12-pk.git] / include / msg.h
index 09c86dba5c6b3f807a9039cd8ba2d5d0bdd94c16..18b5ba37719478defc5a22a6f0d2ce6328b802f5 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 Command and token declarations and structures.
+ * @version $Id$
  */
 #ifndef INCLUDED_msg_h
 #define INCLUDED_msg_h
@@ -154,6 +156,10 @@ struct Client;
 #define TOK_WALLOPS             "WA"
 #define CMD_WALLOPS            MSG_WALLOPS, TOK_WALLOPS
 
+#define MSG_WALLUSERS           "WALLUSERS"     /* WALL */
+#define TOK_WALLUSERS           "WU"
+#define CMD_WALLUSERS          MSG_WALLUSERS, TOK_WALLUSERS
+
 #define MSG_DESYNCH             "DESYNCH"       /* DESY */
 #define TOK_DESYNCH             "DS"
 #define CMD_DESYNCH            MSG_DESYNCH, TOK_DESYNCH
@@ -194,6 +200,10 @@ struct Client;
 #define TOK_WALLCHOPS           "WC"
 #define CMD_WALLCHOPS          MSG_WALLCHOPS, TOK_WALLCHOPS
 
+#define MSG_WALLVOICES           "WALLVOICES"     /* WV */
+#define TOK_WALLVOICES           "WV"
+#define CMD_WALLVOICES         MSG_WALLVOICES, TOK_WALLVOICES
+
 #define MSG_CPRIVMSG            "CPRIVMSG"      /* CPRI */
 #define TOK_CPRIVMSG            "CP"
 #define CMD_CPRIVMSG           MSG_CPRIVMSG, TOK_CPRIVMSG
@@ -322,28 +332,69 @@ struct Client;
 #define TOK_CLEARMODE           "CM"
 #define CMD_CLEARMODE          MSG_CLEARMODE, TOK_CLEARMODE
 
+#define MSG_ACCOUNT            "ACCOUNT"       /* ACCO */
+#define TOK_ACCOUNT            "AC"
+#define CMD_ACCOUNT            MSG_ACCOUNT, TOK_ACCOUNT
+
+#define MSG_ASLL               "ASLL"          /* ASLL */
+#define TOK_ASLL               "LL"
+#define CMD_ASLL               MSG_ASLL, TOK_ASLL
+
+#define MSG_POST                "POST"          /* POST */
+#define TOK_POST                "POST"
+
+#define MSG_SET                        "SET"           /* SET */
+#define TOK_SET                        "SET"
+
+#define MSG_RESET              "RESET"         /* RESE */
+#define TOK_RESET              "RESET"
+
+#define MSG_GET                        "GET"           /* GET */
+#define TOK_GET                        "GET"
+
+#define MSG_PRIVS              "PRIVS"         /* PRIV */
+#define TOK_PRIVS              "PR"
+#define CMD_PRIVS               MSG_PRIVS, TOK_PRIVS
+
+#define MSG_CAP                        "CAP"
+#define TOK_CAP                        "CAP"
+#define CMD_CAP                        MSG_CAP, TOK_CAP
+
+#define MSG_XQUERY             "XQUERY"
+#define TOK_XQUERY             "XQ"
+#define CMD_XQUERY             MSG_XQUERY, TOK_XQUERY
+
+#define MSG_XREPLY             "XREPLY"
+#define TOK_XREPLY             "XR"
+#define CMD_XREPLY             MSG_XREPLY, TOK_XREPLY
+
 /*
  * Constants
  */
-#define   MFLG_SLOW              0x01   /* Command can be executed roughly    *
-                                         * once per 2 seconds.                */
-#define   MFLG_UNREG             0x02   /* Command available to unregistered  *
-                                         * clients.                           */
-#define   MFLG_IGNORE            0x04   /* silently ignore command from
-                                         * unregistered clients */
+#define   MFLG_SLOW              0x01   /** Limit command usage to
+                                         * once per 2 seconds (for
+                                         * local users). */
+#define   MFLG_UNREG             0x02   /** Command available to
+                                         * unregistered clients. */
+#define   MFLG_IGNORE            0x04   /** Silently ignore command from
+                                         * unregistered clients. */
+#define   MFLG_EXTRA             0x08   /** Handler requests that
+                                         * mptr->extra be passed in
+                                         * parv[1]. */
 
 /*
  * Structures
  */
+
+/** Information on how to parse a message. */
 struct Message {
-  char *cmd;                  /* command string */
-  char *tok;                  /* token (shorter command string) */
-  unsigned int count;         /* number of times message used */
-  unsigned int parameters;
-  unsigned int flags;           /* bit 0 set means that this command is allowed
-                                   to be used only on the average of once per 2
-                                   seconds -SRB */
-  unsigned int bytes;         /* bytes received for this message */
+  char *cmd;                  /**< command string */
+  char *tok;                  /**< token (shorter command string) */
+  unsigned int count;         /**< number of times message used */
+  unsigned int parameters;    /**< minimum number of parameters */
+  unsigned int flags;         /**< MFLG_* flags for command */
+  unsigned int bytes;         /**< bytes received for this message */
+  void *extra;                /**< extra pointer to be passed in parv[1] */
   /*
    * cptr = Connected client ptr
    * sptr = Source client ptr