X-Git-Url: https://jfr.im/git/solanum.git/blobdiff_plain/d48a5597687f200c468fd60c40853fdbbb53a85c..0ba1da59101281fd8c6a91e068ba6dab1b9292dd:/include/msg.h diff --git a/include/msg.h b/include/msg.h index 283eb9b2..4039d97d 100644 --- a/include/msg.h +++ b/include/msg.h @@ -20,14 +20,13 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA - * - * $Id: msg.h 6 2005-09-10 01:02:21Z nenolod $ */ #ifndef INCLUDED_msg_h #define INCLUDED_msg_h -#include "config.h" +#include "defaults.h" +#include "msgbuf.h" struct Client; @@ -44,17 +43,18 @@ typedef enum HandlerType } HandlerType; -/* struct Client* client_p - connection message originated from +/* struct MsgBuf* msgbuf_p - message buffer (including tags) + * struct Client* client_p - connection message originated from * struct Client* source_p - source of message, may be different from client_p - * int parc - parameter count - * char* parv[] - parameter vector + * int parc - parameter count (from msgbuf_p) + * char* parv[] - parameter vector (from msgbuf_p) */ -typedef int (*MessageHandler) (struct Client *, struct Client *, int, const char *[]); +typedef void (*MessageHandler) (struct MsgBuf *, struct Client *, struct Client *, int, const char *[]); struct MessageEntry { MessageHandler handler; - int min_para; + size_t min_para; }; /* Message table structure */ @@ -64,26 +64,19 @@ struct Message unsigned int count; /* number of times command used */ unsigned int rcount; /* number of times command used by server */ unsigned long bytes; /* bytes received for this message */ - 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 flags; + /* handlers: - * UNREGISTERED, CLIENT, RCLIENT, SERVER, OPER, LAST + * UNREGISTERED, CLIENT, RCLIENT, SERVER, ENCAP, OPER */ struct MessageEntry handlers[LAST_HANDLER_TYPE]; }; -#define MFLG_SLOW 0x01 /* executed roughly once per 2s */ -#define MFLG_UNREG 0x02 /* available to unregistered clients */ - -#define MAXPARA 15 - /* generic handlers */ -extern int m_ignore(struct Client *, struct Client *, int, const char **); -extern int m_not_oper(struct Client *, struct Client *, int, const char **); -extern int m_registered(struct Client *, struct Client *, int, const char **); -extern int m_unregistered(struct Client *, struct Client *, int, const char **); +extern void m_ignore(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +extern void m_not_oper(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +extern void m_registered(struct MsgBuf *, struct Client *, struct Client *, int, const char **); +extern void m_unregistered(struct MsgBuf *, struct Client *, struct Client *, int, const char **); #define mg_ignore { m_ignore, 0 } #define mg_not_oper { m_not_oper, 0 } @@ -92,7 +85,7 @@ extern int m_unregistered(struct Client *, struct Client *, int, const char **); /* * m_functions execute protocol messages on this server: - * int m_func(struct Client* client_p, struct Client* source_p, int parc, char* parv[]); + * void m_func(struct MsgBuf *, struct Client* client_p, struct Client* source_p, int parc, char* parv[]); * * client_p is always NON-NULL, pointing to a *LOCAL* client * structure (with an open socket connected!). This @@ -139,13 +132,13 @@ extern int m_unregistered(struct Client *, struct Client *, int, const char **); * * parv a NULL terminated list of parameter pointers, * - * parv[0], sender (prefix string), if not present - * this points to an empty string. + * parv[0], unused for historical reasons (formerly + * sender name) * 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 + * note: it is guaranteed that parv[1]..parv[parc-1] are all * non-NULL pointers. */