51#define ORIGIN_PRIVATE ":"
52#define ORIGIN_CHANNEL "#"
147 const char *pidfile,
void (*started)(
void));
183 const char *serverId,
const char *origin,
const char *filter,
262 CMETHOD ATTR_RETNONNULL;
272 const char *to,
const char *msg,
int action)
273 CMETHOD ATTR_NONNULL((2)) ATTR_NONNULL((3));
A configuration object for the integrated thread pool.
void IBThreadOpts_setQueueLen(IBThreadOpts *self, int num)
Set a fixed size for the queue of waiting thread jobs.
void IBThreadOpts_setMinQueueLen(IBThreadOpts *self, int num)
Set the minimum size for the queue of waiting thread jobs.
void IBThreadOpts_setNPerCpu(IBThreadOpts *self, int num)
Set number of threads per CPU.
void IBThreadOpts_setQLenPerThread(IBThreadOpts *self, int num)
Set the number of queue entries per thread.
void IBThreadOpts_setMaxThreads(IBThreadOpts *self, int num)
Set maximum number of threads.
void IBThreadOpts_setNThreads(IBThreadOpts *self, int num)
Set fixed number of threads.
void IBThreadOpts_setMaxQueueLen(IBThreadOpts *self, int num)
Set the maximum size for the queue of waiting thread jobs.
void IBThreadOpts_setDefNThreads(IBThreadOpts *self, int num)
Set default number of threads.
A bot event to be handled.
const IrcChannel * IrcBotEvent_channel(const IrcBotEvent *self)
The channel the event occured on.
IrcBotEventType IrcBotEvent_type(const IrcBotEvent *self)
The type of the event.
const char * IrcBotEvent_arg(const IrcBotEvent *self)
Additional arguments of the event.
const char * IrcBotEvent_from(const IrcBotEvent *self)
The sender of the message.
const char * IrcBotEvent_origin(const IrcBotEvent *self)
The origin of the event.
IrcBotResponse * IrcBotEvent_response(IrcBotEvent *self)
Obtain a response object to configure.
const char * IrcBotEvent_command(const IrcBotEvent *self)
The bot command.
const IrcServer * IrcBotEvent_server(const IrcBotEvent *self)
The server the event came from.
void IrcBot_shutdown(void(*shutdown)(void))
Set a custom shutdown function.
void IrcBot_startup(int(*startup)(void))
Set a custom startup function.
void IrcBot_addServer(IrcServer *server)
Add an IRC server to be managed by the bot.
void IrcBot_addHandler(IrcBotEventType eventType, const char *serverId, const char *origin, const char *filter, IrcBotHandler handler)
Register a handler for a bot event.
IBThreadOpts * IrcBot_threadOpts(void)
Obtain the current thread pool options for configuration.
void IrcBot_daemonize(long uid, long gid, const char *pidfile, void(*started)(void))
Request the bot to deamonize first when running.
int IrcBot_run(void)
Run the IRC bot.
A response to a bot event, to be filled by a handler.
void IrcBotResponse_addMsg(IrcBotResponse *self, const char *to, const char *msg, int action)
Add a message to a bot response.
Common preprocessor declarations for libircbot.
void(* IrcBotHandler)(IrcBotEvent *event)
Handler for a bot event.
Definition: ircbot.h:49
IrcBotEventType
Type of a bot event.
Definition: ircbot.h:36
@ IBET_BOTCOMMAND
A bot command, !-prefixed or sent private.
Definition: ircbot.h:37
@ IBET_CONNECTED
Connected to IRC server.
Definition: ircbot.h:39
@ IBET_CHANJOINED
Channel joined by bot.
Definition: ircbot.h:40
@ IBET_PRIVMSG
A generic PRIVMSG (channel or private)
Definition: ircbot.h:38
@ IBET_JOINED
Channel joined by other user.
Definition: ircbot.h:41
@ IBET_PARTED
Channel left by other user.
Definition: ircbot.h:42