2000-08-31 20:26:46 -04:00
|
|
|
#ifndef __CHAT_PROTOCOLS_H
|
|
|
|
#define __CHAT_PROTOCOLS_H
|
|
|
|
|
2000-09-30 18:49:48 -04:00
|
|
|
typedef struct {
|
2000-10-01 16:48:10 -04:00
|
|
|
int id;
|
|
|
|
|
2000-09-30 18:49:48 -04:00
|
|
|
char *name;
|
|
|
|
char *fullname;
|
|
|
|
char *chatnet;
|
|
|
|
} CHAT_PROTOCOL_REC;
|
|
|
|
|
2000-10-01 16:48:10 -04:00
|
|
|
extern GSList *chat_protocols;
|
|
|
|
|
2000-08-31 20:26:46 -04:00
|
|
|
#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. */
|
2000-09-30 18:49:48 -04:00
|
|
|
void chat_protocol_register(CHAT_PROTOCOL_REC *rec);
|
2000-08-31 20:26:46 -04:00
|
|
|
|
|
|
|
/* Unregister chat protocol. */
|
|
|
|
void chat_protocol_unregister(const char *name);
|
|
|
|
|
2000-10-01 16:48:10 -04:00
|
|
|
/* Find functions */
|
2000-08-31 20:26:46 -04:00
|
|
|
int chat_protocol_lookup(const char *name);
|
2000-10-01 16:48:10 -04:00
|
|
|
CHAT_PROTOCOL_REC *chat_protocol_find(const char *name);
|
|
|
|
CHAT_PROTOCOL_REC *chat_protocol_find_id(int id);
|
2000-08-31 20:26:46 -04:00
|
|
|
|
|
|
|
void chat_protocols_init(void);
|
|
|
|
void chat_protocols_deinit(void);
|
|
|
|
|
|
|
|
#endif
|