diff options
Diffstat (limited to 'src/core/modules.c')
-rw-r--r-- | src/core/modules.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/core/modules.c b/src/core/modules.c index 85e19f2c..7b81bff2 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -30,8 +30,16 @@ 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 object == NULL || module_find_id(id, + G_STRUCT_MEMBER(int, object, type_pos)) == -1 ? NULL : object; +} + +void *module_check_cast_module(void *object, int type_pos, + const char *module, const char *id) +{ + return object == NULL || strcmp(module_find_id_str(module, + G_STRUCT_MEMBER(int, object, type_pos)), id) == 0 ? + NULL : object; } /* return unique number across all modules for `id' */ |