#ifndef TYPE_INFO_H #define TYPE_INFO_H #include #include typedef struct TypeInfo { size_t element_size; void (*copy)(void *dest, const void *src); void (*destroy)(void *elem); int (*compare)(const void *a, const void *b); // <0, 0, >0 void (*print)(const void *elem); bool (*parse)(void *dest, const char *str); // для ввода const char *type_name; } TypeInfo; // static inline используется для создания копии функции в каждом файле static inline bool types_equal(const TypeInfo *a, const TypeInfo *b) { return a == b; } #endif // TYPE_INFO_H