f202b26f78377b9a86ffe405fb2db9d8879a2eee
[cgds.git] / src / types.h
1 /**
2 * @file types.h
3 * @brief A few useful data types.
4 */
5
6 #ifndef CGDS_TYPES_H
7 #define CGDS_TYPES_H
8
9 #include <stdlib.h>
10 #include <stdint.h>
11 #include <stdbool.h>
12
13 /**
14 * @brief Signed integer type.
15 */
16 typedef int64_t Int;
17
18 /**
19 * @brief Unsigned integer type.
20 */
21 typedef uint64_t UInt;
22
23 /**
24 * @brief Data type for a real number.
25 */
26 typedef double Real;
27
28 /**
29 * @brief Enumeration for the type of buffer or heap.
30 */
31 typedef enum {
32 MIN_T = 0, ///< Minimum element first.
33 MAX_T = 1 ///< Maximum element first.
34 } OrderType;
35
36 /**
37 * @brief Generic item-value type; 'value' may correspond e.g. to distance.
38 */
39 typedef struct ItemValue {
40 void* item; ///< Pointer to an item of any type.
41 Real value; ///< Value associated with the item.
42 } ItemValue;
43
44 #endif