Commit | Line | Data |
---|---|---|
c4628760 | 1 | /* |
0235b0db | 2 | * SPDX-License-Identifier: MIT |
c4628760 | 3 | * |
0235b0db | 4 | * Copyright (c) 2015-2018 Philippe Proulx <pproulx@efficios.com> |
c4628760 PP |
5 | */ |
6 | ||
0235b0db MJ |
7 | #ifndef BABELTRACE_VALUES_INTERNAL_H |
8 | #define BABELTRACE_VALUES_INTERNAL_H | |
9 | ||
f1567d42 | 10 | #include <glib.h> |
4fa90f32 PP |
11 | #include <babeltrace2/babeltrace.h> |
12 | ||
13 | #include "lib/object.h" | |
f1567d42 PP |
14 | |
15 | struct bt_value { | |
16 | struct bt_object base; | |
17 | enum bt_value_type type; | |
18 | bt_bool frozen; | |
19 | }; | |
20 | ||
21 | struct bt_value_bool { | |
22 | struct bt_value base; | |
23 | bt_bool value; | |
24 | }; | |
25 | ||
26 | struct bt_value_integer { | |
27 | struct bt_value base; | |
fdd3a2da PP |
28 | union { |
29 | uint64_t i; | |
30 | int64_t u; | |
31 | } value; | |
f1567d42 PP |
32 | }; |
33 | ||
34 | struct bt_value_real { | |
35 | struct bt_value base; | |
36 | double value; | |
37 | }; | |
38 | ||
39 | struct bt_value_string { | |
40 | struct bt_value base; | |
41 | GString *gstr; | |
42 | }; | |
43 | ||
44 | struct bt_value_array { | |
45 | struct bt_value base; | |
46 | GPtrArray *garray; | |
47 | }; | |
48 | ||
49 | struct bt_value_map { | |
50 | struct bt_value base; | |
51 | GHashTable *ght; | |
52 | }; | |
c4628760 | 53 | |
d24d5663 | 54 | void _bt_value_freeze(const struct bt_value *object); |
f6ccaed9 PP |
55 | |
56 | #ifdef BT_DEV_MODE | |
57 | # define bt_value_freeze _bt_value_freeze | |
58 | #else | |
59 | # define bt_value_freeze(_value) | |
60 | #endif /* BT_DEV_MODE */ | |
61 | ||
c4628760 | 62 | #endif /* BABELTRACE_VALUES_INTERNAL_H */ |