My C is a bit rusty. What do (void*)0xcafe and (void*)0xbeef in the example mean?
If you happen to know what a void* is pointing to, you can cast it to another type like "my_struct_t*" and deference the value. I would call it a work around for C lacking true polymorphism.