Object type checking fixes

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@638 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2000-08-30 22:29:55 +00:00 committed by cras
commit b4bdec4436
15 changed files with 78 additions and 75 deletions

View file

@ -4,14 +4,12 @@
#include "channels.h"
#include "irc-servers.h"
#define IS_IRC_CHANNEL(channel) \
((channel) != NULL && \
module_find_id("IRC CHANNEL", \
((IRC_CHANNEL_REC *) (channel))->chat_type) != -1)
/* Returns IRC_CHANNEL_REC if it's IRC channel, NULL if it isn't. */
#define IRC_CHANNEL(channel) \
(IS_IRC_CHANNEL(channel) ? (IRC_CHANNEL_REC *) (channel) : NULL)
MODULE_CHECK_CAST(channel, IRC_CHANNEL_REC, chat_type, "IRC CHANNEL")
#define IS_IRC_CHANNEL(channel) \
(IRC_CHANNEL(channel) ? TRUE : FALSE)
#define STRUCT_SERVER_REC IRC_SERVER_REC
typedef struct {