bzr branch
http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
|
27
by Gustav Hartvigsson
* added skeleton for the SBox type. |
1 |
#ifndef __H_VEC__
|
2 |
#define __H_VEC__
|
|
3 |
||
4 |
#include <stdlib.h> |
|
|
30
by Gustav Hartvigsson
* Made the code compile using CMake. |
5 |
#include <stdint.h> |
6 |
#include "defs.h" |
|
|
27
by Gustav Hartvigsson
* added skeleton for the SBox type. |
7 |
|
8 |
/** @file
|
|
9 |
* Contains the definitions of Vectors.
|
|
10 |
*/
|
|
11 |
||
12 |
BEGIN_DECLS
|
|
13 |
||
14 |
/** @brief
|
|
15 |
* A Vector of three standard int values.
|
|
16 |
*
|
|
17 |
* A Vec3 is considerer a primitive type and as such has no ref/unref memory
|
|
18 |
* management and no vec_free function. You will have to do that yourself.
|
|
19 |
*
|
|
20 |
* @sa vec3_new
|
|
21 |
* @sa Vec3_16
|
|
22 |
*/
|
|
23 |
typedef struct Vec3 { |
|
24 |
int a; |
|
25 |
int b; |
|
26 |
int c; |
|
27 |
} Vec3; |
|
28 |
||
29 |
/** @brief
|
|
30 |
* allocates and initialises a Vec3 pointer.
|
|
31 |
*
|
|
32 |
* @sa Vec3
|
|
33 |
*/
|
|
34 |
Vec3 * vec3_new (int a, int b, int c); |
|
35 |
||
36 |
/** @brief
|
|
37 |
* A Vector of three 16 bit int values.
|
|
38 |
*
|
|
39 |
* @sa vec3_16_new
|
|
40 |
* @sa Vec3
|
|
41 |
*/
|
|
42 |
typedef struct Vec3_16 { |
|
43 |
int16_t a; |
|
44 |
int16_t b; |
|
45 |
int16_t c; |
|
46 |
} Vec3_16; |
|
47 |
||
48 |
/** @brief
|
|
49 |
* allocates and initialises a Vec3_16 pointer.
|
|
50 |
*
|
|
51 |
* @sa Vec3_16
|
|
52 |
*/
|
|
53 |
Vec3_16 * vec3_16_new (int16_t a, int16_t b, int16_t c); |
|
54 |
||
55 |
END_DECLS
|
|
56 |
||
57 |
#endif /* __H_VEC__ */ |
|
58 |