#ifndef IRC_CMD_H
#define IRC_CMD_H
/**
* @file
*
* Flexible command handlers callback lists for use with irc_lines
*/
#include "irc_conn.h"
#include "irc_line.h"
#include <sys/queue.h>
/**
* Single command -> handler mapping for lookup
*/
struct irc_cmd_handler {
/** The command name to match */
const char *command;
/** The handler function */
void (*func) (struct irc_conn *conn, const struct irc_line *line, void *arg);
};
/**
* List item for a chain of irc_cmd_handler entries, with the context pointer
*/
struct irc_cmd_chain {
/** The list of handler lookup entries */
struct irc_cmd_handler *handlers;
/** Opaque context arg */
void *arg;
/** Linked list */
STAILQ_ENTRY(irc_cmd_chain) node;
};
/*
* IRC command numerics
*/
#define IRC_RPL_WELCOME "001"
#endif /* IRC_CMD_H */