#ifndef IRC_NET_H
#define IRC_NET_H
/**
* @file
*
* Support for IRC networks. This is similar to an IRC connection, but we keep track of channel state, and handle
* reconnects.
*/
#include "error.h"
#include "irc_conn.h"
/**
* Configuration info for an IRC network
*/
struct irc_net_info {
/** The name of the network */
const char *network;
/** The hostname to connect to */
const char *hostname;
/** Service name (port) */
const char *service;
/** SSL? */
bool use_ssl;
/** Protocol registration info */
struct irc_conn_config register_info;
};
/**
* IRC Network state
*/
struct irc_net {
/* The current connection */
struct irc_conn *conn;
};
/**
* Create a new IRC network state, using the given network info to connect/register.
*
* Errors are returned via *err, also returning the error code.
*/
err_t irc_net_create (struct irc_net **net, const struct irc_net_info *info, struct error_info *err);
#endif