cutes/mirror.c

22 lines
719 B
C
Raw Normal View History

2024-01-25 13:08:23 +00:00
#include "mirror.h"
MirroredTypeclass* internal_mirror_get_typeclass(void* self, IMirror const* tc, const char* typeclass) {
return dictionary_get_raw(tc->get_typeclasses(self), typeclass);
}
const void* mirror_get_typeclass(void* data, IMirror const* tc, const char* typeclass) {
MirroredTypeclass* class = internal_mirror_get_typeclass(data, tc, typeclass);
if(class != NULL)
return class->typeclass;
else
return NULL;
}
void* mirror_get_function(void* data, IMirror const* tc, const char* typeclass_name) {
MirroredTypeclass* class = internal_mirror_get_typeclass(data, tc, typeclass_name);
if(class != NULL)
return class->function;
else
return NULL;
}