27 #ifndef __CLASS_INTERFACE_H__
28 #define __CLASS_INTERFACE_H__
30 #include <sys/types.h>
32 #define MAX_IFACE 32 // ATTENTION: every iface_impl will use MAX_IFACE * sizeof(void*)
34 #define IFACE(name) ((const struct i_##name const*)&i_##name##_impl)
35 #define INIT_IFACE(name,...) \
36 static const struct i_##name i_##name##_impl = {&i_##name,__VA_ARGS__}
38 #define NUMARGS(...) (sizeof((const void*[]){__VA_ARGS__})/sizeof(void*))
39 #define INIT_IFACE_IMPL(...) {NUMARGS(__VA_ARGS__), 0, {__VA_ARGS__}}
55 extern iface_ptr
interfaceGet(iface_impl_ptr,
const iface_ptr);
57 #endif // __CLASS_INTERFACE_H__
const struct interface * iface_ptr
const void * impl[MAX_IFACE]
iface_ptr interfaceGet(iface_impl_ptr, const iface_ptr)