summary refs log tree commit diff stats
path: root/src/common/servlist.h
diff options
context:
space:
mode:
authorberkeviktor@aol.com <berkeviktor@aol.com>2011-02-24 04:14:30 +0100
committerberkeviktor@aol.com <berkeviktor@aol.com>2011-02-24 04:14:30 +0100
commit4a6ceffb98a0b785494f680d3776c4bfc4052f9e (patch)
tree850703c1c841ccd99f58d0b06084615aaebe782c /src/common/servlist.h
parentf16af8be941b596dedac3bf4e371ee2d21f4b598 (diff)
add xchat r1489
Diffstat (limited to 'src/common/servlist.h')
-rw-r--r--src/common/servlist.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/common/servlist.h b/src/common/servlist.h
new file mode 100644
index 00000000..9b7734f4
--- /dev/null
+++ b/src/common/servlist.h
@@ -0,0 +1,62 @@
+#ifndef XCHAT_SERVLIST_H
+#define XCHAT_SERVLIST_H
+
+typedef struct ircserver
+{
+	char *hostname;
+} ircserver;
+
+typedef struct ircnet
+{
+	char *name;
+	char *nick;
+	char *nick2;
+	char *user;
+	char *real;
+	char *pass;
+	char *autojoin;
+	char *command;
+	char *nickserv;
+	char *comment;
+	char *encoding;
+	GSList *servlist;
+	int selected;
+	guint32 flags;
+} ircnet;
+
+extern GSList *network_list;
+
+#define FLAG_CYCLE				1
+#define FLAG_USE_GLOBAL			2
+#define FLAG_USE_SSL				4
+#define FLAG_AUTO_CONNECT		8
+#define FLAG_USE_PROXY			16
+#define FLAG_ALLOW_INVALID		32
+#define FLAG_FAVORITE			64
+#define FLAG_COUNT				7
+
+void servlist_init (void);
+int servlist_save (void);
+int servlist_cycle (server *serv);
+void servlist_connect (session *sess, ircnet *net, gboolean join);
+int servlist_connect_by_netname (session *sess, char *network, gboolean join);
+int servlist_auto_connect (session *sess);
+int servlist_have_auto (void);
+int servlist_check_encoding (char *charset);
+void servlist_cleanup (void);
+
+ircnet *servlist_net_add (char *name, char *comment, int prepend);
+void servlist_net_remove (ircnet *net);
+ircnet *servlist_net_find (char *name, int *pos, int (*cmpfunc) (const char *, const char *));
+ircnet *servlist_net_find_from_server (char *server_name);
+
+void servlist_server_remove (ircnet *net, ircserver *serv);
+ircserver *servlist_server_add (ircnet *net, char *name);
+ircserver *servlist_server_find (ircnet *net, char *name, int *pos);
+
+void joinlist_split (char *autojoin, GSList **channels, GSList **keys);
+gboolean joinlist_is_in_list (server *serv, char *channel);
+void joinlist_free (GSList *channels, GSList *keys);
+gchar *joinlist_merge (GSList *channels, GSList *keys);
+
+#endif