2015-03-24 17:48:11 +00:00
|
|
|
#ifndef EVENTS_H
|
|
|
|
#define EVENTS_H
|
|
|
|
|
|
|
|
#include "irc.h"
|
|
|
|
|
2015-04-08 18:56:32 +00:00
|
|
|
#define PRIVMSG_SELF "CMSG"
|
|
|
|
#define PRIVMSG_CHAN "PMSG"
|
2024-02-13 07:22:10 +00:00
|
|
|
#define PRIVMSG_USER "UMSG"
|
2015-04-08 18:56:32 +00:00
|
|
|
#define JOIN "JOIN"
|
2024-02-13 07:22:10 +00:00
|
|
|
#define PART "PART"
|
|
|
|
#define QUIT "QUIT"
|
2015-04-08 18:56:32 +00:00
|
|
|
#define IRC_CONNECTED "001"
|
2024-02-13 07:22:10 +00:00
|
|
|
#define IRC_MOTD "372"
|
|
|
|
#define IRC_END_MOTD "376"
|
2015-03-26 23:20:59 +00:00
|
|
|
|
2024-02-13 10:56:23 +00:00
|
|
|
struct ev_handler
|
2015-03-26 23:20:59 +00:00
|
|
|
{
|
2024-02-13 10:56:23 +00:00
|
|
|
int id;
|
|
|
|
void *handler;
|
2015-03-26 23:20:59 +00:00
|
|
|
};
|
|
|
|
|
2024-02-13 10:56:23 +00:00
|
|
|
struct handler
|
2015-04-18 15:51:15 +00:00
|
|
|
{
|
2024-02-13 07:22:10 +00:00
|
|
|
char *type;
|
2024-02-13 10:56:23 +00:00
|
|
|
int count;
|
|
|
|
struct ev_handler *evhands;
|
2015-04-18 15:51:15 +00:00
|
|
|
};
|
|
|
|
|
2024-02-13 10:56:23 +00:00
|
|
|
|
2015-03-26 23:20:59 +00:00
|
|
|
void init_events();
|
2024-02-13 07:22:10 +00:00
|
|
|
MY_API int add_handler(char *type, void *handler);
|
2015-04-08 18:56:32 +00:00
|
|
|
void del_handler(int num, char *type);
|
2024-02-13 10:56:23 +00:00
|
|
|
void fire_handler(struct irc_conn *bot, char *type, ...);
|
2015-03-24 17:48:11 +00:00
|
|
|
|
2024-02-13 07:22:10 +00:00
|
|
|
#endif
|