Added chat protocol register. Changed all chat_type fields to use it.

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@640 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-09-01 00:26:46 +00:00 committed by cras
commit 28a7908e73
26 changed files with 259 additions and 62 deletions

29
src/core/chat-protocols.h Normal file
View file

@ -0,0 +1,29 @@
#ifndef __CHAT_PROTOCOLS_H
#define __CHAT_PROTOCOLS_H
#define PROTO_CHECK_CAST(object, cast, type_field, id) \
((cast *) chat_protocol_check_cast(object, \
offsetof(cast, type_field), id))
void *chat_protocol_check_cast(void *object, int type_pos, const char *id);
/* Register new chat protocol. */
void chat_protocol_register(const char *name,
const char *fullname,
const char *chatnet);
/* Unregister chat protocol. */
void chat_protocol_unregister(const char *name);
/* Return the ID for the specified chat protocol. */
int chat_protocol_lookup(const char *name);
/* Return the name for the specified chat protocol ID. */
const char *chat_protocol_get_name(int id);
/* Return the full name for the specified chat protocol ID. */
const char *chat_protocol_get_fullname(int id);
/* Return the chatnet identifier name for the specified chat protocol ID. */
const char *chat_protocol_get_chatnet(int id);
void chat_protocols_init(void);
void chat_protocols_deinit(void);
#endif