aboutsummaryrefslogtreecommitdiff
path: root/src/shape.h
diff options
context:
space:
mode:
authorSopár Adrián <dev.adrian.sopar@protonmail.com>2023-01-27 00:05:24 +0100
committerSopár Adrián <dev.adrian.sopar@protonmail.com>2023-01-27 00:05:24 +0100
commit2c5a5f7679a5f450e483fdedc99c80622f260a4d (patch)
treec96f4f9020275e8853c92f008fa9f041e0529a57 /src/shape.h
Init commit.HEADmaster
Diffstat (limited to 'src/shape.h')
-rw-r--r--src/shape.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/shape.h b/src/shape.h
new file mode 100644
index 0000000..641b440
--- /dev/null
+++ b/src/shape.h
@@ -0,0 +1,21 @@
+#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 *);
+
+void shape_init(
+ struct shape *shape,
+ shape_area_t area,
+ shape_destroy_t destroy);
+
+int shape_sizeof();
+
+#endif