aboutsummaryrefslogtreecommitdiff
path: root/v1/shape.h
blob: adc6ec84d47b4e8ae612fb60dc5d96ce3a36133b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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