src/irc_net.h
author Tero Marttila <terom@fixme.fi>
Mon, 09 Mar 2009 16:30:59 +0200
changeset 25 56367df4ce5b
child 26 aec062af155d
permissions -rw-r--r--
add irc_net module, and fix Makefile CFLAGS, add -Wextra
#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