/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef __H_VEC__
#define __H_VEC__

#include <stdlib.h>
#include <stdint.h>
#include "defs.h"

/** @file
 * @defgroup Vectors Vectors
 * @addtogroup Vectors
 * @{
 * Vectors are multi value structures that can be used when doing some types of
 * maths.
 */

BEGIN_DECLS

/**
 * @defgroup Vec3 Vec3
 * @addtogroup Vec3
 * @{
 * @brief
 * A Vector of three standard int values.
 *
 * A Vec3 is considerer a primitive type and as such has no ref/unref memory
 * management and no vec_free function. You will have to do that yourself.
 *
 * @sa vec3_new
 * @sa Vec3_16
 */
typedef struct Vec3 {
  int a;
  int b;
  int c;
} Vec3;

/** @brief
 * allocates and initialises a Vec3 pointer.
 *
 * @sa Vec3
 */
Vec3 * vec3_new (int a, int b, int c);

/** @} */

/**
 * @defgroup Vec3_16 Vec3_16
 * @addtogroup Vec3_16
 * @{
 * @brief
 * A Vector of three 16 bit int values.
 *
 * @sa vec3_16_new
 * @sa Vec3
 */
typedef struct Vec3_16 {
  int16_t a;
  int16_t b;
  int16_t c;
} Vec3_16;

/**
 * @brief
 * allocates and initialises a Vec3_16 pointer.
 * 
 * @sa Vec3_16
 */
Vec3_16 * vec3_16_new (int16_t a, int16_t b, int16_t c);

/** @} @} */

END_DECLS

#endif /* __H_VEC__ */