From 2c5a5f7679a5f450e483fdedc99c80622f260a4d Mon Sep 17 00:00:00 2001 From: Sopár Adrián Date: Fri, 27 Jan 2023 00:05:24 +0100 Subject: Init commit. --- v1/shape.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 v1/shape.h (limited to 'v1/shape.h') diff --git a/v1/shape.h b/v1/shape.h new file mode 100644 index 0000000..adc6ec8 --- /dev/null +++ b/v1/shape.h @@ -0,0 +1,19 @@ +#ifndef POC__SHAPE_H +#define POC__SHAPE_H + +struct shape; + +/* Calculates the area of the shape and returns the value. */ +double shape_area(struct shape *shape); +typedef double (*shape_area_t)(struct shape *); + +/* Deallocates the object. */ +void shape_destroy(struct shape *shape); +typedef void (*shape_destroy_t)(struct shape *); + +struct shape *shape_create( + void *obj, + shape_area_t area, + shape_destroy_t destroy); + +#endif -- cgit v1.2.3