summaryrefslogtreecommitdiff
path: root/vector.h
blob: 88cf9c60f57d4ea444116cc2cc04a80c1e11d30b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef VECTOR
#define VECTOR
typedef char uint8
typedef struct Vector {
    int mx;
    int my;
} vector_t;

vector_t init_vector(int mx, int my);
uint8 vector_equals(vector_t v1, vector_t v2);
vector_t vector_add(vector_t v1, vector_t v2);
vector_t vector_sub(vector_t v1, vector_t v2);

typedef struct VectorP {
    vector_t *vectors;
    int length;
} vectorp_t;

vectorp_t init_vectorp(vector_t * vectors, int length);

/* removes a vector from vectorp */
vectorp_t remove_vector(vectorp_t vectorp, int index);
vectorp_t remove_vectors(vectorp_t vectorp, int *indexes, int indexCount);
typedef struct VectorPP {
    vectorp_t *vectorps;
    int length;
} vectorpp_t;

vectorpp_t init_vectorpp(vectorp_t * vectorps, int length);

#endif