diff options
author | Timo Sirainen <cras@irssi.org> | 2000-08-30 22:29:55 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-08-30 22:29:55 +0000 |
commit | b4bdec4436190d7ccb6252be388b5ee70c5c36f5 (patch) | |
tree | 5b80eb0eab42f347575c05dbff3361f9955cd6ee /src/core/modules.c | |
parent | cf7eb945ea769b51622a1c1cbbbc7e7a6a494df9 (diff) | |
download | irssi-b4bdec4436190d7ccb6252be388b5ee70c5c36f5.zip |
Object type checking fixes
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@638 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/modules.c')
-rw-r--r-- | src/core/modules.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/modules.c b/src/core/modules.c index fc10487d..85e19f2c 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -28,6 +28,12 @@ static GHashTable *uniqids, *uniqstrids; static GHashTable *idlookup, *stridlookup; static int next_uniq_id; +void *module_check_cast(void *object, int type_pos, const char *id) +{ + return object == NULL || + module_find_id(id, G_STRUCT_MEMBER(int, object, type_pos)) == -1 ? NULL : object; +} + /* return unique number across all modules for `id' */ int module_get_uniq_id(const char *module, int id) { |