#include #include "shape.h" struct shape { shape_area_t area; shape_destroy_t destroy; }; double shape_area(struct shape *shape) { return shape->area(shape); } void shape_destroy(struct shape *shape) { shape->destroy(shape); } void shape_init( struct shape *shape, shape_area_t area, shape_destroy_t destroy) { shape->area = area; shape->destroy = destroy; } int shape_sizeof() { return sizeof(struct shape); }