summaryrefslogtreecommitdiff
path: root/src/core/chat-protocols.h
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2001-02-17 19:44:22 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2001-02-17 19:44:22 +0000
commitbe6ba53fa47bc546279a2575523281845fe80da9 (patch)
tree2f08f6281cfbd38a1df2abe4fe69ccfd6f208f51 /src/core/chat-protocols.h
parent513e140bcebce617d6078a9532ab9976437c3ef6 (diff)
downloadirssi-be6ba53fa47bc546279a2575523281845fe80da9.zip
Config file: ircnets -> chatnets, added type = "chat protocol" to
chatnet config. Moved reading chatnets to core. Lots of other multiprotocol updates. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1237 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/chat-protocols.h')
-rw-r--r--src/core/chat-protocols.h24
1 files changed, 23 insertions, 1 deletions
diff --git a/src/core/chat-protocols.h b/src/core/chat-protocols.h
index 3f614a50..a8467333 100644
--- a/src/core/chat-protocols.h
+++ b/src/core/chat-protocols.h
@@ -7,6 +7,15 @@ typedef struct {
char *name;
char *fullname;
char *chatnet;
+
+ CHATNET_REC *(*create_chatnet) (void);
+ SERVER_SETUP_REC *(*create_server_setup) (void);
+ CHANNEL_SETUP_REC *(*create_channel_setup) (void);
+ SERVER_CONNECT_REC *(*create_server_connect) (void);
+
+ SERVER_REC *(*server_connect) (SERVER_CONNECT_REC *);
+ CHANNEL_REC *(*channel_create) (SERVER_REC *, const char *, int);
+ QUERY_REC *(*query_create) (const char *, const char *, int);
} CHAT_PROTOCOL_REC;
extern GSList *chat_protocols;
@@ -16,8 +25,12 @@ extern GSList *chat_protocols;
offsetof(cast, type_field), id))
void *chat_protocol_check_cast(void *object, int type_pos, const char *id);
+#define CHAT_PROTOCOL(object) \
+ ((object) == NULL ? chat_protocol_get_default() : \
+ chat_protocol_find_id((object)->chat_type))
+
/* Register new chat protocol. */
-void chat_protocol_register(CHAT_PROTOCOL_REC *rec);
+CHAT_PROTOCOL_REC *chat_protocol_register(CHAT_PROTOCOL_REC *rec);
/* Unregister chat protocol. */
void chat_protocol_unregister(const char *name);
@@ -26,6 +39,15 @@ void chat_protocol_unregister(const char *name);
int chat_protocol_lookup(const char *name);
CHAT_PROTOCOL_REC *chat_protocol_find(const char *name);
CHAT_PROTOCOL_REC *chat_protocol_find_id(int id);
+CHAT_PROTOCOL_REC *chat_protocol_find_net(GHashTable *optlist);
+
+/* Default chat protocol to use */
+void chat_protocol_set_default(CHAT_PROTOCOL_REC *rec);
+CHAT_PROTOCOL_REC *chat_protocol_get_default(void);
+
+/* Return "unknown chat protocol" record. Used when protocol name is
+ specified but it isn't registered yet. */
+CHAT_PROTOCOL_REC *chat_protocol_get_unknown(const char *name);
void chat_protocols_init(void);
void chat_protocols_deinit(void);