src/irc_net.h
changeset 25 56367df4ce5b
child 26 aec062af155d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/irc_net.h	Mon Mar 09 16:30:59 2009 +0200
@@ -0,0 +1,50 @@
+#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