aboutsummaryrefslogtreecommitdiff
path: root/v1/shape.h
diff options
context:
space:
mode:
Diffstat (limited to 'v1/shape.h')
-rw-r--r--v1/shape.h19
1 files changed, 19 insertions, 0 deletions
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