initial commit
[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
12 /**
13 * @brief Signed integer type.
14 */
15 typedef int64_t Int;
16
17 /**
18 * @brief Unsigned integer type.
19 */
20 typedef uint64_t UInt;
21
22 /**
23 * @brief Data type for a real number.
24 */
25 typedef double Real;
26
27 /**
28 * @brief Boolean type (prefixed with C_ to avoid some conflicts).
29 */
30 typedef enum {
31 C_FALSE = 0, ///< False is mapped to 0
32 C_TRUE = 1 ///< True is mapped to 1
33 } Bool;
34
35 /**
36 * @brief Enumeration for the type of buffer or heap.
37 */
38 typedef enum {
39 MIN_T = 0, ///< Minimum element first.
40 MAX_T = 1 ///< Maximum element first.
41 } OrderType;
42
43 /**
44 * @brief Generic item-value type; 'value' may correspond e.g. to distance.
45 */
46 typedef struct ItemValue {
47 void* item; ///< Pointer to an item of any type.
48 Real value; ///< Value associated with the item.
49 } ItemValue;
50
51 #endif